]> git.mxchange.org Git - simgear.git/blobdiff - simgear/xml/easyxml.cxx
Initial work on CMake support for SimGear.
[simgear.git] / simgear / xml / easyxml.cxx
index dbebf0cae79ccb9861490c56a4a456ad581da0ea..65a35513201a2de40a24b11b9b7cb01a63d28593 100644 (file)
@@ -1,4 +1,8 @@
-// easyxml.cxx - implementation of EasyXML interfaces.
+/**
+ * \file easyxml.cxx - implementation of EasyXML interfaces.
+ * Written by David Megginson, 2000-2001
+ * This file is in the Public Domain, and comes with NO WARRANTY of any kind.
+ */
 
 #include <simgear/compiler.h>
 
 #include "easyxml.hxx"
 #include "xmlparse.h"
 
-#include STL_FSTREAM
-#include STL_IOSTREAM
+#include <fstream>
+#include <iostream>
 
-SG_USING_STD(ifstream);
+using std::ifstream;
 
 
 \f
@@ -254,6 +258,7 @@ readXML (istream &input, XMLVisitor &visitor, const string &path)
   }
 
   XML_ParserFree(parser);
+  visitor.endXML();
 }
 
 void
@@ -263,12 +268,12 @@ readXML (const string &path, XMLVisitor &visitor)
   if (input.good()) {
     try {
       readXML(input, visitor, path);
-    } catch (sg_io_exception &e) {
+    } catch (sg_io_exception &) {
       input.close();
-      throw e;
-    } catch (sg_throwable &t) {
+      throw;
+    } catch (sg_throwable &) {
       input.close();
-      throw t;
+      throw;
     }
   } else {
     throw sg_io_exception("Failed to open file", sg_location(path),
@@ -299,6 +304,7 @@ readXML (const char *buf, const int size, XMLVisitor &visitor)
   }
 
   XML_ParserFree(parser);
+  visitor.endXML();
 }
 
 // end of easyxml.cxx