summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/ifgas_stream.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-13 17:03:37 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-13 21:15:02 +0000
commit7b7c6532310eeeabadae7b34fdf86f4a890951e8 (patch)
treebc4b3c20ae1dd5bdd82dbda9622448298fe57426 /xfa/fgas/crt/ifgas_stream.h
parent7062b2632ffa351903e508003788b67a8c8aba77 (diff)
downloadpdfium-7b7c6532310eeeabadae7b34fdf86f4a890951e8.tar.xz
Fold LoadFile{Read|Write} back into constructors
The load file methods are always called right after creating the class. This Cl moves their code up into the constructor and then changes the other code to assume that the m_pFile{Read|Write} always exists. Change-Id: I015abf71ea4804d02d4f6f94b97eb1e7855e1fc4 Reviewed-on: https://pdfium-review.googlesource.com/4110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fgas/crt/ifgas_stream.h')
-rw-r--r--xfa/fgas/crt/ifgas_stream.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/xfa/fgas/crt/ifgas_stream.h b/xfa/fgas/crt/ifgas_stream.h
index b3f8a928d8..658afe73bf 100644
--- a/xfa/fgas/crt/ifgas_stream.h
+++ b/xfa/fgas/crt/ifgas_stream.h
@@ -14,7 +14,6 @@
enum FX_STREAMSEEK {
FX_STREAMSEEK_Begin = 0,
FX_STREAMSEEK_Current,
- FX_STREAMSEEK_End,
};
class IFGAS_Stream : public CFX_Retainable {
@@ -26,19 +25,24 @@ class IFGAS_Stream : public CFX_Retainable {
static CFX_RetainPtr<IFGAS_Stream> CreateWideStringReadStream(
const CFX_WideString& buffer);
- virtual int32_t GetLength() const = 0;
- virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
- virtual int32_t GetPosition() = 0;
- virtual bool IsEOF() const = 0;
- virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t ReadString(wchar_t* pStr, int32_t iMaxLength, bool& bEOS) = 0;
- virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0;
- virtual int32_t WriteString(const wchar_t* pStr, int32_t iLength) = 0;
- virtual void Flush() = 0;
- virtual bool SetLength(int32_t iLength) = 0;
- virtual int32_t GetBOMLength() const = 0;
+ virtual FX_FILESIZE GetLength() const = 0;
+ virtual FX_FILESIZE GetPosition() = 0;
+ virtual FX_STRSIZE GetBOMLength() const = 0;
+
+ virtual void Seek(FX_STREAMSEEK eSeek, FX_FILESIZE iOffset) = 0;
+
+ virtual FX_STRSIZE ReadString(wchar_t* pStr,
+ FX_STRSIZE iMaxLength,
+ bool* bEOS) = 0;
+ virtual void WriteData(const uint8_t* pBuffer, FX_STRSIZE iBufferSize) = 0;
+ virtual void WriteString(const wchar_t* pStr, FX_STRSIZE iLength) = 0;
+
virtual uint16_t GetCodePage() const = 0;
- virtual uint16_t SetCodePage(uint16_t wCodePage) = 0;
+ virtual void SetCodePage(uint16_t wCodePage) = 0;
+
+ protected:
+ virtual bool IsEOF() const = 0;
+ virtual FX_STRSIZE ReadData(uint8_t* pBuffer, FX_STRSIZE iBufferSize) = 0;
};
#endif // XFA_FGAS_CRT_IFGAS_STREAM_H_