1 // Copyright 2017 PDFium Authors. All rights reserved. 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 CPDFSDK_FileWriteAdapter(FPDF_FILEWRITE * file_write)9CPDFSDK_FileWriteAdapter::CPDFSDK_FileWriteAdapter(FPDF_FILEWRITE* file_write) 10 : file_write_(file_write) { 11 ASSERT(file_write_); 12 } 13 ~CPDFSDK_FileWriteAdapter()14CPDFSDK_FileWriteAdapter::~CPDFSDK_FileWriteAdapter() {} 15 WriteBlock(const void * data,size_t size)16bool CPDFSDK_FileWriteAdapter::WriteBlock(const void* data, size_t size) { 17 return file_write_->WriteBlock(file_write_.Get(), data, size) != 0; 18 } 19 WriteString(ByteStringView str)20bool CPDFSDK_FileWriteAdapter::WriteString(ByteStringView str) { 21 return WriteBlock(str.unterminated_c_str(), str.GetLength()); 22 } 23