Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_seekablestreamproxy.h
Go to the documentation of this file.
1// Copyright 2017 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXCRT_CFX_SEEKABLESTREAMPROXY_H_
8#define CORE_FXCRT_CFX_SEEKABLESTREAMPROXY_H_
9
10#include <stddef.h>
11#include <stdint.h>
12
13#include "core/fxcrt/fx_codepage.h"
14#include "core/fxcrt/fx_stream.h"
15#include "core/fxcrt/fx_types.h"
16#include "core/fxcrt/retain_ptr.h"
17
18class CFX_SeekableStreamProxy final : public Retainable {
19 public:
21
22 // Unlike IFX_SeekableStreamProxy, buffers and sizes are always in terms
23 // of the number of wchar_t elementss, not bytes.
24 FX_FILESIZE GetSize(); // Estimate under worst possible expansion.
25 bool IsEOF();
26 size_t ReadBlock(wchar_t* pStr, size_t size);
27
28 FX_CodePage GetCodePage() const { return m_wCodePage; }
29 void SetCodePage(FX_CodePage wCodePage);
30
31 private:
32 enum class From {
33 Begin = 0,
34 Current,
35 };
36
37 explicit CFX_SeekableStreamProxy(
38 const RetainPtr<IFX_SeekableReadStream>& stream);
40
41 FX_FILESIZE GetPosition();
42 void Seek(From eSeek, FX_FILESIZE iOffset);
43 size_t ReadData(uint8_t* pBuffer, size_t iBufferSize);
44
46 size_t m_wBOMLength = 0;
47 FX_FILESIZE m_iPosition = 0;
48 RetainPtr<IFX_SeekableReadStream> const m_pStream;
49};
50
51#endif // CORE_FXCRT_CFX_SEEKABLESTREAMPROXY_H_
#define BOM_UTF8
#define BOM_UTF16_LE
#define BOM_UTF16_BE
#define BOM_UTF8_MASK
#define BOM_UTF16_MASK
size_t ReadBlock(wchar_t *pStr, size_t size)
void SetCodePage(FX_CodePage wCodePage)
~CFX_SeekableStreamProxy() override
FX_CodePage FX_GetACP()
FX_CodePage
Definition fx_codepage.h:18
#define FX_FILESIZE
Definition fx_types.h:19
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224