diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-07-11 21:19:22 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-11 21:19:22 +0000 |
commit | b4bcf69210719810ca563b9f8c0179719e80d212 (patch) | |
tree | 1a809ee9a2c7b20db29e33918b6eecfa0aae8a2b /core/fpdfapi/edit/cpdf_stringarchivestream.cpp | |
parent | 10a7ddb596f0089ba12d0db29b5752a61919a208 (diff) | |
download | pdfium-b4bcf69210719810ca563b9f8c0179719e80d212.tar.xz |
Write marked content operators when generating a stream.
The marked content operators are BMC, BDC and EMC. In the case of
BDC, it is preceded by a direct dict or a property name.
Bug: pdfium:1118
Change-Id: I3ee736ff7be3e7d7dde55ef581af3444a325e887
Reviewed-on: https://pdfium-review.googlesource.com/37470
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit/cpdf_stringarchivestream.cpp')
-rw-r--r-- | core/fpdfapi/edit/cpdf_stringarchivestream.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/core/fpdfapi/edit/cpdf_stringarchivestream.cpp b/core/fpdfapi/edit/cpdf_stringarchivestream.cpp new file mode 100644 index 0000000000..328d6a217e --- /dev/null +++ b/core/fpdfapi/edit/cpdf_stringarchivestream.cpp @@ -0,0 +1,35 @@ +// Copyright 2018 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/fpdfapi/edit/cpdf_stringarchivestream.h" + +CPDF_StringArchiveStream::CPDF_StringArchiveStream(std::ostringstream* stream) + : stream_(stream) {} + +CPDF_StringArchiveStream::~CPDF_StringArchiveStream() {} + +bool CPDF_StringArchiveStream::WriteByte(uint8_t byte) { + NOTREACHED(); + return false; +} + +bool CPDF_StringArchiveStream::WriteDWord(uint32_t i) { + NOTREACHED(); + return false; +} + +FX_FILESIZE CPDF_StringArchiveStream::CurrentOffset() const { + NOTREACHED(); + return false; +} + +bool CPDF_StringArchiveStream::WriteBlock(const void* pData, size_t size) { + stream_->write(static_cast<const char*>(pData), size); + return true; +} + +bool CPDF_StringArchiveStream::WriteString(const ByteStringView& str) { + stream_->write(str.unterminated_c_str(), str.GetLength()); + return true; +} |