/* * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include namespace Swift { class SWIFTEN_API XMLTextNode : public XMLNode { public: typedef std::shared_ptr ref; XMLTextNode(const std::string& text) : text_(text) { String::replaceAll(text_, '&', "&"); // Should come first String::replaceAll(text_, '<', "<"); String::replaceAll(text_, '>', ">"); } std::string serialize() { return text_; } static ref create(const std::string& text) { return ref(new XMLTextNode(text)); } private: std::string text_; }; }