1 // Copyright 2017 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "core/fxcrt/xml/cfx_xmltext.h" 8 9 #include "core/fxcrt/xml/cfx_xmldocument.h" 10 CFX_XMLText(const WideString & wsText)11CFX_XMLText::CFX_XMLText(const WideString& wsText) : text_(wsText) {} 12 13 CFX_XMLText::~CFX_XMLText() = default; 14 GetType() const15CFX_XMLNode::Type CFX_XMLText::GetType() const { 16 return Type::kText; 17 } 18 Clone(CFX_XMLDocument * doc)19CFX_XMLNode* CFX_XMLText::Clone(CFX_XMLDocument* doc) { 20 return doc->CreateNode<CFX_XMLText>(text_); 21 } 22 Save(const RetainPtr<IFX_SeekableWriteStream> & pXMLStream)23void CFX_XMLText::Save(const RetainPtr<IFX_SeekableWriteStream>& pXMLStream) { 24 pXMLStream->WriteString(EncodeEntities(GetText()).ToUTF8().AsStringView()); 25 } 26