diff options
Diffstat (limited to 'Swiften/Serializer/XML/XMLTextNode.h')
-rw-r--r-- | Swiften/Serializer/XML/XMLTextNode.h | 6 |
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('&', "&"); // Should come first text_.replaceAll('<', "<"); @@ -21,6 +23,10 @@ namespace Swift { return text_; } + static ref create(const String& text) { + return ref(new XMLTextNode(text)); + } + private: String text_; }; |