From 8eba476357c8488be510f012594f305848a7eeb6 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Wed, 1 Jun 2011 11:04:57 +0300 Subject: Move add_element() to node and add add_comment() --- sxml.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sxml.cpp') 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; -- cgit v1.2.3