lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5845] Remove otiose checks


From: Greg Chicares
Subject: [lmi-commits] [5845] Remove otiose checks
Date: Thu, 21 Nov 2013 13:19:41 +0000

Revision: 5845
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5845
Author:   chicares
Date:     2013-11-21 13:19:40 +0000 (Thu, 21 Nov 2013)
Log Message:
-----------
Remove otiose checks

Modified Paths:
--------------
    lmi/trunk/xml_lmi.cpp

Modified: lmi/trunk/xml_lmi.cpp
===================================================================
--- lmi/trunk/xml_lmi.cpp       2013-11-21 00:04:26 UTC (rev 5844)
+++ lmi/trunk/xml_lmi.cpp       2013-11-21 13:19:40 UTC (rev 5845)
@@ -48,8 +48,7 @@
 ///
 /// Precondition: argument names an accessible xml file.
 ///
-/// Postconditions: member parser_ is a non-null pointer; the object
-/// it points to is valid in that its operator!() returns false.
+/// Postconditions: member parser_ is valid.
 ///
 /// Throws: std::runtime_error, via fatal_error(), if a precondition
 /// is violated, or if xml-library calls throw an exception derived
@@ -69,16 +68,6 @@
             throw std::runtime_error("File does not exist.");
             }
         parser_.reset(new DomParser(filename.c_str()));
-        if(0 == parser_.get())
-            {
-            throw std::runtime_error("Parser not initialized.");
-            }
-        if(true == parser_->operator!())
-            {
-            throw std::runtime_error
-                ("Parser failed: " + parser_->messages().print()
-                );
-            }
         }
     catch(std::exception const& e)
         {
@@ -90,8 +79,7 @@
 ///
 /// Precondition: arguments describe an xml string.
 ///
-/// Postconditions: member parser_ is a non-null pointer; the object
-/// it points to is valid in that its operator!() returns false.
+/// Postconditions: member parser_ is valid.
 ///
 /// Throws: std::runtime_error, via fatal_error(), if a precondition
 /// is violated, or if xml-library calls throw an exception derived
@@ -103,16 +91,6 @@
         {
         error_context_ = "Unable to parse xml data: ";
         parser_.reset(new DomParser(data, length));
-        if(0 == parser_.get())
-            {
-            throw std::runtime_error("Parser not initialized.");
-            }
-        if(true == parser_->operator!())
-            {
-            throw std::runtime_error
-                ("Parser failed: " + parser_->messages().print()
-                );
-            }
         }
     catch(std::exception const& e)
         {
@@ -130,8 +108,7 @@
 ///
 /// Precondition: argument is an xml stream for which 0 == rdstate().
 ///
-/// Postconditions: member parser_ is a non-null pointer; the object
-/// it points to is valid in that its operator!() returns false.
+/// Postconditions: member parser_ is valid.
 ///
 /// Throws: std::runtime_error, via fatal_error(), if a precondition
 /// is violated, or if xml-library calls throw an exception derived
@@ -149,16 +126,6 @@
         std::string s;
         istream_to_string(is, s);
         parser_.reset(new DomParser(s.c_str(), 1 + s.size()));
-        if(0 == parser_.get())
-            {
-            throw std::runtime_error("Parser not initialized.");
-            }
-        if(true == parser_->operator!())
-            {
-            throw std::runtime_error
-                ("Parser failed: " + parser_->messages().print()
-                );
-            }
         }
     catch(std::exception const& e)
         {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]