summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-03-19 22:13:04 +0000
committerCarl Hetherington <cth@carlh.net>2014-03-19 22:13:04 +0000
commitfb0822d3719a4668b58e8959232a04ddccd9a521 (patch)
tree4d913878176fcb57dcba387191b8f99e05e266cf /src
parent27780878701f85ad597addacd541f2e897719978 (diff)
Add new Document constructor.
Diffstat (limited to 'src')
-rw-r--r--src/cxml.cc7
-rw-r--r--src/cxml.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/cxml.cc b/src/cxml.cc
index 2ca46ed..a955b91 100644
--- a/src/cxml.cc
+++ b/src/cxml.cc
@@ -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;
diff --git a/src/cxml.h b/src/cxml.h
index 9a816a2..df99056 100644
--- a/src/cxml.h
+++ b/src/cxml.h
@@ -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 &);