projects
/
libcxml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
911c706
)
Add Document::read_string().
author
Carl Hetherington
<cth@carlh.net>
Sun, 20 Jul 2014 22:38:34 +0000
(23:38 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 20 Jul 2014 22:38:34 +0000
(23:38 +0100)
src/cxml.cc
patch
|
blob
|
history
src/cxml.h
patch
|
blob
|
history
diff --git
a/src/cxml.cc
b/src/cxml.cc
index 99055ee1da521aff6e0a4e12c9410f24eef22a3e..810abf81deae977c61ee11944382af10bff5eaf8 100644
(file)
--- a/
src/cxml.cc
+++ b/
src/cxml.cc
@@
-267,6
+267,14
@@
cxml::Document::read_stream (istream& stream)
take_root_node ();
}
+void
+cxml::Document::read_string (string s)
+{
+ stringstream t (s);
+ _parser->parse_stream (t);
+ take_root_node ();
+}
+
void
cxml::Document::take_root_node ()
{
diff --git
a/src/cxml.h
b/src/cxml.h
index a8da82a42b8791a41e1eb1890f3e442b6b9314ad..ce62ca9664211d36129dc41fb02f0246217bb2ad 100644
(file)
--- a/
src/cxml.h
+++ b/
src/cxml.h
@@
-221,6
+221,7
@@
public:
void read_file (boost::filesystem::path);
void read_stream (std::istream &);
+ void read_string (std::string);
std::string root_name () const {
return _root_name;