mirror of
https://pdfium.googlesource.com/pdfium
synced 2026-08-01 13:48:10 +08:00
Most reinterpret_span<> usage should be avoided, and there are better functions for the single-byte conversions in span.h itself. Change-Id: I5ed8311855756c4696c14fa5e8e4da1ed9938924 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/120630 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Thomas Sepez <tsepez@google.com> Commit-Queue: Tom Sepez <tsepez@chromium.org>
20 lines
568 B
C++
20 lines
568 B
C++
// Copyright 2018 The PDFium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "testing/string_write_stream.h"
|
|
|
|
#include "core/fxcrt/bytestring.h"
|
|
#include "core/fxcrt/span_util.h"
|
|
#include "core/fxcrt/widestring.h"
|
|
|
|
StringWriteStream::StringWriteStream() = default;
|
|
|
|
StringWriteStream::~StringWriteStream() = default;
|
|
|
|
bool StringWriteStream::WriteBlock(pdfium::span<const uint8_t> buffer) {
|
|
auto chars = pdfium::as_chars(buffer);
|
|
stream_.write(chars.data(), chars.size());
|
|
return true;
|
|
}
|