diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-11-10 22:02:28 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-11-10 22:33:58 (GMT) |
commit | 2fec654b2345ba974b843a0868d580f9c12fdfea (patch) | |
tree | aee0bf059eaf66864c56e31316921fb428dad114 /Swiften/Serializer/XML | |
parent | 896e2a121d58931740ea8becc0544e10e629c6c5 (diff) | |
download | swift-contrib-2fec654b2345ba974b843a0868d580f9c12fdfea.zip swift-contrib-2fec654b2345ba974b843a0868d580f9c12fdfea.tar.bz2 |
Added InBandRegistration classes.
Diffstat (limited to 'Swiften/Serializer/XML')
-rw-r--r-- | Swiften/Serializer/XML/XMLElement.cpp | 7 | ||||
-rw-r--r-- | Swiften/Serializer/XML/XMLElement.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Swiften/Serializer/XML/XMLElement.cpp b/Swiften/Serializer/XML/XMLElement.cpp index d88ff08..289ce31 100644 --- a/Swiften/Serializer/XML/XMLElement.cpp +++ b/Swiften/Serializer/XML/XMLElement.cpp @@ -7,14 +7,17 @@ #include "Swiften/Serializer/XML/XMLElement.h" #include "Swiften/Base/foreach.h" +#include "Swiften/Serializer/XML/XMLTextNode.h" namespace Swift { -XMLElement::XMLElement(const String& tag, const String& xmlns) : - tag_(tag) { +XMLElement::XMLElement(const String& tag, const String& xmlns, const String& text) : tag_(tag) { if (!xmlns.isEmpty()) { setAttribute("xmlns", xmlns); } + if (!text.isEmpty()) { + addNode(XMLTextNode::ref(new XMLTextNode(text))); + } } String XMLElement::serialize() { diff --git a/Swiften/Serializer/XML/XMLElement.h b/Swiften/Serializer/XML/XMLElement.h index cac29f1..b350344 100644 --- a/Swiften/Serializer/XML/XMLElement.h +++ b/Swiften/Serializer/XML/XMLElement.h @@ -19,7 +19,7 @@ namespace Swift { public: typedef boost::shared_ptr<XMLElement> ref; - XMLElement(const String& tag, const String& xmlns = ""); + XMLElement(const String& tag, const String& xmlns = "", const String& text = ""); void setAttribute(const String& attribute, const String& value); void addNode(boost::shared_ptr<XMLNode> node); |