Add the ability to find the root node name of some XML.
[libcxml.git] / src / cxml.h
index eea15f5eb3f3cf4872c6e6d507c9fe048109195a..a8da82a42b8791a41e1eb1890f3e442b6b9314ad 100644 (file)
@@ -178,7 +178,7 @@ public:
                u.imbue (std::locale::classic ());
                u << t;
                T n;
-               t >> n;
+               u >> n;
                return n;
        }
 
@@ -208,18 +208,24 @@ private:
 };
 
 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 ();
-
+       std::string root_name () const {
+               return _root_name;
+       }
+              
 private:
        void take_root_node ();