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() --- example.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'example.cpp') diff --git a/example.cpp b/example.cpp index bbc3bbd..166ae98 100644 --- a/example.cpp +++ b/example.cpp @@ -35,13 +35,13 @@ int main() root->add_element("node")->set_attr("id", 0); - root->add_child(new comment("yay, a comment!")); + root->add_comment("yay, a comment"); root->add_element("node")->set_attr("id", 1); element *node = root->add_element("node")->set_attr("id", 3.1); - node = node->add_element("subnode") - node->add_element("subsubnode")->add_child( - new comment("i am in pretty deep waters here, man ..")); + node = node->add_element("subnode"); + node->add_element("subsubnode")->add_comment( + "i am in pretty deep waters here, man .."); std::cout << root->to_string(true) << std::endl; -- cgit v1.2.3