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
cpdfsdk_filewriteadapter.cpp
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#include "fpdfsdk/cpdfsdk_filewriteadapter.h"
8
9#include "third_party/base/check.h"
10#include "third_party/base/numerics/safe_conversions.h"
11
12CPDFSDK_FileWriteAdapter::CPDFSDK_FileWriteAdapter(FPDF_FILEWRITE* file_write)
13 : file_write_(file_write) {
14 DCHECK(file_write_);
15}
16
17CPDFSDK_FileWriteAdapter::~CPDFSDK_FileWriteAdapter() = default;
18
19bool CPDFSDK_FileWriteAdapter::WriteBlock(pdfium::span<const uint8_t> buffer) {
20 return file_write_->WriteBlock(
21 file_write_, buffer.data(),
22 pdfium::base::checked_cast<unsigned long>(buffer.size())) != 0;
23}
~CPDFSDK_FileWriteAdapter() override
bool WriteBlock(pdfium::span< const uint8_t > buffer) override