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_FXFA_PARSER_XFA_PARSER_IMP_H_ | 7 #ifndef XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_ |
8 #define XFA_FXFA_PARSER_XFA_PARSER_IMP_H_ | 8 #define XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_ |
9 | 9 |
10 #include "xfa/fde/xml/fde_xml_imp.h" | 10 #include "xfa/fde/xml/fde_xml_imp.h" |
11 #include "xfa/fxfa/include/fxfa_basic.h" | 11 #include "xfa/fxfa/include/fxfa_basic.h" |
12 | 12 |
13 class CXFA_Document; | 13 class CXFA_Document; |
14 class CXFA_FFNotify; | |
15 class CXFA_Node; | 14 class CXFA_Node; |
16 class CXFA_XMLParser; | 15 class CXFA_XMLParser; |
| 16 class IFX_FileRead; |
| 17 class IFX_Pause; |
| 18 class IFX_Stream; |
17 | 19 |
18 class CXFA_SimpleParser { | 20 class CXFA_SimpleParser { |
19 public: | 21 public: |
20 CXFA_SimpleParser(CXFA_Document* pFactory, bool bDocumentParser); | 22 CXFA_SimpleParser(CXFA_Document* pFactory, bool bDocumentParser); |
21 ~CXFA_SimpleParser(); | 23 ~CXFA_SimpleParser(); |
22 | 24 |
23 int32_t StartParse(IFX_FileRead* pStream, | 25 int32_t StartParse(IFX_FileRead* pStream, XFA_XDPPACKET ePacketID); |
24 XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); | |
25 int32_t DoParse(IFX_Pause* pPause = nullptr); | 26 int32_t DoParse(IFX_Pause* pPause = nullptr); |
26 int32_t ParseXMLData(const CFX_WideString& wsXML, | 27 int32_t ParseXMLData(const CFX_WideString& wsXML, |
27 CFDE_XMLNode*& pXMLNode, | 28 CFDE_XMLNode*& pXMLNode, |
28 IFX_Pause* pPause = nullptr); | 29 IFX_Pause* pPause = nullptr); |
29 void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode); | 30 void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode); |
30 CXFA_Node* GetRootNode() const; | 31 CXFA_Node* GetRootNode() const; |
31 CFDE_XMLDoc* GetXMLDoc() const; | 32 CFDE_XMLDoc* GetXMLDoc() const; |
32 void CloseParser(); | 33 void CloseParser(); |
33 | 34 |
34 protected: | 35 protected: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CFDE_XMLDoc* m_pXMLDoc; | 76 CFDE_XMLDoc* m_pXMLDoc; |
76 IFX_Stream* m_pStream; | 77 IFX_Stream* m_pStream; |
77 IFX_FileRead* m_pFileRead; | 78 IFX_FileRead* m_pFileRead; |
78 CXFA_Document* m_pFactory; | 79 CXFA_Document* m_pFactory; |
79 CXFA_Node* m_pRootNode; | 80 CXFA_Node* m_pRootNode; |
80 XFA_XDPPACKET m_ePacketID; | 81 XFA_XDPPACKET m_ePacketID; |
81 FX_BOOL m_bDocumentParser; | 82 FX_BOOL m_bDocumentParser; |
82 friend class CXFA_DocumentParser; | 83 friend class CXFA_DocumentParser; |
83 }; | 84 }; |
84 | 85 |
85 class CXFA_DocumentParser { | 86 #endif // XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_ |
86 public: | |
87 explicit CXFA_DocumentParser(CXFA_FFNotify* pNotify); | |
88 ~CXFA_DocumentParser(); | |
89 | |
90 int32_t StartParse(IFX_FileRead* pStream, | |
91 XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); | |
92 int32_t DoParse(IFX_Pause* pPause = nullptr); | |
93 | |
94 CFDE_XMLDoc* GetXMLDoc() const; | |
95 CXFA_FFNotify* GetNotify() const; | |
96 CXFA_Document* GetDocument() const; | |
97 void CloseParser(); | |
98 | |
99 protected: | |
100 CXFA_SimpleParser m_nodeParser; | |
101 CXFA_FFNotify* m_pNotify; | |
102 std::unique_ptr<CXFA_Document> m_pDocument; | |
103 }; | |
104 | |
105 class CXFA_XMLParser : public CFDE_XMLParser { | |
106 public: | |
107 CXFA_XMLParser(CFDE_XMLNode* pRoot, IFX_Stream* pStream); | |
108 ~CXFA_XMLParser() override; | |
109 | |
110 // CFDE_XMLParser | |
111 void Release() override; | |
112 int32_t DoParser(IFX_Pause* pPause) override; | |
113 | |
114 FX_FILESIZE m_nStart[2]; | |
115 size_t m_nSize[2]; | |
116 FX_FILESIZE m_nElementStart; | |
117 uint16_t m_dwCheckStatus; | |
118 uint16_t m_dwCurrentCheckStatus; | |
119 | |
120 protected: | |
121 CFDE_XMLNode* m_pRoot; | |
122 IFX_Stream* m_pStream; | |
123 CFDE_XMLSyntaxParser* m_pParser; | |
124 CFDE_XMLNode* m_pParent; | |
125 CFDE_XMLNode* m_pChild; | |
126 CFX_StackTemplate<CFDE_XMLNode*> m_NodeStack; | |
127 CFX_WideString m_ws1; | |
128 CFX_WideString m_ws2; | |
129 FDE_XmlSyntaxResult m_syntaxParserResult; | |
130 }; | |
131 | |
132 #endif // XFA_FXFA_PARSER_XFA_PARSER_IMP_H_ | |
OLD | NEW |