From 4fcdf058734b5df696420aa653ea787842678224 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 18 Apr 2017 11:55:27 -0400 Subject: Subclass the stream implementations from CFGAS_Stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename CFGAS_TextStream to CFGAS_Stream. CFGAS_Stream is converted to a base class instead of accepting an IFGAS_StreamImp. Things which inherted from IFGAS_StreamImp now inherit from CFGAS_Stream. The stream type inputs are changed to IFX_SeekableStream so that they can accept the same type (IFX_SeekableStream is an IFX_SeekableWriteStream and an IFX_SeekableReadStream). This way the storage can be shared in the base class. Change-Id: I06645071e68e2a4d4120c0e336529f2c18c2b705 Reviewed-on: https://pdfium-review.googlesource.com/4152 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- xfa/fxfa/parser/cxfa_dataexporter.cpp | 11 +++++------ xfa/fxfa/parser/cxfa_dataexporter.h | 6 +++--- xfa/fxfa/parser/cxfa_dataimporter.cpp | 2 +- xfa/fxfa/parser/cxfa_dataimporter.h | 4 ++-- xfa/fxfa/parser/cxfa_document_parser.cpp | 2 +- xfa/fxfa/parser/cxfa_document_parser.h | 4 ++-- xfa/fxfa/parser/cxfa_simple_parser.cpp | 2 +- xfa/fxfa/parser/cxfa_simple_parser.h | 6 +++--- 8 files changed, 18 insertions(+), 19 deletions(-) (limited to 'xfa/fxfa/parser') diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index 3976fd6912..4e3b0b3ffa 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -474,15 +474,14 @@ CXFA_DataExporter::CXFA_DataExporter(CXFA_Document* pDocument) } bool CXFA_DataExporter::Export( - const CFX_RetainPtr& pWrite) { + const CFX_RetainPtr& pWrite) { return Export(pWrite, m_pDocument->GetRoot(), 0, nullptr); } -bool CXFA_DataExporter::Export( - const CFX_RetainPtr& pWrite, - CXFA_Node* pNode, - uint32_t dwFlag, - const char* pChecksum) { +bool CXFA_DataExporter::Export(const CFX_RetainPtr& pWrite, + CXFA_Node* pNode, + uint32_t dwFlag, + const char* pChecksum) { ASSERT(pWrite); if (!pWrite) return false; diff --git a/xfa/fxfa/parser/cxfa_dataexporter.h b/xfa/fxfa/parser/cxfa_dataexporter.h index ac441ca21d..8f405b188d 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.h +++ b/xfa/fxfa/parser/cxfa_dataexporter.h @@ -12,15 +12,15 @@ class CXFA_Document; class CXFA_Node; -class IFX_SeekableWriteStream; +class IFX_SeekableStream; class IFGAS_Stream; class CXFA_DataExporter { public: explicit CXFA_DataExporter(CXFA_Document* pDocument); - bool Export(const CFX_RetainPtr& pWrite); - bool Export(const CFX_RetainPtr& pWrite, + bool Export(const CFX_RetainPtr& pWrite); + bool Export(const CFX_RetainPtr& pWrite, CXFA_Node* pNode, uint32_t dwFlag, const char* pChecksum); diff --git a/xfa/fxfa/parser/cxfa_dataimporter.cpp b/xfa/fxfa/parser/cxfa_dataimporter.cpp index 200841f5cb..d87d0914e4 100644 --- a/xfa/fxfa/parser/cxfa_dataimporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataimporter.cpp @@ -23,7 +23,7 @@ CXFA_DataImporter::CXFA_DataImporter(CXFA_Document* pDocument) } bool CXFA_DataImporter::ImportData( - const CFX_RetainPtr& pDataDocument) { + const CFX_RetainPtr& pDataDocument) { auto pDataDocumentParser = pdfium::MakeUnique(m_pDocument, false); if (pDataDocumentParser->StartParse(pDataDocument, XFA_XDPPACKET_Datasets) != diff --git a/xfa/fxfa/parser/cxfa_dataimporter.h b/xfa/fxfa/parser/cxfa_dataimporter.h index 4e8bdda314..e76475cd1e 100644 --- a/xfa/fxfa/parser/cxfa_dataimporter.h +++ b/xfa/fxfa/parser/cxfa_dataimporter.h @@ -11,13 +11,13 @@ #include "core/fxcrt/fx_system.h" class CXFA_Document; -class IFX_SeekableReadStream; +class IFX_SeekableStream; class CXFA_DataImporter { public: explicit CXFA_DataImporter(CXFA_Document* pDocument); - bool ImportData(const CFX_RetainPtr& pDataDocument); + bool ImportData(const CFX_RetainPtr& pDataDocument); private: CXFA_Document* const m_pDocument; diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index b855513f52..a6860d6b52 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -18,7 +18,7 @@ CXFA_DocumentParser::~CXFA_DocumentParser() { } int32_t CXFA_DocumentParser::StartParse( - const CFX_RetainPtr& pStream, + const CFX_RetainPtr& pStream, XFA_XDPPACKET ePacketID) { m_pDocument.reset(); m_nodeParser.CloseParser(); diff --git a/xfa/fxfa/parser/cxfa_document_parser.h b/xfa/fxfa/parser/cxfa_document_parser.h index 9a219f74c1..90bd47f829 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.h +++ b/xfa/fxfa/parser/cxfa_document_parser.h @@ -15,7 +15,7 @@ class CFDE_XMLDoc; class CXFA_Document; class CXFA_FFNotify; class CXFA_Notify; -class IFX_SeekableReadStream; +class IFX_SeekableStream; class IFX_Pause; class CXFA_DocumentParser { @@ -23,7 +23,7 @@ class CXFA_DocumentParser { explicit CXFA_DocumentParser(CXFA_FFNotify* pNotify); ~CXFA_DocumentParser(); - int32_t StartParse(const CFX_RetainPtr& pStream, + int32_t StartParse(const CFX_RetainPtr& pStream, XFA_XDPPACKET ePacketID); int32_t DoParse(IFX_Pause* pPause); diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp index cce4b68a27..806e5445a0 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.cpp +++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp @@ -273,7 +273,7 @@ void CXFA_SimpleParser::SetFactory(CXFA_Document* pFactory) { } int32_t CXFA_SimpleParser::StartParse( - const CFX_RetainPtr& pStream, + const CFX_RetainPtr& pStream, XFA_XDPPACKET ePacketID) { CloseParser(); m_pFileRead = pStream; diff --git a/xfa/fxfa/parser/cxfa_simple_parser.h b/xfa/fxfa/parser/cxfa_simple_parser.h index a9bcec2139..ccb258a7d4 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.h +++ b/xfa/fxfa/parser/cxfa_simple_parser.h @@ -17,7 +17,7 @@ class CFDE_XMLDoc; class CFDE_XMLInstruction; class CFDE_XMLNode; class CFDE_XMLParser; -class IFX_SeekableReadStream; +class IFX_SeekableStream; class IFX_Pause; class IFGAS_Stream; @@ -26,7 +26,7 @@ class CXFA_SimpleParser { CXFA_SimpleParser(CXFA_Document* pFactory, bool bDocumentParser); ~CXFA_SimpleParser(); - int32_t StartParse(const CFX_RetainPtr& pStream, + int32_t StartParse(const CFX_RetainPtr& pStream, XFA_XDPPACKET ePacketID); int32_t DoParse(IFX_Pause* pPause); int32_t ParseXMLData(const CFX_WideString& wsXML, @@ -81,7 +81,7 @@ class CXFA_SimpleParser { CFDE_XMLParser* m_pXMLParser; std::unique_ptr m_pXMLDoc; CFX_RetainPtr m_pStream; - CFX_RetainPtr m_pFileRead; + CFX_RetainPtr m_pFileRead; CXFA_Document* m_pFactory; CXFA_Node* m_pRootNode; XFA_XDPPACKET m_ePacketID; -- cgit v1.2.3