aboutsummaryrefslogtreecommitdiff
path: root/sxml.cpp
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2011-06-01 11:04:57 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2011-06-01 11:04:57 +0300
commit8eba476357c8488be510f012594f305848a7eeb6 (patch)
tree42677f805d20d4b5d0b217aaacf1acedca29d2bd /sxml.cpp
parenta71564984253ade92fc4d3c9bf185807efc570bf (diff)
downloadsxml-8eba476357c8488be510f012594f305848a7eeb6.tar.gz
sxml-8eba476357c8488be510f012594f305848a7eeb6.zip
Move add_element() to node and add add_comment()
Diffstat (limited to 'sxml.cpp')
-rw-r--r--sxml.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/sxml.cpp b/sxml.cpp
index 957c8c3..0e23833 100644
--- a/sxml.cpp
+++ b/sxml.cpp
@@ -65,6 +65,16 @@ node *node::add_child(node *child)
return child;
}
+element *node::add_element(const std::string &tag)
+{
+ return new element(tag, this);
+}
+
+comment *node::add_comment(const std::string &text)
+{
+ return new comment(text, this);
+}
+
string node::to_string(bool nice , int indent) const
{
nice = nice;
@@ -220,11 +230,6 @@ string element::to_string(bool nice, int indent) const
return xml.str();
}
-element *element::add_element(const std::string &tag)
-{
- return new element(tag, this);
-}
-
template<> element *element::set_text<>(const string &text)
{
m_text = text;