summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit/cpdf_stringarchivestream.h
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-11 21:19:22 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-11 21:19:22 +0000
commitb4bcf69210719810ca563b9f8c0179719e80d212 (patch)
tree1a809ee9a2c7b20db29e33918b6eecfa0aae8a2b /core/fpdfapi/edit/cpdf_stringarchivestream.h
parent10a7ddb596f0089ba12d0db29b5752a61919a208 (diff)
downloadpdfium-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.h')
-rw-r--r--core/fpdfapi/edit/cpdf_stringarchivestream.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/fpdfapi/edit/cpdf_stringarchivestream.h b/core/fpdfapi/edit/cpdf_stringarchivestream.h
new file mode 100644
index 0000000000..bb5481e376
--- /dev/null
+++ b/core/fpdfapi/edit/cpdf_stringarchivestream.h
@@ -0,0 +1,26 @@
+// 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.
+
+#ifndef CORE_FPDFAPI_EDIT_CPDF_STRINGARCHIVESTREAM_H_
+#define CORE_FPDFAPI_EDIT_CPDF_STRINGARCHIVESTREAM_H_
+
+#include "core/fxcrt/fx_stream.h"
+
+class CPDF_StringArchiveStream : public IFX_ArchiveStream {
+ public:
+ explicit CPDF_StringArchiveStream(std::ostringstream* stream);
+ ~CPDF_StringArchiveStream() override;
+
+ // IFX_ArchiveStream
+ bool WriteByte(uint8_t byte) override;
+ bool WriteDWord(uint32_t i) override;
+ FX_FILESIZE CurrentOffset() const override;
+ bool WriteBlock(const void* pData, size_t size) override;
+ bool WriteString(const ByteStringView& str) override;
+
+ private:
+ std::ostringstream* stream_;
+};
+
+#endif // CORE_FPDFAPI_EDIT_CPDF_STRINGARCHIVESTREAM_H_