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_read_only_vector_stream.h
Go to the documentation of this file.
1// Copyright 2022 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#ifndef CORE_FXCRT_CFX_READ_ONLY_VECTOR_STREAM_H_
6#define CORE_FXCRT_CFX_READ_ONLY_VECTOR_STREAM_H_
7
8#include <stdint.h>
9
10#include "core/fxcrt/data_vector.h"
11#include "core/fxcrt/fixed_size_data_vector.h"
12#include "core/fxcrt/fx_stream.h"
13#include "core/fxcrt/retain_ptr.h"
14
15class CFX_ReadOnlySpanStream;
16
17class CFX_ReadOnlyVectorStream final : public IFX_SeekableReadStream {
18 public:
20
21 // IFX_SeekableReadStream:
22 FX_FILESIZE GetSize() override;
23 bool ReadBlockAtOffset(pdfium::span<uint8_t> buffer,
24 FX_FILESIZE offset) override;
25
26 private:
27 explicit CFX_ReadOnlyVectorStream(DataVector<uint8_t> data);
28 explicit CFX_ReadOnlyVectorStream(FixedSizeDataVector<uint8_t> data);
30
31 const DataVector<uint8_t> data_;
32 const FixedSizeDataVector<uint8_t> fixed_data_;
33 // Spans over either `data_` or `fixed_data_`.
34 const RetainPtr<CFX_ReadOnlySpanStream> stream_;
35};
36
37#endif // CORE_FXCRT_CFX_READ_ONLY_VECTOR_STREAM_H_
~CFX_ReadOnlyVectorStream() override
bool ReadBlockAtOffset(pdfium::span< uint8_t > buffer, FX_FILESIZE offset) override
TEST(FXCRYPT, MD5GenerateEmtpyData)
#define FX_FILESIZE
Definition fx_types.h:19
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224