| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FDE_XML_FDE_XML_IMP_H_ | 7 #ifndef XFA_FDE_XML_FDE_XML_IMP_H_ |
| 8 #define XFA_FDE_XML_FDE_XML_IMP_H_ | 8 #define XFA_FDE_XML_FDE_XML_IMP_H_ |
| 9 | 9 |
| 10 #include "core/fxcrt/include/fx_system.h" | 10 #include "core/fxcrt/include/fx_system.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 virtual void GetTargetName(CFX_WideString& wsTarget) const { | 77 virtual void GetTargetName(CFX_WideString& wsTarget) const { |
| 78 wsTarget = m_wsTarget; | 78 wsTarget = m_wsTarget; |
| 79 } | 79 } |
| 80 virtual int32_t CountAttributes() const; | 80 virtual int32_t CountAttributes() const; |
| 81 virtual FX_BOOL GetAttribute(int32_t index, | 81 virtual FX_BOOL GetAttribute(int32_t index, |
| 82 CFX_WideString& wsAttriName, | 82 CFX_WideString& wsAttriName, |
| 83 CFX_WideString& wsAttriValue) const; | 83 CFX_WideString& wsAttriValue) const; |
| 84 virtual FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; | 84 virtual FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; |
| 85 virtual void GetString(const FX_WCHAR* pwsAttriName, | 85 virtual void GetString(const FX_WCHAR* pwsAttriName, |
| 86 CFX_WideString& wsAttriValue, | 86 CFX_WideString& wsAttriValue, |
| 87 const FX_WCHAR* pwsDefValue = NULL) const; | 87 const FX_WCHAR* pwsDefValue = nullptr) const; |
| 88 virtual void SetString(const CFX_WideString& wsAttriName, | 88 virtual void SetString(const CFX_WideString& wsAttriName, |
| 89 const CFX_WideString& wsAttriValue); | 89 const CFX_WideString& wsAttriValue); |
| 90 virtual int32_t GetInteger(const FX_WCHAR* pwsAttriName, | 90 virtual int32_t GetInteger(const FX_WCHAR* pwsAttriName, |
| 91 int32_t iDefValue = 0) const; | 91 int32_t iDefValue = 0) const; |
| 92 virtual void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); | 92 virtual void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); |
| 93 virtual FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, | 93 virtual FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, |
| 94 FX_FLOAT fDefValue = 0) const; | 94 FX_FLOAT fDefValue = 0) const; |
| 95 virtual void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); | 95 virtual void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); |
| 96 virtual void RemoveAttribute(const FX_WCHAR* pwsAttriName); | 96 virtual void RemoveAttribute(const FX_WCHAR* pwsAttriName); |
| 97 virtual int32_t CountData() const; | 97 virtual int32_t CountData() const; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 virtual void GetLocalTagName(CFX_WideString& wsTag) const; | 115 virtual void GetLocalTagName(CFX_WideString& wsTag) const; |
| 116 virtual void GetNamespacePrefix(CFX_WideString& wsPrefix) const; | 116 virtual void GetNamespacePrefix(CFX_WideString& wsPrefix) const; |
| 117 virtual void GetNamespaceURI(CFX_WideString& wsNamespace) const; | 117 virtual void GetNamespaceURI(CFX_WideString& wsNamespace) const; |
| 118 virtual int32_t CountAttributes() const; | 118 virtual int32_t CountAttributes() const; |
| 119 virtual FX_BOOL GetAttribute(int32_t index, | 119 virtual FX_BOOL GetAttribute(int32_t index, |
| 120 CFX_WideString& wsAttriName, | 120 CFX_WideString& wsAttriName, |
| 121 CFX_WideString& wsAttriValue) const; | 121 CFX_WideString& wsAttriValue) const; |
| 122 virtual FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; | 122 virtual FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const; |
| 123 virtual void GetString(const FX_WCHAR* pwsAttriName, | 123 virtual void GetString(const FX_WCHAR* pwsAttriName, |
| 124 CFX_WideString& wsAttriValue, | 124 CFX_WideString& wsAttriValue, |
| 125 const FX_WCHAR* pwsDefValue = NULL) const; | 125 const FX_WCHAR* pwsDefValue = nullptr) const; |
| 126 virtual void SetString(const CFX_WideString& wsAttriName, | 126 virtual void SetString(const CFX_WideString& wsAttriName, |
| 127 const CFX_WideString& wsAttriValue); | 127 const CFX_WideString& wsAttriValue); |
| 128 virtual int32_t GetInteger(const FX_WCHAR* pwsAttriName, | 128 virtual int32_t GetInteger(const FX_WCHAR* pwsAttriName, |
| 129 int32_t iDefValue = 0) const; | 129 int32_t iDefValue = 0) const; |
| 130 virtual void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); | 130 virtual void SetInteger(const FX_WCHAR* pwsAttriName, int32_t iAttriValue); |
| 131 virtual FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, | 131 virtual FX_FLOAT GetFloat(const FX_WCHAR* pwsAttriName, |
| 132 FX_FLOAT fDefValue = 0) const; | 132 FX_FLOAT fDefValue = 0) const; |
| 133 virtual void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); | 133 virtual void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue); |
| 134 virtual void RemoveAttribute(const FX_WCHAR* pwsAttriName); | 134 virtual void RemoveAttribute(const FX_WCHAR* pwsAttriName); |
| 135 virtual void GetTextData(CFX_WideString& wsText) const; | 135 virtual void GetTextData(CFX_WideString& wsText) const; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 CFX_WideString m_wsCharData; | 177 CFX_WideString m_wsCharData; |
| 178 }; | 178 }; |
| 179 class CFDE_XMLDoc : public CFX_Target { | 179 class CFDE_XMLDoc : public CFX_Target { |
| 180 public: | 180 public: |
| 181 CFDE_XMLDoc(); | 181 CFDE_XMLDoc(); |
| 182 ~CFDE_XMLDoc(); | 182 ~CFDE_XMLDoc(); |
| 183 virtual void Release() { delete this; } | 183 virtual void Release() { delete this; } |
| 184 virtual FX_BOOL LoadXML(IFX_Stream* pXMLStream, | 184 virtual FX_BOOL LoadXML(IFX_Stream* pXMLStream, |
| 185 int32_t iXMLPlaneSize = 8192, | 185 int32_t iXMLPlaneSize = 8192, |
| 186 int32_t iTextDataSize = 256, | 186 int32_t iTextDataSize = 256, |
| 187 FDE_XMLREADERHANDLER* pHandler = NULL); | 187 FDE_XMLREADERHANDLER* pHandler = nullptr); |
| 188 virtual FX_BOOL LoadXML(CFDE_XMLParser* pXMLParser); | 188 virtual FX_BOOL LoadXML(CFDE_XMLParser* pXMLParser); |
| 189 virtual int32_t DoLoad(IFX_Pause* pPause = NULL); | 189 virtual int32_t DoLoad(IFX_Pause* pPause = nullptr); |
| 190 virtual void CloseXML(); | 190 virtual void CloseXML(); |
| 191 virtual CFDE_XMLNode* GetRoot() const { return m_pRoot; } | 191 virtual CFDE_XMLNode* GetRoot() const { return m_pRoot; } |
| 192 virtual void SaveXML(IFX_Stream* pXMLStream = NULL, FX_BOOL bSaveBOM = TRUE); | 192 virtual void SaveXML(IFX_Stream* pXMLStream = nullptr, |
| 193 FX_BOOL bSaveBOM = TRUE); |
| 193 virtual void SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pNode); | 194 virtual void SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pNode); |
| 194 | 195 |
| 195 protected: | 196 protected: |
| 196 IFX_Stream* m_pStream; | 197 IFX_Stream* m_pStream; |
| 197 int32_t m_iStatus; | 198 int32_t m_iStatus; |
| 198 CFDE_XMLNode* m_pRoot; | 199 CFDE_XMLNode* m_pRoot; |
| 199 CFDE_XMLSyntaxParser* m_pSyntaxParser; | 200 CFDE_XMLSyntaxParser* m_pSyntaxParser; |
| 200 CFDE_XMLParser* m_pXMLParser; | 201 CFDE_XMLParser* m_pXMLParser; |
| 201 void Reset(FX_BOOL bInitRoot); | 202 void Reset(FX_BOOL bInitRoot); |
| 202 void ReleaseParser(); | 203 void ReleaseParser(); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 FDE_XmlSyntaxResult m_syntaxParserResult; | 375 FDE_XmlSyntaxResult m_syntaxParserResult; |
| 375 FDE_XmlSyntaxState m_syntaxParserState; | 376 FDE_XmlSyntaxState m_syntaxParserState; |
| 376 FX_WCHAR m_wQuotationMark; | 377 FX_WCHAR m_wQuotationMark; |
| 377 int32_t m_iEntityStart; | 378 int32_t m_iEntityStart; |
| 378 CFX_DWordStack m_SkipStack; | 379 CFX_DWordStack m_SkipStack; |
| 379 FX_WCHAR m_SkipChar; | 380 FX_WCHAR m_SkipChar; |
| 380 inline void ParseTextChar(FX_WCHAR ch); | 381 inline void ParseTextChar(FX_WCHAR ch); |
| 381 }; | 382 }; |
| 382 | 383 |
| 383 #endif // XFA_FDE_XML_FDE_XML_IMP_H_ | 384 #endif // XFA_FDE_XML_FDE_XML_IMP_H_ |
| OLD | NEW |