summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-08-08 18:41:53 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-08 18:41:53 (GMT)
commit19df82042f44c201e5a2821b4fa35465e33a1c90 (patch)
tree1746bddfa31ce2a6488ef5186036a049a255c9da /Swiften/Serializer/XML
parent4a5a0977f661bf5c7c34ee7aa48b35073a682203 (diff)
downloadswift-19df82042f44c201e5a2821b4fa35465e33a1c90.zip
swift-19df82042f44c201e5a2821b4fa35465e33a1c90.tar.bz2
Added XEP-0004 data forms parsing & serializing.
Diffstat (limited to 'Swiften/Serializer/XML')
-rw-r--r--Swiften/Serializer/XML/XMLTextNode.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/Serializer/XML/XMLTextNode.h b/Swiften/Serializer/XML/XMLTextNode.h
index 5f870ba..c1d13ef 100644
--- a/Swiften/Serializer/XML/XMLTextNode.h
+++ b/Swiften/Serializer/XML/XMLTextNode.h
@@ -11,6 +11,8 @@
namespace Swift {
class XMLTextNode : public XMLNode {
public:
+ typedef boost::shared_ptr<XMLTextNode> ref;
+
XMLTextNode(const String& text) : text_(text) {
text_.replaceAll('&', "&amp;"); // Should come first
text_.replaceAll('<', "&lt;");
@@ -21,6 +23,10 @@ namespace Swift {
return text_;
}
+ static ref create(const String& text) {
+ return ref(new XMLTextNode(text));
+ }
+
private:
String text_;
};