Add new Document constructor.
authorCarl Hetherington <cth@carlh.net>
Wed, 19 Mar 2014 22:13:04 +0000 (22:13 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 19 Mar 2014 22:13:04 +0000 (22:13 +0000)
libcxml.pc.in
src/cxml.cc
src/cxml.h

index ebf8bbf2caf0ecfc02bdf3d39678b4b0306c8094..8b7c15cf7efd43519d5476dcbf963d4e9a1e95ec 100644 (file)
@@ -5,6 +5,6 @@ includedir=@includedir@
 Name: libcxml
 Description: Library to simplify XML parsing with libxml++
 Version: @version@
-Requires: libxml++-2.6
+Requires: libxml++-2.6 glibmm-2.4
 Libs: @libs@
 Cflags: -I${includedir}
index 2ca46ed46971f97d2964f0065d22856cb2219b25..a955b916c5a8af47f1fedbef8b8445bea2e02f24 100644 (file)
@@ -214,6 +214,13 @@ cxml::Document::Document (string root_name)
        _parser = new xmlpp::DomParser;
 }
 
+cxml::Document::Document (string root_name, boost::filesystem::path file)
+       : _root_name (root_name)
+{
+       _parser = new xmlpp::DomParser ();
+       read_file (file);
+}
+
 cxml::Document::~Document ()
 {
        delete _parser;
index 9a816a2cb113a653fea4f6af588fc092c57ecc8c..df9905614ba23f03dec13debe3374429353f7082 100644 (file)
@@ -175,6 +175,7 @@ class Document : public Node
 {
 public:
        Document (std::string root_name);
+       Document (std::string root_name, boost::filesystem::path);
 
        void read_file (boost::filesystem::path);
        void read_stream (std::istream &);