summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/cxfa_ffdoc.cpp19
-rw-r--r--xfa/fxfa/cxfa_ffdoc.h8
-rw-r--r--xfa/fxfa/cxfa_fileread.cpp25
-rw-r--r--xfa/fxfa/cxfa_fileread.h7
-rw-r--r--xfa/fxfa/parser/cxfa_dataexporter.cpp11
-rw-r--r--xfa/fxfa/parser/cxfa_dataexporter.h6
-rw-r--r--xfa/fxfa/parser/cxfa_dataimporter.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_dataimporter.h4
-rw-r--r--xfa/fxfa/parser/cxfa_document_parser.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_document_parser.h4
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.h6
12 files changed, 61 insertions, 35 deletions
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index 2bbdfa1b9c..3565370bde 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -281,7 +281,7 @@ CXFA_FFDocView* CXFA_FFDoc::GetDocView() {
return m_DocView.get();
}
-bool CXFA_FFDoc::OpenDoc(const CFX_RetainPtr<IFX_SeekableReadStream>& pStream) {
+bool CXFA_FFDoc::OpenDoc(const CFX_RetainPtr<IFX_SeekableStream>& pStream) {
m_pStream = pStream;
return true;
}
@@ -389,9 +389,8 @@ CFX_RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(
auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
pAcc->LoadAllData();
- CFX_RetainPtr<IFX_SeekableReadStream> pImageFileRead =
- IFX_MemoryStream::Create(const_cast<uint8_t*>(pAcc->GetData()),
- pAcc->GetSize());
+ CFX_RetainPtr<IFX_SeekableStream> pImageFileRead = IFX_MemoryStream::Create(
+ const_cast<uint8_t*>(pAcc->GetData()), pAcc->GetSize());
CFX_RetainPtr<CFX_DIBitmap> pDibSource = XFA_LoadImageFromBuffer(
pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi);
@@ -399,10 +398,9 @@ CFX_RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(
return pDibSource;
}
-bool CXFA_FFDoc::SavePackage(
- XFA_HashCode code,
- const CFX_RetainPtr<IFX_SeekableWriteStream>& pFile,
- CFX_ChecksumContext* pCSContext) {
+bool CXFA_FFDoc::SavePackage(XFA_HashCode code,
+ const CFX_RetainPtr<IFX_SeekableStream>& pFile,
+ CFX_ChecksumContext* pCSContext) {
CXFA_Document* doc = m_pDocumentParser->GetDocument();
auto pExport = pdfium::MakeUnique<CXFA_DataExporter>(doc);
CXFA_Node* pNode = code == XFA_HASHCODE_Xfa ? doc->GetRoot()
@@ -418,9 +416,8 @@ bool CXFA_FFDoc::SavePackage(
pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr);
}
-bool CXFA_FFDoc::ImportData(
- const CFX_RetainPtr<IFX_SeekableReadStream>& pStream,
- bool bXDP) {
+bool CXFA_FFDoc::ImportData(const CFX_RetainPtr<IFX_SeekableStream>& pStream,
+ bool bXDP) {
auto importer =
pdfium::MakeUnique<CXFA_DataImporter>(m_pDocumentParser->GetDocument());
return importer->ImportData(pStream);
diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h
index 0bba956f14..c5822e3577 100644
--- a/xfa/fxfa/cxfa_ffdoc.h
+++ b/xfa/fxfa/cxfa_ffdoc.h
@@ -58,7 +58,7 @@ class CXFA_FFDoc {
CXFA_FFDocView* CreateDocView();
- bool OpenDoc(const CFX_RetainPtr<IFX_SeekableReadStream>& pStream);
+ bool OpenDoc(const CFX_RetainPtr<IFX_SeekableStream>& pStream);
bool OpenDoc(CPDF_Document* pPDFDoc);
bool CloseDoc();
@@ -72,15 +72,15 @@ class CXFA_FFDoc {
int32_t& iImageYDpi);
bool SavePackage(XFA_HashCode code,
- const CFX_RetainPtr<IFX_SeekableWriteStream>& pFile,
+ const CFX_RetainPtr<IFX_SeekableStream>& pFile,
CFX_ChecksumContext* pCSContext);
- bool ImportData(const CFX_RetainPtr<IFX_SeekableReadStream>& pStream,
+ bool ImportData(const CFX_RetainPtr<IFX_SeekableStream>& pStream,
bool bXDP = true);
private:
IXFA_DocEnvironment* const m_pDocEnvironment;
std::unique_ptr<CXFA_DocumentParser> m_pDocumentParser;
- CFX_RetainPtr<IFX_SeekableReadStream> m_pStream;
+ CFX_RetainPtr<IFX_SeekableStream> m_pStream;
CXFA_FFApp* m_pApp;
std::unique_ptr<CXFA_FFNotify> m_pNotify;
CPDF_Document* m_pPDFDoc;
diff --git a/xfa/fxfa/cxfa_fileread.cpp b/xfa/fxfa/cxfa_fileread.cpp
index e2ecad2e93..acd81a2232 100644
--- a/xfa/fxfa/cxfa_fileread.cpp
+++ b/xfa/fxfa/cxfa_fileread.cpp
@@ -54,3 +54,28 @@ bool CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) {
}
return false;
}
+
+size_t CXFA_FileRead::ReadBlock(void* buffer, size_t size) {
+ ASSERT(false);
+ return 0;
+}
+
+FX_FILESIZE CXFA_FileRead::GetPosition() {
+ return 0;
+}
+
+bool CXFA_FileRead::IsEOF() {
+ return false;
+}
+
+bool CXFA_FileRead::Flush() {
+ ASSERT(false);
+ return false;
+}
+
+bool CXFA_FileRead::WriteBlock(const void* pData,
+ FX_FILESIZE offset,
+ size_t size) {
+ ASSERT(false);
+ return false;
+}
diff --git a/xfa/fxfa/cxfa_fileread.h b/xfa/fxfa/cxfa_fileread.h
index 0c3348b8d5..2dba4d23df 100644
--- a/xfa/fxfa/cxfa_fileread.h
+++ b/xfa/fxfa/cxfa_fileread.h
@@ -15,14 +15,19 @@
class CPDF_Stream;
class CPDF_StreamAcc;
-class CXFA_FileRead : public IFX_SeekableReadStream {
+class CXFA_FileRead : public IFX_SeekableStream {
public:
explicit CXFA_FileRead(const std::vector<CPDF_Stream*>& streams);
~CXFA_FileRead() override;
// IFX_SeekableReadStream
+ FX_FILESIZE GetPosition() override;
FX_FILESIZE GetSize() override;
bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
+ size_t ReadBlock(void* buffer, size_t size) override;
+ bool IsEOF() override;
+ bool Flush() override;
+ bool WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) override;
private:
std::vector<CFX_RetainPtr<CPDF_StreamAcc>> m_Data;
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;