Remove thought-pointless use of Glib::ustring.
[libcxml.git] / src / cxml.h
index 4ae82dcda9eba91a187fc69f66e36680cd99479d..110a224f3db1c9d6619552e60a0887ebdac353b9 100644 (file)
 #include <boost/optional.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string/erase.hpp>
-#include <glibmm.h>
+
+/* Hack for OS X compile failure; see https://bugs.launchpad.net/hugin/+bug/910160 */
+#ifdef check
+#undef check
+#endif
 
 namespace xmlpp {
        class Node;
@@ -65,7 +69,7 @@ class Node
 {
 public:
        Node ();
-       
+
        /** Construct a Node from an xmlpp::Node.  This class will
         *  not destroy the xmlpp::Node.
         *  @param node xmlpp::Node.
@@ -132,7 +136,7 @@ public:
                u >> n;
                return n;
        }
-               
+
        /** This will mark a child as to be ignored when calling done() */
        void ignore_child (std::string) const;
 
@@ -199,30 +203,37 @@ public:
        xmlpp::Node* node () const {
                return _node;
        }
-       
+
 protected:
        xmlpp::Node* _node;
-       
+
 private:
-       mutable std::list<Glib::ustring> _taken;
+       mutable std::list<std::string> _taken;
 };
 
 typedef boost::shared_ptr<cxml::Node> NodePtr;
+typedef boost::shared_ptr<const cxml::Node> ConstNodePtr;
 
 class Document : public Node
 {
 public:
+       Document ();
        Document (std::string root_name);
        Document (std::string root_name, boost::filesystem::path);
 
+       virtual ~Document ();
+
        void read_file (boost::filesystem::path);
        void read_stream (std::istream &);
-       
-       virtual ~Document ();
+       void read_string (std::string);
+
+       std::string root_name () const {
+               return _root_name;
+       }
 
 private:
        void take_root_node ();
-       
+
        xmlpp::DomParser* _parser;
        std::string _root_name;
 };