RPNX::Compress
Self-contained C++20 compression and ZIP library
 
Loading...
Searching...
No Matches
rpnx::compression::deflate_codec::iterator_bit_reader< byte_reader_type > Class Template Reference

LSB-first bit reader that consumes a single-pass byte reader. More...

#include <deflate.hpp>

Public Member Functions

 iterator_bit_reader (byte_reader_type &input, format stream_format) noexcept
 Constructs a bit reader for one DEFLATE-family stream.
 
std::uint32_t read_bits (std::uint8_t bit_count)
 Consumes a low-order-first bit field.
 
void align_to_byte () noexcept
 Discard padding through the next byte boundary.
 

Detailed Description

template<typename byte_reader_type>
class rpnx::compression::deflate_codec::iterator_bit_reader< byte_reader_type >

LSB-first bit reader that consumes a single-pass byte reader.

Template Parameters
byte_reader_typeSource reader providing read().

Definition at line 257 of file deflate.hpp.

Constructor & Destructor Documentation

◆ iterator_bit_reader()

template<typename byte_reader_type>
rpnx::compression::deflate_codec::iterator_bit_reader< byte_reader_type >::iterator_bit_reader ( byte_reader_type & input,
format stream_format )
inlinenoexcept

Constructs a bit reader for one DEFLATE-family stream.

Parameters
inputBorrowed source reader that must outlive this object.
stream_formatFormat used to classify truncated-input errors.

Definition at line 265 of file deflate.hpp.

Member Function Documentation

◆ align_to_byte()

template<typename byte_reader_type>
void rpnx::compression::deflate_codec::iterator_bit_reader< byte_reader_type >::align_to_byte ( )
inlinenoexcept

Discard padding through the next byte boundary.

Definition at line 295 of file deflate.hpp.

◆ read_bits()

template<typename byte_reader_type>
std::uint32_t rpnx::compression::deflate_codec::iterator_bit_reader< byte_reader_type >::read_bits ( std::uint8_t bit_count)
inlinenodiscard

Consumes a low-order-first bit field.

Parameters
bit_countNumber of bits to consume.
Returns
Field value with the earliest bit in the least significant position.
Exceptions
compression_errorIf the source ends before the field is complete.

Definition at line 275 of file deflate.hpp.

References rpnx::compression::invalid_data.


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