GZIP compression and decompression as per IETF RFC 1952. More...
Classes | |
| class | sourcemeta::core::GZIPError |
| class | sourcemeta::core::GZIPStreamBuffer |
Functions | |
| auto SOURCEMETA_CORE_GZIP_EXPORT | sourcemeta::core::gzip (const std::uint8_t *input, std::size_t size, int level=1) -> std::string |
| auto SOURCEMETA_CORE_GZIP_EXPORT | sourcemeta::core::gunzip (const std::uint8_t *input, std::size_t size, std::size_t output_hint=0, std::size_t maximum_size=268435456) -> std::string |
GZIP compression and decompression as per IETF RFC 1952.
This functionality is included as follows:
| class sourcemeta::core::GZIPError |
An error that represents a GZIP compression or decompression failure
| class sourcemeta::core::GZIPStreamBuffer |
A stream buffer that performs streaming GZIP decompression (RFC 1952) over an input stream.
| auto SOURCEMETA_CORE_GZIP_EXPORT sourcemeta::core::gunzip | ( | const std::uint8_t * | input, |
| std::size_t | size, | ||
| std::size_t | output_hint = 0, | ||
| std::size_t | maximum_size = 268435456 ) -> std::string |
Decompress a GZIP compressed byte buffer (RFC 1952). An optional output size hint can be provided to avoid repeated buffer resizing. The output is bounded by a maximum size (256 MiB by default) so that a highly compressed input cannot exhaust memory, and decompressing beyond it throws. Every concatenated member is decoded and any trailing data that does not begin a new member is ignored, matching gzip(1). For example:
| auto SOURCEMETA_CORE_GZIP_EXPORT sourcemeta::core::gzip | ( | const std::uint8_t * | input, |
| std::size_t | size, | ||
| int | level = 1 ) -> std::string |
Compress a byte buffer using the GZIP format (RFC 1952). An optional compression level from 0 to 12 trades speed for ratio. For example: