• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef CORE_FXCRT_XML_CFX_XMLCHARDATA_H_
8 #define CORE_FXCRT_XML_CFX_XMLCHARDATA_H_
9 
10 #include "core/fxcrt/fx_string.h"
11 #include "core/fxcrt/xml/cfx_xmltext.h"
12 
13 class CFX_XMLDocument;
14 
15 class CFX_XMLCharData final : public CFX_XMLText {
16  public:
17   explicit CFX_XMLCharData(const WideString& wsCData);
18   ~CFX_XMLCharData() override;
19 
20   // CFX_XMLNode
21   Type GetType() const override;
22   CFX_XMLNode* Clone(CFX_XMLDocument* doc) override;
23   void Save(const RetainPtr<IFX_SeekableWriteStream>& pXMLStream) override;
24 };
25 
ToXMLCharData(CFX_XMLNode * pNode)26 inline CFX_XMLCharData* ToXMLCharData(CFX_XMLNode* pNode) {
27   return pNode && pNode->GetType() == CFX_XMLNode::Type::kCharData
28              ? static_cast<CFX_XMLCharData*>(pNode)
29              : nullptr;
30 }
31 
32 #endif  // CORE_FXCRT_XML_CFX_XMLCHARDATA_H_
33