diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2011-06-01 11:04:57 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2011-06-01 11:04:57 +0300 |
| commit | 8eba476357c8488be510f012594f305848a7eeb6 (patch) | |
| tree | 42677f805d20d4b5d0b217aaacf1acedca29d2bd /sxml.cpp | |
| parent | a71564984253ade92fc4d3c9bf185807efc570bf (diff) | |
| download | sxml-8eba476357c8488be510f012594f305848a7eeb6.tar.gz sxml-8eba476357c8488be510f012594f305848a7eeb6.zip | |
Move add_element() to node and add add_comment()
Diffstat (limited to 'sxml.cpp')
| -rw-r--r-- | sxml.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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; |
