Crashpad
Public Types | Public Member Functions | List of all members
crashpad::ZlibOutputStream Class Reference

The class wraps zlib into OutputStreamInterface. More...

#include "util/stream/zlib_output_stream.h"

Inheritance diagram for crashpad::ZlibOutputStream:

Public Types

enum  Mode : bool
 Whether this object is configured to compress or decompress data. More...
 

Public Member Functions

 ZlibOutputStream (Mode mode, std::unique_ptr< OutputStreamInterface > output_stream)
 
bool Write (const uint8_t *data, size_t size) override
 
bool Flush () override
 

Detailed Description

The class wraps zlib into OutputStreamInterface.

Member Enumeration Documentation

◆ Mode

Whether this object is configured to compress or decompress data.

Enumerator
kCompress 

Data passed through this object is compressed.

kDecompress 

Data passed through this object is decompressed.

Constructor & Destructor Documentation

◆ ZlibOutputStream()

crashpad::ZlibOutputStream::ZlibOutputStream ( Mode  mode,
std::unique_ptr< OutputStreamInterface >  output_stream 
)
Parameters
[in]modeThe work mode of this object.
[in]output_streamThe output_stream that this object writes to.

To construct an output pipeline, the output stream needs an output stream to write the result to. For example, the code below constructs a compress->base94-encoding->log output stream pipline.

ZlibOutputStream zlib_output_stream( ZlibOutputStream::Mode::kDeflate, std::make_unique<Base94OutputStream>( Base94OutputStream::Mode::kEncode, std::make_unique<LogOutputStream>()));


The documentation for this class was generated from the following files: