summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/XML/XMLTextNode.h')
-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_;
};