AvogadroLibs 2.1.0-20261111
Loading...
Searching...
No Matches
CompressingOStream Class Reference

An output stream that compresses what is written to it. More...

#include <compressedstream.h>

Inheritance diagram for CompressingOStream:

Public Member Functions

 CompressingOStream (std::unique_ptr< std::ostream > sink, Compression type)
 Compress into sink using type.
bool finish ()
 Flush the codec and write the trailer.
std::string error () const

Detailed Description

<avogadro/io/compressedstream.h>

Constructor & Destructor Documentation

◆ CompressingOStream()

CompressingOStream ( std::unique_ptr< std::ostream > sink,
Compression type )
Parameters
sinkThe stream to write compressed bytes to. Ownership is taken.
typeThe codec to encode with, which must not be Compression::None.

Member Function Documentation

◆ finish()

bool finish ( )

Must happen before the sink is closed or the output is unreadable, so the destructor calls this too. Calling it twice is harmless.

Returns
True if the stream was finished cleanly.

◆ error()

std::string error ( ) const
Returns
The error encountered while encoding, empty if none.

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