Embedded Template Library 1.0
etl::bit_stream_reader Class Reference

Reads bit streams. More...

#include <bit_stream.h>

Public Types

typedef char value_type
 
typedef const char * const_iterator
 

Public Member Functions

 bit_stream_reader (etl::span< char > span_, etl::endian stream_endianness_)
 Construct from span.
 
 bit_stream_reader (etl::span< unsigned char > span_, etl::endian stream_endianness_)
 Construct from span.
 
 bit_stream_reader (void *begin_, void *end_, etl::endian stream_endianness_)
 Construct from range.
 
 bit_stream_reader (void *begin_, size_t length_, etl::endian stream_endianness_)
 Construct from begin and length.
 
void restart ()
 Sets the indexes back to the beginning of the stream.
 
template<typename T >
etl::enable_if< etl::is_same< bool, T >::value, bool >::type read_unchecked ()
 For bool types.
 
template<typename T >
etl::enable_if< etl::is_same< bool, T >::value, etl::optional< bool > >::type read ()
 For bool types.
 
template<typename T >
etl::enable_if< etl::is_integral< T >::value &&!etl::is_same< bool, T >::value, T >::type read_unchecked (uint_least8_t nbits=CHAR_BIT *sizeof(T))
 For integral types.
 
template<typename T >
etl::enable_if< etl::is_integral< T >::value &&!etl::is_same< bool, T >::value, etl::optional< T > >::type read (uint_least8_t nbits=CHAR_BIT *sizeof(T))
 For integral types.
 
size_t size_bytes () const
 Returns the number of bytes in the stream buffer.
 
size_t size_bits () const
 Returns the number of bits in the stream buffer.
 
const_iterator begin () const
 Returns start of the stream.
 
const_iterator cbegin () const
 Returns start of the stream.
 
const_iterator end () const
 Returns end of the stream.
 
const_iterator cend () const
 Returns end of the stream.
 
etl::span< const char > data () const
 Returns a span of whole the stream.
 
bool skip (size_t nbits)
 

Detailed Description

Reads bit streams.

Member Function Documentation

◆ skip()

bool etl::bit_stream_reader::skip ( size_t  nbits)
inline

Skip n bits, up to the maximum space available. Returns true if the skip was possible. Returns false if the full skip size was not possible.


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