7#ifndef CORE_FXCRT_XML_CFX_XMLPARSER_H_
8#define CORE_FXCRT_XML_CFX_XMLPARSER_H_
12#include "core/fxcrt/data_vector.h"
13#include "core/fxcrt/retain_ptr.h"
14#include "core/fxcrt/unowned_ptr.h"
15#include "core/fxcrt/widestring.h"
16#include "third_party/abseil-cpp/absl/types/optional.h"
18class CFX_SeekableStreamProxy;
23class CFX_XMLParser
final {
33 enum class FDE_XmlSyntaxState {
53 WideString GetTextData();
54 void ProcessTextChar(
wchar_t ch);
55 void ProcessTargetData();
58 RetainPtr<CFX_SeekableStreamProxy> stream_;
59 DataVector<
wchar_t> current_text_;
60 size_t xml_plane_size_ = 1024;
61 absl::optional<size_t> entity_start_;
CFX_XMLElement * ToXMLElement(CFX_XMLNode *pNode)
const CFX_XMLElement * ToXMLElement(const CFX_XMLNode *pNode)
CFX_XMLElement * GetRoot() const
T * CreateNode(Args &&... args)
void AppendNodesFrom(CFX_XMLDocument *other)
void Save(const RetainPtr< IFX_RetainableWriteStream > &pXMLStream) override
WideString GetNamespacePrefix() const
WideString GetTextData() const
const WideString & GetName() const
CFX_XMLNode * Clone(CFX_XMLDocument *doc) override
~CFX_XMLElement() override
CFX_XMLElement(const WideString &wsTag)
bool HasAttribute(const WideString &name) const
WideString GetLocalTagName() const
Type GetType() const override
WideString GetAttribute(const WideString &name) const
WideString GetNamespaceURI() const
void SetAttribute(const WideString &name, const WideString &value)
CFX_XMLElement * GetFirstChildNamed(WideStringView name) const
void RemoveAttribute(const WideString &name)
const std::map< WideString, WideString > & GetAttributes() const
CFX_XMLElement * GetNthChildNamed(WideStringView name, size_t idx) const
virtual void Save(const RetainPtr< IFX_RetainableWriteStream > &pXMLStream)=0
void InsertChildNode(CFX_XMLNode *pNode, int32_t index)
virtual CFX_XMLNode * Clone(CFX_XMLDocument *doc)=0
virtual Type GetType() const =0
CFX_XMLParser(const RetainPtr< IFX_SeekableReadStream > &pStream)
static bool IsXMLNameChar(wchar_t ch, bool bFirstChar)
std::unique_ptr< CFX_XMLDocument > Parse()
bool HasChild(const T *child) const
void RemoveSelfIfParented()
void AppendLastChild(T *child)
T * GetPrevSibling() const
void RemoveChild(T *child)
virtual ~TreeNodeBase()=default
T * GetNthChild(int32_t n)
T * GetFirstChild() const
void InsertBefore(T *child, T *other)
T * GetNextSibling() const
void InsertAfter(T *child, T *other)
void AppendFirstChild(T *child)
virtual ~TreeNode()=default
static WideString FromASCII(ByteStringView str)
bool EqualsASCII(ByteStringView that) const
#define UNOWNED_PTR_EXCLUSION