diff options
author | dsinclair <dsinclair@chromium.org> | 2016-07-11 08:20:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-11 08:20:58 -0700 |
commit | a1b0772321e9b839073b9b312bac22143f2d4011 (patch) | |
tree | ff6d64879b0d54dd30242f77139eca7e8384343e /xfa/fxfa/parser/xfa_parser_imp.h | |
parent | d1cf239fa6be42baa02028efd1617d5af27d82e1 (diff) | |
download | pdfium-a1b0772321e9b839073b9b312bac22143f2d4011.tar.xz |
Remove IXFA_Parser, cleanup XFA parser code.
The IXFA_Parser only created a CXFA_SimpleParser, the CXFA_DocumentParser is
only created in one spot and doesn't need all the IXFA_Parser methods.
This CL removes IXFA_Parser, instantiates the CXFA_SimpleParser where needed
and cleans up surrounding code.
Review-Url: https://codereview.chromium.org/2123133004
Diffstat (limited to 'xfa/fxfa/parser/xfa_parser_imp.h')
-rw-r--r-- | xfa/fxfa/parser/xfa_parser_imp.h | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/xfa/fxfa/parser/xfa_parser_imp.h b/xfa/fxfa/parser/xfa_parser_imp.h index df0b31dc69..c10ab4dfdc 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.h +++ b/xfa/fxfa/parser/xfa_parser_imp.h @@ -8,28 +8,28 @@ #define XFA_FXFA_PARSER_XFA_PARSER_IMP_H_ #include "xfa/fde/xml/fde_xml_imp.h" -#include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/include/fxfa_basic.h" +class CXFA_Document; +class CXFA_FFNotify; +class CXFA_Node; class CXFA_XMLParser; -class CXFA_SimpleParser : public IXFA_Parser { +class CXFA_SimpleParser { public: - CXFA_SimpleParser(CXFA_Document* pFactory, FX_BOOL bDocumentParser = FALSE); - ~CXFA_SimpleParser() override; + CXFA_SimpleParser(CXFA_Document* pFactory, bool bDocumentParser); + ~CXFA_SimpleParser(); - // IXFA_Parser - void Release() override; int32_t StartParse(IFX_FileRead* pStream, - XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) override; - int32_t DoParse(IFX_Pause* pPause = nullptr) override; + XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); + int32_t DoParse(IFX_Pause* pPause = nullptr); int32_t ParseXMLData(const CFX_WideString& wsXML, CFDE_XMLNode*& pXMLNode, - IFX_Pause* pPause = nullptr) override; - void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) override; - CXFA_Document* GetFactory() const override; - CXFA_Node* GetRootNode() const override; - CFDE_XMLDoc* GetXMLDoc() const override; - void CloseParser() override; + IFX_Pause* pPause = nullptr); + void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode); + CXFA_Node* GetRootNode() const; + CFDE_XMLDoc* GetXMLDoc() const; + void CloseParser(); protected: CXFA_Node* ParseAsXDPPacket(CFDE_XMLNode* pXMLDocumentNode, @@ -82,31 +82,24 @@ class CXFA_SimpleParser : public IXFA_Parser { friend class CXFA_DocumentParser; }; -class CXFA_DocumentParser : public IXFA_Parser { +class CXFA_DocumentParser { public: - CXFA_DocumentParser(CXFA_FFNotify* pNotify); - ~CXFA_DocumentParser() override; + explicit CXFA_DocumentParser(CXFA_FFNotify* pNotify); + ~CXFA_DocumentParser(); - // IXFA_Parser - void Release() override; int32_t StartParse(IFX_FileRead* pStream, - XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) override; - int32_t DoParse(IFX_Pause* pPause = nullptr) override; - int32_t ParseXMLData(const CFX_WideString& wsXML, - CFDE_XMLNode*& pXMLNode, - IFX_Pause* pPause = nullptr) override; - void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) override; - CXFA_Document* GetFactory() const override; - CXFA_Node* GetRootNode() const override; - CFDE_XMLDoc* GetXMLDoc() const override; + XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); + int32_t DoParse(IFX_Pause* pPause = nullptr); + + CFDE_XMLDoc* GetXMLDoc() const; CXFA_FFNotify* GetNotify() const; CXFA_Document* GetDocument() const; - void CloseParser() override; + void CloseParser(); protected: CXFA_SimpleParser m_nodeParser; CXFA_FFNotify* m_pNotify; - CXFA_Document* m_pDocument; + std::unique_ptr<CXFA_Document> m_pDocument; }; class CXFA_XMLParser : public CFDE_XMLParser { |