projects
/
libcxml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
251957a
)
Add cxml::add_child() and cxml::add_text_child().
v0.17.7
author
Carl Hetherington
<cth@carlh.net>
Tue, 6 Feb 2024 23:55:30 +0000
(
00:55
+0100)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 6 Feb 2024 23:55:30 +0000
(
00:55
+0100)
src/cxml.cc
patch
|
blob
|
history
src/cxml.h
patch
|
blob
|
history
diff --git
a/src/cxml.cc
b/src/cxml.cc
index 7096f7121ffdae0e8eaafbf62c2cdcc26baa3cf4..814a558815cab8880064dc03fa9d3000204d5e3f 100644
(file)
--- a/
src/cxml.cc
+++ b/
src/cxml.cc
@@
-470,3
+470,17
@@
cxml::raw_convert (string v)
{
return locale_convert<double> (make_local(v));
}
{
return locale_convert<double> (make_local(v));
}
+
+
+xmlpp::Element*
+cxml::add_child(xmlpp::Element* parent, string const& name)
+{
+ return parent->add_child(name);
+}
+
+
+void
+cxml::add_text_child(xmlpp::Element* parent, string const& name, string const& text)
+{
+ parent->add_child(name)->add_child_text(text);
+}
diff --git
a/src/cxml.h
b/src/cxml.h
index 3a8ba14f3638833fff496ded1dd87ad7f0688433..417662294497594b220d4776a05bcfec116f1a7e 100644
(file)
--- a/
src/cxml.h
+++ b/
src/cxml.h
@@
-36,6
+36,7
@@
namespace xmlpp {
class DomParser;
namespace xmlpp {
class DomParser;
+ class Element;
class Node;
}
class Node;
}
@@
-269,6
+270,11
@@
private:
std::string _root_name;
};
std::string _root_name;
};
+
+xmlpp::Element* add_child(xmlpp::Element* parent, std::string const& name);
+void add_text_child(xmlpp::Element* parent, std::string const& name, std::string const& text);
+
+
}
#endif
}
#endif