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

An input stream over compressed data. More...

#include <compressedstream.h>

Inheritance diagram for DecompressingIStream:

Public Member Functions

 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

Detailed Description

<avogadro/io/compressedstream.h>

Constructor & Destructor Documentation

◆ DecompressingIStream()

DecompressingIStream ( std::unique_ptr< std::istream > source,
Compression type,
std::uint64_t maxDecodedSize = defaultMaxDecompressedSize )
Parameters
sourceThe compressed stream, positioned at its first byte. Ownership is taken.
typeThe codec, as determined by detectCompression().
maxDecodedSizeThe ceiling on decoded bytes; 0 means no ceiling.

Member Function Documentation

◆ 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: