diff options
author | dsinclair <dsinclair@chromium.org> | 2018-04-23 18:34:57 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-23 18:34:57 +0000 |
commit | 857231a0723c0bf74ea6c13f1c3ce56548e23303 (patch) | |
tree | 262538d8f7f8e5b9703a7c37e7ec2f1b477aebe3 /core/fxcrt/cfx_seekablestreamproxy.h | |
parent | c6077a0164340fa084be03eb059d608bc2675b2b (diff) | |
download | pdfium-857231a0723c0bf74ea6c13f1c3ce56548e23303.tar.xz |
Revert "Make CFX_SeekableStreamProxy a subclass of IFX_SeekableReadStream"
This reverts commit c6077a0164340fa084be03eb059d608bc2675b2b.
Reason for revert: Gerrit did not do what i expected.
Original change's description:
> 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>
TBR=tsepez@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org
Change-Id: I65e7647221e9bad2c0db7d068638178996972437
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://pdfium-review.googlesource.com/31210
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_seekablestreamproxy.h')
-rw-r--r-- | core/fxcrt/cfx_seekablestreamproxy.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/core/fxcrt/cfx_seekablestreamproxy.h b/core/fxcrt/cfx_seekablestreamproxy.h index d389baf13f..5e0eecb87b 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 IFX_SeekableReadStream { +class CFX_SeekableStreamProxy : public Retainable { public: enum class From { Begin = 0, @@ -23,28 +23,27 @@ class CFX_SeekableStreamProxy : public IFX_SeekableReadStream { template <typename T, typename... Args> friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); - FX_FILESIZE GetSize() override; - FX_FILESIZE GetPosition() override; - bool IsEOF() override; + 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(); } - size_t ReadBlock(void* pStr, size_t size) override; - bool ReadBlock(void* pStr, FX_FILESIZE offset, size_t size) override; + void Seek(From eSeek, FX_FILESIZE iOffset); + size_t ReadString(wchar_t* pStr, size_t iMaxLength, bool* bEOS); uint16_t GetCodePage() const { return m_wCodePage; } void SetCodePage(uint16_t wCodePage); private: - explicit CFX_SeekableStreamProxy( - const RetainPtr<IFX_SeekableReadStream>& stream); + explicit CFX_SeekableStreamProxy(const RetainPtr<IFX_SeekableStream>& 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_SeekableReadStream> m_pStream; + RetainPtr<IFX_SeekableStream> m_pStream; }; #endif // CORE_FXCRT_CFX_SEEKABLESTREAMPROXY_H_ |