An input stream over compressed data.
More...
#include <compressedstream.h>
|
| | DecompressingIStream (std::unique_ptr< std::istream > source, Compression type, std::uint64_t maxDecodedSize=defaultMaxDecompressedSize) |
| | Decompress source.
|
| std::string | error () const |
| | The error encountered while decoding, if any.
|
| bool | hitSizeLimit () const |
| std::uint64_t | decodedSize () const |
<avogadro/io/compressedstream.h>
◆ DecompressingIStream()
| DecompressingIStream |
( |
std::unique_ptr< std::istream > | source, |
|
|
Compression | type, |
|
|
std::uint64_t | maxDecodedSize = defaultMaxDecompressedSize ) |
- Parameters
-
| source | The compressed stream, positioned at its first byte. Ownership is taken. |
| type | The codec, as determined by detectCompression(). |
| maxDecodedSize | The ceiling on decoded bytes; 0 means no ceiling. |
◆ error()
| std::string error |
( |
| ) |
const |
Empty while all is well. A truncated file, a failed integrity check or a breach of the size limit all leave a message here. Callers must check this after reading, because a decoding failure surfaces to the reader as an ordinary end of stream, which most parsers treat as a short but valid file.
◆ hitSizeLimit()
| bool hitSizeLimit |
( |
| ) |
const |
- Returns
- True if decoding stopped because the size limit was reached.
◆ decodedSize()
| std::uint64_t decodedSize |
( |
| ) |
const |
- Returns
- The number of bytes decoded so far.
The documentation for this class was generated from the following file: