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_string_stream.cpp
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#include "core/fxcrt/cfx_read_only_string_stream.h"
6
7#include <utility>
8
9#include "core/fxcrt/cfx_read_only_span_stream.h"
10#include "third_party/base/containers/span.h"
11
12CFX_ReadOnlyStringStream::CFX_ReadOnlyStringStream(ByteString data)
13 : data_(std::move(data)),
14 stream_(pdfium::MakeRetain<CFX_ReadOnlySpanStream>(data_.raw_span())) {}
15
16CFX_ReadOnlyStringStream::~CFX_ReadOnlyStringStream() = default;
17
18FX_FILESIZE CFX_ReadOnlyStringStream::GetSize() {
19 return stream_->GetSize();
20}
21
22bool CFX_ReadOnlyStringStream::ReadBlockAtOffset(pdfium::span<uint8_t> buffer,
23 FX_FILESIZE offset) {
24 return stream_->ReadBlockAtOffset(buffer, offset);
25}
~CFX_ReadOnlyStringStream() override
bool ReadBlockAtOffset(pdfium::span< uint8_t > buffer, FX_FILESIZE offset) override
#define FX_FILESIZE
Definition fx_types.h:19