You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
865 B
33 lines
865 B
// 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 TESTING_STRING_WRITE_STREAM_H_
|
|
#define TESTING_STRING_WRITE_STREAM_H_
|
|
|
|
#include <sstream>
|
|
#include <string>
|
|
|
|
#include "core/fxcrt/fx_stream.h"
|
|
|
|
class StringWriteStream final : public IFX_SeekableWriteStream {
|
|
public:
|
|
StringWriteStream();
|
|
~StringWriteStream() override;
|
|
|
|
// IFX_SeekableWriteStream
|
|
FX_FILESIZE GetSize() override;
|
|
bool Flush() override;
|
|
bool WriteBlockAtOffset(const void* pData,
|
|
FX_FILESIZE offset,
|
|
size_t size) override;
|
|
bool WriteString(ByteStringView str) override;
|
|
|
|
std::string ToString() const { return stream_.str(); }
|
|
|
|
private:
|
|
std::ostringstream stream_;
|
|
};
|
|
|
|
#endif // TESTING_STRING_WRITE_STREAM_H_
|