An output stream that compresses what is written to it.
More...
#include <compressedstream.h>
|
| | 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 |
<avogadro/io/compressedstream.h>
◆ CompressingOStream()
| CompressingOStream |
( |
std::unique_ptr< std::ostream > | sink, |
|
|
Compression | type ) |
- Parameters
-
| sink | The stream to write compressed bytes to. Ownership is taken. |
| type | The codec to encode with, which must not be Compression::None. |
◆ 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: