summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_seekablestreamproxy.h
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2018-04-23 18:24:56 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-23 18:24:56 +0000
commitc6077a0164340fa084be03eb059d608bc2675b2b (patch)
tree231e50c0ccb14b6a2a2554fe9215e7aff0dbcf81 /core/fxcrt/cfx_seekablestreamproxy.h
parent9a3a7709103a872037dcea1f3cf0b7785a3da191 (diff)
downloadpdfium-c6077a0164340fa084be03eb059d608bc2675b2b.tar.xz
Make CFX_SeekableStreamProxy a subclass of IFX_SeekableReadStream
This CL changes CFX_SeekableStreamProxy to be an IFX_SeekableReadStream subclass. Change-Id: I28ccb4771606fd6c9cc60e57297ae2e776fc5a9f Reviewed-on: https://pdfium-review.googlesource.com/30879 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_seekablestreamproxy.h')
-rw-r--r--core/fxcrt/cfx_seekablestreamproxy.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/fxcrt/cfx_seekablestreamproxy.h b/core/fxcrt/cfx_seekablestreamproxy.h
index 5e0eecb87b..d389baf13f 100644
--- a/core/fxcrt/cfx_seekablestreamproxy.h
+++ b/core/fxcrt/cfx_seekablestreamproxy.h
@@ -13,7 +13,7 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/retain_ptr.h"
-class CFX_SeekableStreamProxy : public Retainable {
+class CFX_SeekableStreamProxy : public IFX_SeekableReadStream {
public:
enum class From {
Begin = 0,
@@ -23,27 +23,28 @@ class CFX_SeekableStreamProxy : public Retainable {
template <typename T, typename... Args>
friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
- FX_FILESIZE GetLength() const { return m_pStream->GetSize(); }
- FX_FILESIZE GetPosition() { return m_iPosition; }
- size_t GetBOMLength() const { return m_wBOMLength; }
- bool IsEOF() const { return m_iPosition >= GetLength(); }
+ FX_FILESIZE GetSize() override;
+ FX_FILESIZE GetPosition() override;
+ bool IsEOF() override;
- void Seek(From eSeek, FX_FILESIZE iOffset);
- size_t ReadString(wchar_t* pStr, size_t iMaxLength, bool* bEOS);
+ size_t ReadBlock(void* pStr, size_t size) override;
+ bool ReadBlock(void* pStr, FX_FILESIZE offset, size_t size) override;
uint16_t GetCodePage() const { return m_wCodePage; }
void SetCodePage(uint16_t wCodePage);
private:
- explicit CFX_SeekableStreamProxy(const RetainPtr<IFX_SeekableStream>& stream);
+ explicit CFX_SeekableStreamProxy(
+ const RetainPtr<IFX_SeekableReadStream>& stream);
~CFX_SeekableStreamProxy() override;
+ void Seek(From eSeek, FX_FILESIZE iOffset);
size_t ReadData(uint8_t* pBuffer, size_t iBufferSize);
uint16_t m_wCodePage;
size_t m_wBOMLength;
FX_FILESIZE m_iPosition;
- RetainPtr<IFX_SeekableStream> m_pStream;
+ RetainPtr<IFX_SeekableReadStream> m_pStream;
};
#endif // CORE_FXCRT_CFX_SEEKABLESTREAMPROXY_H_