diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-18 11:55:27 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-18 19:33:58 +0000 |
commit | 4fcdf058734b5df696420aa653ea787842678224 (patch) | |
tree | 6f0c4bf5ed7917fecf6c6deeb741b31ae4de68e3 /xfa/fxfa/parser | |
parent | 1d52d1e5fb0b14782dd6b97eeee8c90106839452 (diff) | |
download | pdfium-4fcdf058734b5df696420aa653ea787842678224.tar.xz |
Subclass the stream implementations from CFGAS_Stream
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 <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/cxfa_dataexporter.cpp | 11 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_dataexporter.h | 6 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_dataimporter.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_dataimporter.h | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.h | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_simple_parser.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_simple_parser.h | 6 |
8 files changed, 18 insertions, 19 deletions
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<IFX_SeekableWriteStream>& pWrite) { + const CFX_RetainPtr<IFX_SeekableStream>& pWrite) { return Export(pWrite, m_pDocument->GetRoot(), 0, nullptr); } -bool CXFA_DataExporter::Export( - const CFX_RetainPtr<IFX_SeekableWriteStream>& pWrite, - CXFA_Node* pNode, - uint32_t dwFlag, - const char* pChecksum) { +bool CXFA_DataExporter::Export(const CFX_RetainPtr<IFX_SeekableStream>& 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<IFX_SeekableWriteStream>& pWrite); - bool Export(const CFX_RetainPtr<IFX_SeekableWriteStream>& pWrite, + bool Export(const CFX_RetainPtr<IFX_SeekableStream>& pWrite); + bool Export(const CFX_RetainPtr<IFX_SeekableStream>& 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<IFX_SeekableReadStream>& pDataDocument) { + const CFX_RetainPtr<IFX_SeekableStream>& pDataDocument) { auto pDataDocumentParser = pdfium::MakeUnique<CXFA_SimpleParser>(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<IFX_SeekableReadStream>& pDataDocument); + bool ImportData(const CFX_RetainPtr<IFX_SeekableStream>& 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<IFX_SeekableReadStream>& pStream, + const CFX_RetainPtr<IFX_SeekableStream>& 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<IFX_SeekableReadStream>& pStream, + int32_t StartParse(const CFX_RetainPtr<IFX_SeekableStream>& 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<IFX_SeekableReadStream>& pStream, + const CFX_RetainPtr<IFX_SeekableStream>& 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<IFX_SeekableReadStream>& pStream, + int32_t StartParse(const CFX_RetainPtr<IFX_SeekableStream>& 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<CFDE_XMLDoc> m_pXMLDoc; CFX_RetainPtr<IFGAS_Stream> m_pStream; - CFX_RetainPtr<IFX_SeekableReadStream> m_pFileRead; + CFX_RetainPtr<IFX_SeekableStream> m_pFileRead; CXFA_Document* m_pFactory; CXFA_Node* m_pRootNode; XFA_XDPPACKET m_ePacketID; |