From 017ebba6940e0fe5ff39122c033600f88f24539a Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Fri, 12 May 2017 09:18:06 -0400 Subject: Add a WriteString method to IFX_WriteStream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl allows passing a CFX_ByteStringC to IFX_WriteStream along with the buffer method. This makes it easier to pass C-style strings to the stream. Change-Id: I1051eb3ba17c7fbd42984c14dc60cbce24d72f3f Reviewed-on: https://pdfium-review.googlesource.com/5430 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- core/fxcrt/fx_stream.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/fxcrt/fx_stream.cpp') diff --git a/core/fxcrt/fx_stream.cpp b/core/fxcrt/fx_stream.cpp index 32b6ca3495..ba21461098 100644 --- a/core/fxcrt/fx_stream.cpp +++ b/core/fxcrt/fx_stream.cpp @@ -93,3 +93,7 @@ size_t IFX_SeekableReadStream::ReadBlock(void* buffer, size_t size) { bool IFX_SeekableStream::WriteBlock(const void* buffer, size_t size) { return WriteBlock(buffer, GetSize(), size); } + +bool IFX_SeekableStream::WriteString(const CFX_ByteStringC& str) { + return WriteBlock(str.c_str(), str.GetLength()); +} -- cgit v1.2.3