nalchi
Loading...
Searching...
No Matches
bit_stream_flat.hpp File Reference

Bit stream flat API. More...

#include "nalchi/bit_stream.hpp"
#include "nalchi/export.hpp"
#include <cstdint>

Go to the source code of this file.

Functions

nalchi::bit_stream_writernalchi_bit_stream_writer_construct_default ()
 Constructs a bit_stream_writer instance without a buffer.
 
nalchi::bit_stream_writernalchi_bit_stream_writer_construct_with_shared_payload (nalchi::shared_payload buffer, nalchi::bit_stream_writer::size_type logical_bytes_length)
 Constructs a bit_stream_writer instance with a shared_payload buffer.
 
nalchi::bit_stream_writernalchi_bit_stream_writer_construct_with_word_range (nalchi::bit_stream_writer::word_type *begin, nalchi::bit_stream_writer::word_type *end, nalchi::bit_stream_writer::size_type logical_bytes_length)
 Constructs a bit_stream_writer instance with a word range.
 
nalchi::bit_stream_writernalchi_bit_stream_writer_construct_with_word_ptr_and_length (nalchi::bit_stream_writer::word_type *begin, nalchi::bit_stream_writer::size_type words_length, nalchi::bit_stream_writer::size_type logical_bytes_length)
 Constructs a bit_stream_writer instance with a word begin pointer and the word length.
 
void nalchi_bit_stream_writer_destroy (nalchi::bit_stream_writer *self)
 Destroys the bit_stream_writer instance.
 
void nalchi_bit_stream_writer_set_fail (nalchi::bit_stream_writer *self)
 Force set the fail flag.
 
bool nalchi_bit_stream_writer_fail (const nalchi::bit_stream_writer *self)
 Check if writing to your buffer has been failed or not.
 
auto nalchi_bit_stream_writer_total_bytes (const nalchi::bit_stream_writer *self) -> nalchi::bit_stream_writer::size_type
 Gets the number of total bytes in the stream.
 
auto nalchi_bit_stream_writer_total_bits (const nalchi::bit_stream_writer *self) -> nalchi::bit_stream_writer::size_type
 Gets the number of total bits in the stream.
 
auto nalchi_bit_stream_writer_used_bytes (const nalchi::bit_stream_writer *self) -> nalchi::bit_stream_writer::size_type
 Gets the number of used bytes in the stream.
 
auto nalchi_bit_stream_writer_used_bits (const nalchi::bit_stream_writer *self) -> nalchi::bit_stream_writer::size_type
 Gets the number of used bits in the stream.
 
auto nalchi_bit_stream_writer_unused_bytes (const nalchi::bit_stream_writer *self) -> nalchi::bit_stream_writer::size_type
 Gets the number of unused bytes in the stream.
 
auto nalchi_bit_stream_writer_unused_bits (const nalchi::bit_stream_writer *self) -> nalchi::bit_stream_writer::size_type
 Gets the number of unused bits in the stream.
 
void nalchi_bit_stream_writer_restart (nalchi::bit_stream_writer *self)
 Restarts the stream so that it can write from the beginning again.
 
void nalchi_bit_stream_writer_reset (nalchi::bit_stream_writer *self)
 Resets the stream so that it no longer holds your buffer anymore.
 
void nalchi_bit_stream_writer_reset_with_shared_payload (nalchi::bit_stream_writer *self, nalchi::shared_payload buffer, nalchi::bit_stream_writer::size_type logical_bytes_length)
 Resets the stream with a shared_payload buffer.
 
void nalchi_bit_stream_writer_reset_with_word_range (nalchi::bit_stream_writer *self, nalchi::bit_stream_writer::word_type *begin, nalchi::bit_stream_writer::word_type *end, nalchi::bit_stream_writer::size_type logical_bytes_length)
 Resets the stream with a word range.
 
void nalchi_bit_stream_writer_reset_with_word_ptr_and_length (nalchi::bit_stream_writer *self, nalchi::bit_stream_writer::word_type *begin, nalchi::bit_stream_writer::size_type words_length, nalchi::bit_stream_writer::size_type logical_bytes_length)
 Resets the stream with a word begin pointer and the word length.
 
bool nalchi_bit_stream_writer_flush_final (nalchi::bit_stream_writer *self)
 Flushes the last remaining bytes on the internal scratch buffer to your buffer.
 
bool nalchi_bit_stream_writer_flushed (const nalchi::bit_stream_writer *self)
 Checks if flush_final() has been called or not.
 
bool nalchi_bit_stream_writer_write_bytes (nalchi::bit_stream_writer *self, const void *data, nalchi::bit_stream_writer::size_type size)
 Writes some arbitrary data to the bit stream.
 
bool nalchi_bit_stream_writer_write_bool (nalchi::bit_stream_writer *self, bool data)
 Writes a bool value to the bit stream.
 
bool nalchi_bit_stream_writer_write_s8 (nalchi::bit_stream_writer *self, std::int8_t data, std::int8_t min, std::int8_t max)
 Writes a std::int8_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_u8 (nalchi::bit_stream_writer *self, std::uint8_t data, std::uint8_t min, std::uint8_t max)
 Writes a std::uint8_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_s16 (nalchi::bit_stream_writer *self, std::int16_t data, std::int16_t min, std::int16_t max)
 Writes a std::int16_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_u16 (nalchi::bit_stream_writer *self, std::uint16_t data, std::uint16_t min, std::uint16_t max)
 Writes a std::uint16_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_s32 (nalchi::bit_stream_writer *self, std::int32_t data, std::int32_t min, std::int32_t max)
 Writes a std::int32_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_u32 (nalchi::bit_stream_writer *self, std::uint32_t data, std::uint32_t min, std::uint32_t max)
 Writes a std::uint32_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_s64 (nalchi::bit_stream_writer *self, std::int64_t data, std::int64_t min, std::int64_t max)
 Writes a std::int64_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_u64 (nalchi::bit_stream_writer *self, std::uint64_t data, std::uint64_t min, std::uint64_t max)
 Writes a std::uint64_t value to the bit stream.
 
bool nalchi_bit_stream_writer_write_float (nalchi::bit_stream_writer *self, float data)
 Writes a float value to the bit stream.
 
bool nalchi_bit_stream_writer_write_double (nalchi::bit_stream_writer *self, double data)
 Writes a double value to the bit stream.
 
bool nalchi_bit_stream_writer_write_ordinary_string (nalchi::bit_stream_writer *self, const char *str)
 Writes a null-terminated ordinary string to the bit stream.
 
bool nalchi_bit_stream_writer_write_wide_string (nalchi::bit_stream_writer *self, const wchar_t *str)
 Writes a null-terminated wide string to the bit stream.
 
bool nalchi_bit_stream_writer_write_utf8_string (nalchi::bit_stream_writer *self, const char8_t *str)
 Writes a null-terminated UTF-8 string to the bit stream.
 
bool nalchi_bit_stream_writer_write_utf16_string (nalchi::bit_stream_writer *self, const char16_t *str)
 Writes a null-terminated UTF-16 string to the bit stream.
 
bool nalchi_bit_stream_writer_write_utf32_string (nalchi::bit_stream_writer *self, const char32_t *str)
 Writes a null-terminated UTF-32 string to the bit stream.
 
nalchi::bit_stream_measurernalchi_bit_stream_measurer_construct ()
 Constructs a bit_stream_measurer instance.
 
void nalchi_bit_stream_measurer_destroy (nalchi::bit_stream_measurer *self)
 Destroys a bit_stream_measurer instance.
 
auto nalchi_bit_stream_measurer_used_bytes (const nalchi::bit_stream_measurer *self) -> nalchi::bit_stream_measurer::size_type
 Gets the number of used (measured) bytes.
 
auto nalchi_bit_stream_measurer_used_bits (const nalchi::bit_stream_measurer *self) -> nalchi::bit_stream_measurer::size_type
 Gets the number of used (measured) bits.
 
void nalchi_bit_stream_measurer_restart (nalchi::bit_stream_measurer *self)
 Restarts the measure from zero.
 
void nalchi_bit_stream_measurer_write_bytes (nalchi::bit_stream_measurer *self, const void *data, nalchi::bit_stream_measurer::size_type size)
 Fake-writes some arbitrary data to the bit stream.
 
void nalchi_bit_stream_measurer_write_bool (nalchi::bit_stream_measurer *self, bool data)
 Fake-writes an bool value to the bit stream.
 
void nalchi_bit_stream_measurer_write_s8 (nalchi::bit_stream_measurer *self, std::int8_t data, std::int8_t min, std::int8_t max)
 Fake-writes a std::int8_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_u8 (nalchi::bit_stream_measurer *self, std::uint8_t data, std::uint8_t min, std::uint8_t max)
 Fake-writes a std::uint8_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_s16 (nalchi::bit_stream_measurer *self, std::int16_t data, std::int16_t min, std::int16_t max)
 Fake-writes a std::int16_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_u16 (nalchi::bit_stream_measurer *self, std::uint16_t data, std::uint16_t min, std::uint16_t max)
 Fake-writes a std::uint16_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_s32 (nalchi::bit_stream_measurer *self, std::int32_t data, std::int32_t min, std::int32_t max)
 Fake-writes a std::int32_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_u32 (nalchi::bit_stream_measurer *self, std::uint32_t data, std::uint32_t min, std::uint32_t max)
 Fake-writes a std::uint32_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_s64 (nalchi::bit_stream_measurer *self, std::int64_t data, std::int64_t min, std::int64_t max)
 Fake-writes a std::int64_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_u64 (nalchi::bit_stream_measurer *self, std::uint64_t data, std::uint64_t min, std::uint64_t max)
 Fake-writes a std::uint64_t value to the bit stream.
 
void nalchi_bit_stream_measurer_write_float (nalchi::bit_stream_measurer *self, float data)
 Fake-writes a float value to the bit stream.
 
void nalchi_bit_stream_measurer_write_double (nalchi::bit_stream_measurer *self, double data)
 Fake-writes a double value to the bit stream.
 
void nalchi_bit_stream_measurer_write_ordinary_string (nalchi::bit_stream_measurer *self, const char *str)
 Fake-writes a null-terminated ordinary string to the bit stream.
 
void nalchi_bit_stream_measurer_write_wide_string (nalchi::bit_stream_measurer *self, const wchar_t *str)
 Fake-writes a null-terminated wide string to the bit stream.
 
void nalchi_bit_stream_measurer_write_utf8_string (nalchi::bit_stream_measurer *self, const char8_t *str)
 Fake-writes a null-terminated UTF-8 string to the bit stream.
 
void nalchi_bit_stream_measurer_write_utf16_string (nalchi::bit_stream_measurer *self, const char16_t *str)
 Fake-writes a null-terminated UTF-16 string to the bit stream.
 
void nalchi_bit_stream_measurer_write_utf32_string (nalchi::bit_stream_measurer *self, const char32_t *str)
 Fake-writes a null-terminated UTF-32 string to the bit stream.
 
nalchi::bit_stream_readernalchi_bit_stream_reader_construct_default ()
 Constructs a bit_stream_reader instance without a buffer.
 
nalchi::bit_stream_readernalchi_bit_stream_reader_construct_with_word_range (const nalchi::bit_stream_reader::word_type *begin, const nalchi::bit_stream_reader::word_type *end, nalchi::bit_stream_reader::size_type logical_bytes_length)
 Constructs a bit_stream_reader instance with a word range.
 
nalchi::bit_stream_readernalchi_bit_stream_reader_construct_with_word_ptr_and_length (const nalchi::bit_stream_reader::word_type *begin, nalchi::bit_stream_reader::size_type words_length, nalchi::bit_stream_reader::size_type logical_bytes_length)
 Constructs a bit_stream_reader instance with a word begin pointer and the word length.
 
void nalchi_bit_stream_reader_destroy (nalchi::bit_stream_reader *self)
 Destroys the bit_stream_reader instance.
 
void nalchi_bit_stream_reader_set_fail (nalchi::bit_stream_reader *self)
 Force set the fail flag.
 
bool nalchi_bit_stream_reader_fail (const nalchi::bit_stream_reader *self)
 Check if reading from your buffer has been failed or not.
 
auto nalchi_bit_stream_reader_total_bytes (const nalchi::bit_stream_reader *self) -> nalchi::bit_stream_reader::size_type
 Gets the number of total bytes in the stream.
 
auto nalchi_bit_stream_reader_total_bits (const nalchi::bit_stream_reader *self) -> nalchi::bit_stream_reader::size_type
 Gets the number of total bits in the stream.
 
auto nalchi_bit_stream_reader_used_bytes (const nalchi::bit_stream_reader *self) -> nalchi::bit_stream_reader::size_type
 Gets the number of used bytes in the stream.
 
auto nalchi_bit_stream_reader_used_bits (const nalchi::bit_stream_reader *self) -> nalchi::bit_stream_reader::size_type
 Gets the number of used bits in the stream.
 
auto nalchi_bit_stream_reader_unused_bytes (const nalchi::bit_stream_reader *self) -> nalchi::bit_stream_reader::size_type
 Gets the number of unused bytes in the stream.
 
auto nalchi_bit_stream_reader_unused_bits (const nalchi::bit_stream_reader *self) -> nalchi::bit_stream_reader::size_type
 Gets the number of unused bits in the stream.
 
void nalchi_bit_stream_reader_restart (nalchi::bit_stream_reader *self)
 Restarts the stream so that it can read from the beginning again.
 
void nalchi_bit_stream_reader_reset (nalchi::bit_stream_reader *self)
 Resets the stream so that it no longer holds your buffer anymore.
 
void nalchi_bit_stream_reader_reset_with_word_range (nalchi::bit_stream_reader *self, const nalchi::bit_stream_reader::word_type *begin, const nalchi::bit_stream_reader::word_type *end, nalchi::bit_stream_reader::size_type logical_bytes_length)
 Resets the stream with a word range.
 
void nalchi_bit_stream_reader_reset_with_word_ptr_and_length (nalchi::bit_stream_reader *self, const nalchi::bit_stream_reader::word_type *begin, nalchi::bit_stream_reader::size_type words_length, nalchi::bit_stream_reader::size_type logical_bytes_length)
 Resets the stream with a word begin pointer and the word length.
 
bool nalchi_bit_stream_reader_read_bytes (nalchi::bit_stream_reader *self, void *data, nalchi::bit_stream_reader::size_type size)
 Reads some arbitrary data from the bit stream.
 
bool nalchi_bit_stream_reader_read_bool (nalchi::bit_stream_reader *self, bool *data)
 Reads a bool value from the bit stream.
 
bool nalchi_bit_stream_reader_read_s8 (nalchi::bit_stream_reader *self, std::int8_t *data, std::int8_t min, std::int8_t max)
 Reads a std::int8_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_u8 (nalchi::bit_stream_reader *self, std::uint8_t *data, std::uint8_t min, std::uint8_t max)
 Reads a std::uint8_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_s16 (nalchi::bit_stream_reader *self, std::int16_t *data, std::int16_t min, std::int16_t max)
 Reads a std::int16_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_u16 (nalchi::bit_stream_reader *self, std::uint16_t *data, std::uint16_t min, std::uint16_t max)
 Reads a std::uint16_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_s32 (nalchi::bit_stream_reader *self, std::int32_t *data, std::int32_t min, std::int32_t max)
 Reads a std::int32_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_u32 (nalchi::bit_stream_reader *self, std::uint32_t *data, std::uint32_t min, std::uint32_t max)
 Reads a std::uint32_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_s64 (nalchi::bit_stream_reader *self, std::int64_t *data, std::int64_t min, std::int64_t max)
 Reads a std::int64_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_u64 (nalchi::bit_stream_reader *self, std::uint64_t *data, std::uint64_t min, std::uint64_t max)
 Reads a std::uint64_t value from the bit stream.
 
bool nalchi_bit_stream_reader_read_float (nalchi::bit_stream_reader *self, float *data)
 Reads a float value from the bit stream.
 
bool nalchi_bit_stream_reader_read_double (nalchi::bit_stream_reader *self, double *data)
 Reads a double value from the bit stream.
 
bool nalchi_bit_stream_reader_read_ordinary_string (nalchi::bit_stream_reader *self, char *str, nalchi::bit_stream_reader::size_type max_length)
 Reads a null-terminated ordinary string from the bit stream.
 
bool nalchi_bit_stream_reader_read_wide_string (nalchi::bit_stream_reader *self, wchar_t *str, nalchi::bit_stream_reader::size_type max_length)
 Reads a null-terminated wide string from the bit stream.
 
bool nalchi_bit_stream_reader_read_utf8_string (nalchi::bit_stream_reader *self, char8_t *str, nalchi::bit_stream_reader::size_type max_length)
 Reads a null-terminated UTF-8 string from the bit stream.
 
bool nalchi_bit_stream_reader_read_utf16_string (nalchi::bit_stream_reader *self, char16_t *str, nalchi::bit_stream_reader::size_type max_length)
 Reads a null-terminated UTF-16 string from the bit stream.
 
bool nalchi_bit_stream_reader_read_utf32_string (nalchi::bit_stream_reader *self, char32_t *str, nalchi::bit_stream_reader::size_type max_length)
 Reads a null-terminated UTF-32 string from the bit stream.
 
auto nalchi_bit_stream_reader_peek_string_length (nalchi::bit_stream_reader *self) -> nalchi::bit_stream_reader::ssize_type
 Peeks the string length prefix from the current stream position.
 

Detailed Description

Bit stream flat API.

Function Documentation

◆ nalchi_bit_stream_measurer_used_bits()

auto nalchi_bit_stream_measurer_used_bits ( const nalchi::bit_stream_measurer * self) -> nalchi::bit_stream_measurer::size_type

Gets the number of used (measured) bits.

Returns
Number of used (measured) bits.

◆ nalchi_bit_stream_measurer_used_bytes()

auto nalchi_bit_stream_measurer_used_bytes ( const nalchi::bit_stream_measurer * self) -> nalchi::bit_stream_measurer::size_type

Gets the number of used (measured) bytes.

Returns
Number of used (measured) bytes.

◆ nalchi_bit_stream_measurer_write_bool()

void nalchi_bit_stream_measurer_write_bool ( nalchi::bit_stream_measurer * self,
bool data )

Fake-writes an bool value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_bytes()

void nalchi_bit_stream_measurer_write_bytes ( nalchi::bit_stream_measurer * self,
const void * data,
nalchi::bit_stream_measurer::size_type size )

Fake-writes some arbitrary data to the bit stream.

Parameters
dataPointer to the arbitrary data.
sizeSize in bytes of the data.

◆ nalchi_bit_stream_measurer_write_double()

void nalchi_bit_stream_measurer_write_double ( nalchi::bit_stream_measurer * self,
double data )

Fake-writes a double value to the bit stream.

Parameters
dataData to fake-write.

◆ nalchi_bit_stream_measurer_write_float()

void nalchi_bit_stream_measurer_write_float ( nalchi::bit_stream_measurer * self,
float data )

Fake-writes a float value to the bit stream.

Parameters
dataData to fake-write.

◆ nalchi_bit_stream_measurer_write_ordinary_string()

void nalchi_bit_stream_measurer_write_ordinary_string ( nalchi::bit_stream_measurer * self,
const char * str )

Fake-writes a null-terminated ordinary string to the bit stream.

Parameters
strString to fake-write.

◆ nalchi_bit_stream_measurer_write_s16()

void nalchi_bit_stream_measurer_write_s16 ( nalchi::bit_stream_measurer * self,
std::int16_t data,
std::int16_t min,
std::int16_t max )

Fake-writes a std::int16_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_s32()

void nalchi_bit_stream_measurer_write_s32 ( nalchi::bit_stream_measurer * self,
std::int32_t data,
std::int32_t min,
std::int32_t max )

Fake-writes a std::int32_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_s64()

void nalchi_bit_stream_measurer_write_s64 ( nalchi::bit_stream_measurer * self,
std::int64_t data,
std::int64_t min,
std::int64_t max )

Fake-writes a std::int64_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_s8()

void nalchi_bit_stream_measurer_write_s8 ( nalchi::bit_stream_measurer * self,
std::int8_t data,
std::int8_t min,
std::int8_t max )

Fake-writes a std::int8_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_u16()

void nalchi_bit_stream_measurer_write_u16 ( nalchi::bit_stream_measurer * self,
std::uint16_t data,
std::uint16_t min,
std::uint16_t max )

Fake-writes a std::uint16_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_u32()

void nalchi_bit_stream_measurer_write_u32 ( nalchi::bit_stream_measurer * self,
std::uint32_t data,
std::uint32_t min,
std::uint32_t max )

Fake-writes a std::uint32_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_u64()

void nalchi_bit_stream_measurer_write_u64 ( nalchi::bit_stream_measurer * self,
std::uint64_t data,
std::uint64_t min,
std::uint64_t max )

Fake-writes a std::uint64_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_u8()

void nalchi_bit_stream_measurer_write_u8 ( nalchi::bit_stream_measurer * self,
std::uint8_t data,
std::uint8_t min,
std::uint8_t max )

Fake-writes a std::uint8_t value to the bit stream.

Parameters
dataData to fake-write.
minMinimum value allowed for data.
maxMaximum value allowed for data.

◆ nalchi_bit_stream_measurer_write_utf16_string()

void nalchi_bit_stream_measurer_write_utf16_string ( nalchi::bit_stream_measurer * self,
const char16_t * str )

Fake-writes a null-terminated UTF-16 string to the bit stream.

Parameters
strString to fake-write.

◆ nalchi_bit_stream_measurer_write_utf32_string()

void nalchi_bit_stream_measurer_write_utf32_string ( nalchi::bit_stream_measurer * self,
const char32_t * str )

Fake-writes a null-terminated UTF-32 string to the bit stream.

Parameters
strString to fake-write.

◆ nalchi_bit_stream_measurer_write_utf8_string()

void nalchi_bit_stream_measurer_write_utf8_string ( nalchi::bit_stream_measurer * self,
const char8_t * str )

Fake-writes a null-terminated UTF-8 string to the bit stream.

Parameters
strString to fake-write.

◆ nalchi_bit_stream_measurer_write_wide_string()

void nalchi_bit_stream_measurer_write_wide_string ( nalchi::bit_stream_measurer * self,
const wchar_t * str )

Fake-writes a null-terminated wide string to the bit stream.

Parameters
strString to fake-write.

◆ nalchi_bit_stream_reader_construct_default()

nalchi::bit_stream_reader * nalchi_bit_stream_reader_construct_default ( )

Constructs a bit_stream_reader instance without a buffer.

This constructor can be useful if you want to set the buffer afterwards.
To set the buffer, call reset_with().

◆ nalchi_bit_stream_reader_construct_with_word_ptr_and_length()

nalchi::bit_stream_reader * nalchi_bit_stream_reader_construct_with_word_ptr_and_length ( const nalchi::bit_stream_reader::word_type * begin,
nalchi::bit_stream_reader::size_type words_length,
nalchi::bit_stream_reader::size_type logical_bytes_length )

Constructs a bit_stream_reader instance with a word begin pointer and the word length.

Parameters
beginPointer to the beginning of a buffer.
words_lengthNumber of words in the buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial read from the final word.

◆ nalchi_bit_stream_reader_construct_with_word_range()

nalchi::bit_stream_reader * nalchi_bit_stream_reader_construct_with_word_range ( const nalchi::bit_stream_reader::word_type * begin,
const nalchi::bit_stream_reader::word_type * end,
nalchi::bit_stream_reader::size_type logical_bytes_length )

Constructs a bit_stream_reader instance with a word range.

Parameters
beginPointer to the beginning of a buffer.
endPointer to the end of a buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial read from the final word.

◆ nalchi_bit_stream_reader_fail()

bool nalchi_bit_stream_reader_fail ( const nalchi::bit_stream_reader * self)

Check if reading from your buffer has been failed or not.

If this is true, all the operations for this bit_stream_reader is no-op.

Returns
true if reading has been failed, otherwise false.

◆ nalchi_bit_stream_reader_peek_string_length()

auto nalchi_bit_stream_reader_peek_string_length ( nalchi::bit_stream_reader * self) -> nalchi::bit_stream_reader::ssize_type

Peeks the string length prefix from the current stream position.

If it fails to read a string length prefix,
this function will return a negative value and set the fail flag.

Note
Be careful, if current stream position was not on the string length prefix, it might read garbage length!
Returns
Length of CharT stored in it, or a negative value if length prefix is invalid.

◆ nalchi_bit_stream_reader_read_bool()

bool nalchi_bit_stream_reader_read_bool ( nalchi::bit_stream_reader * self,
bool * data )

Reads a bool value from the bit stream.

Parameters
dataData to read to.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_bytes()

bool nalchi_bit_stream_reader_read_bytes ( nalchi::bit_stream_reader * self,
void * data,
nalchi::bit_stream_reader::size_type size )

Reads some arbitrary data from the bit stream.

Note
You could read swapped bytes if the data came from the system with different endianness.
So, prefer using other overloads instead.
Parameters
dataPointer to the arbitrary data.
sizeSize in bytes of the data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_double()

bool nalchi_bit_stream_reader_read_double ( nalchi::bit_stream_reader * self,
double * data )

Reads a double value from the bit stream.

Parameters
dataData to read to.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_float()

bool nalchi_bit_stream_reader_read_float ( nalchi::bit_stream_reader * self,
float * data )

Reads a float value from the bit stream.

Parameters
dataData to read to.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_ordinary_string()

bool nalchi_bit_stream_reader_read_ordinary_string ( nalchi::bit_stream_reader * self,
char * str,
nalchi::bit_stream_reader::size_type max_length )

Reads a null-terminated ordinary string from the bit stream.

If max_length is not enough to store the string,
this function will set the fail flag and read nothing.

Note
max_length does not include null character, so your buffer must allocate additional space for it.

For example, if max_length is 4 for char, you need 5 bytes.
Because you need space for 5 char including null char, and char is 1 byte per char.

Parameters
strNull-terminated string to read to.
max_lengthMaximum number of char that can be read.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_s16()

bool nalchi_bit_stream_reader_read_s16 ( nalchi::bit_stream_reader * self,
std::int16_t * data,
std::int16_t min,
std::int16_t max )

Reads a std::int16_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_s32()

bool nalchi_bit_stream_reader_read_s32 ( nalchi::bit_stream_reader * self,
std::int32_t * data,
std::int32_t min,
std::int32_t max )

Reads a std::int32_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_s64()

bool nalchi_bit_stream_reader_read_s64 ( nalchi::bit_stream_reader * self,
std::int64_t * data,
std::int64_t min,
std::int64_t max )

Reads a std::int64_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_s8()

bool nalchi_bit_stream_reader_read_s8 ( nalchi::bit_stream_reader * self,
std::int8_t * data,
std::int8_t min,
std::int8_t max )

Reads a std::int8_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_u16()

bool nalchi_bit_stream_reader_read_u16 ( nalchi::bit_stream_reader * self,
std::uint16_t * data,
std::uint16_t min,
std::uint16_t max )

Reads a std::uint16_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_u32()

bool nalchi_bit_stream_reader_read_u32 ( nalchi::bit_stream_reader * self,
std::uint32_t * data,
std::uint32_t min,
std::uint32_t max )

Reads a std::uint32_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_u64()

bool nalchi_bit_stream_reader_read_u64 ( nalchi::bit_stream_reader * self,
std::uint64_t * data,
std::uint64_t min,
std::uint64_t max )

Reads a std::uint64_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_u8()

bool nalchi_bit_stream_reader_read_u8 ( nalchi::bit_stream_reader * self,
std::uint8_t * data,
std::uint8_t min,
std::uint8_t max )

Reads a std::uint8_t value from the bit stream.

Parameters
dataData to read to.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_utf16_string()

bool nalchi_bit_stream_reader_read_utf16_string ( nalchi::bit_stream_reader * self,
char16_t * str,
nalchi::bit_stream_reader::size_type max_length )

Reads a null-terminated UTF-16 string from the bit stream.

If max_length is not enough to store the string,
this function will set the fail flag and read nothing.

Note
max_length does not include null character, so your buffer must allocate additional space for it.

For example, if max_length is 4 for char16_t, you need 10 bytes.
Because you need space for 5 char16_t including null char, and char16_t is 2 bytes per char.

Parameters
strNull-terminated string to read to.
max_lengthMaximum number of char16_t that can be read.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_utf32_string()

bool nalchi_bit_stream_reader_read_utf32_string ( nalchi::bit_stream_reader * self,
char32_t * str,
nalchi::bit_stream_reader::size_type max_length )

Reads a null-terminated UTF-32 string from the bit stream.

If max_length is not enough to store the string,
this function will set the fail flag and read nothing.

Note
max_length does not include null character, so your buffer must allocate additional space for it.

For example, if max_length is 4 for char32_t, you need 20 bytes.
Because you need space for 5 char32_t including null char, and char32_t is 4 bytes per char.

Parameters
strNull-terminated string to read to.
max_lengthMaximum number of char32_t that can be read.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_utf8_string()

bool nalchi_bit_stream_reader_read_utf8_string ( nalchi::bit_stream_reader * self,
char8_t * str,
nalchi::bit_stream_reader::size_type max_length )

Reads a null-terminated UTF-8 string from the bit stream.

If max_length is not enough to store the string,
this function will set the fail flag and read nothing.

Note
max_length does not include null character, so your buffer must allocate additional space for it.

For example, if max_length is 4 for char8_t, you need 5 bytes.
Because you need space for 5 char8_t including null char, and char8_t is 1 byte per char.

Parameters
strNull-terminated string to read to.
max_lengthMaximum number of char8_t that can be read.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_read_wide_string()

bool nalchi_bit_stream_reader_read_wide_string ( nalchi::bit_stream_reader * self,
wchar_t * str,
nalchi::bit_stream_reader::size_type max_length )

Reads a null-terminated wide string from the bit stream.

If max_length is not enough to store the string,
this function will set the fail flag and read nothing.

Note
max_length does not include null character, so your buffer must allocate additional space for it.

For example, if max_length is 4 for char16_t, you need 10 bytes.
Because you need space for 5 char16_t including null char, and char16_t is 2 bytes per char.

Parameters
strNull-terminated string to read to.
max_lengthMaximum number of wchar_t that can be read.
Returns
true if reading has been successful, otherwise false.

◆ nalchi_bit_stream_reader_reset_with_word_ptr_and_length()

void nalchi_bit_stream_reader_reset_with_word_ptr_and_length ( nalchi::bit_stream_reader * self,
const nalchi::bit_stream_reader::word_type * begin,
nalchi::bit_stream_reader::size_type words_length,
nalchi::bit_stream_reader::size_type logical_bytes_length )

Resets the stream with a word begin pointer and the word length.

Parameters
beginPointer to the beginning of a buffer.
words_lengthNumber of words in the buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial read from the final word.

◆ nalchi_bit_stream_reader_reset_with_word_range()

void nalchi_bit_stream_reader_reset_with_word_range ( nalchi::bit_stream_reader * self,
const nalchi::bit_stream_reader::word_type * begin,
const nalchi::bit_stream_reader::word_type * end,
nalchi::bit_stream_reader::size_type logical_bytes_length )

Resets the stream with a word range.

Parameters
beginPointer to the beginning of a buffer.
endPointer to the end of a buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial read from the final word.

◆ nalchi_bit_stream_reader_total_bits()

auto nalchi_bit_stream_reader_total_bits ( const nalchi::bit_stream_reader * self) -> nalchi::bit_stream_reader::size_type

Gets the number of total bits in the stream.

Returns
Number of total bits in the stream.

◆ nalchi_bit_stream_reader_total_bytes()

auto nalchi_bit_stream_reader_total_bytes ( const nalchi::bit_stream_reader * self) -> nalchi::bit_stream_reader::size_type

Gets the number of total bytes in the stream.

Returns
Number of total bytes in the stream.

◆ nalchi_bit_stream_reader_unused_bits()

auto nalchi_bit_stream_reader_unused_bits ( const nalchi::bit_stream_reader * self) -> nalchi::bit_stream_reader::size_type

Gets the number of unused bits in the stream.

Returns
Number of unused bits in the stream.

◆ nalchi_bit_stream_reader_unused_bytes()

auto nalchi_bit_stream_reader_unused_bytes ( const nalchi::bit_stream_reader * self) -> nalchi::bit_stream_reader::size_type

Gets the number of unused bytes in the stream.

Returns
Number of unused bytes in the stream.

◆ nalchi_bit_stream_reader_used_bits()

auto nalchi_bit_stream_reader_used_bits ( const nalchi::bit_stream_reader * self) -> nalchi::bit_stream_reader::size_type

Gets the number of used bits in the stream.

Returns
Number of used bits in the stream.

◆ nalchi_bit_stream_reader_used_bytes()

auto nalchi_bit_stream_reader_used_bytes ( const nalchi::bit_stream_reader * self) -> nalchi::bit_stream_reader::size_type

Gets the number of used bytes in the stream.

Returns
Number of used bytes in the stream.

◆ nalchi_bit_stream_writer_construct_default()

nalchi::bit_stream_writer * nalchi_bit_stream_writer_construct_default ( )

Constructs a bit_stream_writer instance without a buffer.

This constructor can be useful if you want to set the buffer afterwards.
To set the buffer, call reset_with().

◆ nalchi_bit_stream_writer_construct_with_shared_payload()

nalchi::bit_stream_writer * nalchi_bit_stream_writer_construct_with_shared_payload ( nalchi::shared_payload buffer,
nalchi::bit_stream_writer::size_type logical_bytes_length )

Constructs a bit_stream_writer instance with a shared_payload buffer.

Parameters
bufferBuffer to write bits to.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial write to the final word.

◆ nalchi_bit_stream_writer_construct_with_word_ptr_and_length()

nalchi::bit_stream_writer * nalchi_bit_stream_writer_construct_with_word_ptr_and_length ( nalchi::bit_stream_writer::word_type * begin,
nalchi::bit_stream_writer::size_type words_length,
nalchi::bit_stream_writer::size_type logical_bytes_length )

Constructs a bit_stream_writer instance with a word begin pointer and the word length.

Parameters
beginPointer to the beginning of a buffer.
words_lengthNumber of words in the buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial write to the final word.

◆ nalchi_bit_stream_writer_construct_with_word_range()

nalchi::bit_stream_writer * nalchi_bit_stream_writer_construct_with_word_range ( nalchi::bit_stream_writer::word_type * begin,
nalchi::bit_stream_writer::word_type * end,
nalchi::bit_stream_writer::size_type logical_bytes_length )

Constructs a bit_stream_writer instance with a word range.

Parameters
beginPointer to the beginning of a buffer.
endPointer to the end of a buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial write to the final word.

◆ nalchi_bit_stream_writer_fail()

bool nalchi_bit_stream_writer_fail ( const nalchi::bit_stream_writer * self)

Check if writing to your buffer has been failed or not.

If this is true, all the operations for this bit_stream_writer is no-op.

Returns
true if writing has been failed, otherwise false.

◆ nalchi_bit_stream_writer_flush_final()

bool nalchi_bit_stream_writer_flush_final ( nalchi::bit_stream_writer * self)

Flushes the last remaining bytes on the internal scratch buffer to your buffer.

Note
This function must be only called when you're done writing.
Any attempt to write more data after calling this function will set the fail flag and write nothing.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_flushed()

bool nalchi_bit_stream_writer_flushed ( const nalchi::bit_stream_writer * self)

Checks if flush_final() has been called or not.

Returns
Whether the flush_final() has been called or not.

◆ nalchi_bit_stream_writer_reset()

void nalchi_bit_stream_writer_reset ( nalchi::bit_stream_writer * self)

Resets the stream so that it no longer holds your buffer anymore.

Note
This function removes reference to your buffer without flushing,
so if you need flushing, you should call flush_final() beforehand.

◆ nalchi_bit_stream_writer_reset_with_shared_payload()

void nalchi_bit_stream_writer_reset_with_shared_payload ( nalchi::bit_stream_writer * self,
nalchi::shared_payload buffer,
nalchi::bit_stream_writer::size_type logical_bytes_length )

Resets the stream with a shared_payload buffer.

Note
This function resets to the new buffer without flushing to your previous buffer,
so if you need flushing, you should call flush_final() beforehand.
Parameters
bufferBuffer to write bits to.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial write to the final word.

◆ nalchi_bit_stream_writer_reset_with_word_ptr_and_length()

void nalchi_bit_stream_writer_reset_with_word_ptr_and_length ( nalchi::bit_stream_writer * self,
nalchi::bit_stream_writer::word_type * begin,
nalchi::bit_stream_writer::size_type words_length,
nalchi::bit_stream_writer::size_type logical_bytes_length )

Resets the stream with a word begin pointer and the word length.

Note
This function resets to the new buffer without flushing to your previous buffer,
so if you need flushing, you should call flush_final() beforehand.
Parameters
beginPointer to the beginning of a buffer.
words_lengthNumber of words in the buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial write to the final word.

◆ nalchi_bit_stream_writer_reset_with_word_range()

void nalchi_bit_stream_writer_reset_with_word_range ( nalchi::bit_stream_writer * self,
nalchi::bit_stream_writer::word_type * begin,
nalchi::bit_stream_writer::word_type * end,
nalchi::bit_stream_writer::size_type logical_bytes_length )

Resets the stream with a word range.

Note
This function resets to the new buffer without flushing to your previous buffer,
so if you need flushing, you should call flush_final() beforehand.
Parameters
beginPointer to the beginning of a buffer.
endPointer to the end of a buffer.
logical_bytes_lengthNumber of bytes logically. This is useful if you want to only allow partial write to the final word.

◆ nalchi_bit_stream_writer_restart()

void nalchi_bit_stream_writer_restart ( nalchi::bit_stream_writer * self)

Restarts the stream so that it can write from the beginning again.

Note
This function resets internal states without flushing, so if you need flushing, you should call flush_final() beforehand.

◆ nalchi_bit_stream_writer_total_bits()

auto nalchi_bit_stream_writer_total_bits ( const nalchi::bit_stream_writer * self) -> nalchi::bit_stream_writer::size_type

Gets the number of total bits in the stream.

Returns
Number of total bits in the stream.

◆ nalchi_bit_stream_writer_total_bytes()

auto nalchi_bit_stream_writer_total_bytes ( const nalchi::bit_stream_writer * self) -> nalchi::bit_stream_writer::size_type

Gets the number of total bytes in the stream.

Returns
Number of total bytes in the stream.

◆ nalchi_bit_stream_writer_unused_bits()

auto nalchi_bit_stream_writer_unused_bits ( const nalchi::bit_stream_writer * self) -> nalchi::bit_stream_writer::size_type

Gets the number of unused bits in the stream.

Returns
Number of unused bits in the stream.

◆ nalchi_bit_stream_writer_unused_bytes()

auto nalchi_bit_stream_writer_unused_bytes ( const nalchi::bit_stream_writer * self) -> nalchi::bit_stream_writer::size_type

Gets the number of unused bytes in the stream.

Returns
Number of unused bytes in the stream.

◆ nalchi_bit_stream_writer_used_bits()

auto nalchi_bit_stream_writer_used_bits ( const nalchi::bit_stream_writer * self) -> nalchi::bit_stream_writer::size_type

Gets the number of used bits in the stream.

Returns
Number of used bits in the stream.

◆ nalchi_bit_stream_writer_used_bytes()

auto nalchi_bit_stream_writer_used_bytes ( const nalchi::bit_stream_writer * self) -> nalchi::bit_stream_writer::size_type

Gets the number of used bytes in the stream.

Returns
Number of used bytes in the stream.

◆ nalchi_bit_stream_writer_write_bool()

bool nalchi_bit_stream_writer_write_bool ( nalchi::bit_stream_writer * self,
bool data )

Writes a bool value to the bit stream.

Parameters
dataData to write.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_bytes()

bool nalchi_bit_stream_writer_write_bytes ( nalchi::bit_stream_writer * self,
const void * data,
nalchi::bit_stream_writer::size_type size )

Writes some arbitrary data to the bit stream.

Note
Bytes in your data could be read swapped if it is sent to the system with different endianness.
So, prefer using other overloads instead.
Parameters
dataPointer to the arbitrary data.
sizeSize in bytes of the data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_double()

bool nalchi_bit_stream_writer_write_double ( nalchi::bit_stream_writer * self,
double data )

Writes a double value to the bit stream.

Parameters
dataData to write.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_float()

bool nalchi_bit_stream_writer_write_float ( nalchi::bit_stream_writer * self,
float data )

Writes a float value to the bit stream.

Parameters
dataData to write.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_ordinary_string()

bool nalchi_bit_stream_writer_write_ordinary_string ( nalchi::bit_stream_writer * self,
const char * str )

Writes a null-terminated ordinary string to the bit stream.

Parameters
strString to write.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_s16()

bool nalchi_bit_stream_writer_write_s16 ( nalchi::bit_stream_writer * self,
std::int16_t data,
std::int16_t min,
std::int16_t max )

Writes a std::int16_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_s32()

bool nalchi_bit_stream_writer_write_s32 ( nalchi::bit_stream_writer * self,
std::int32_t data,
std::int32_t min,
std::int32_t max )

Writes a std::int32_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_s64()

bool nalchi_bit_stream_writer_write_s64 ( nalchi::bit_stream_writer * self,
std::int64_t data,
std::int64_t min,
std::int64_t max )

Writes a std::int64_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_s8()

bool nalchi_bit_stream_writer_write_s8 ( nalchi::bit_stream_writer * self,
std::int8_t data,
std::int8_t min,
std::int8_t max )

Writes a std::int8_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_u16()

bool nalchi_bit_stream_writer_write_u16 ( nalchi::bit_stream_writer * self,
std::uint16_t data,
std::uint16_t min,
std::uint16_t max )

Writes a std::uint16_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_u32()

bool nalchi_bit_stream_writer_write_u32 ( nalchi::bit_stream_writer * self,
std::uint32_t data,
std::uint32_t min,
std::uint32_t max )

Writes a std::uint32_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_u64()

bool nalchi_bit_stream_writer_write_u64 ( nalchi::bit_stream_writer * self,
std::uint64_t data,
std::uint64_t min,
std::uint64_t max )

Writes a std::uint64_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_u8()

bool nalchi_bit_stream_writer_write_u8 ( nalchi::bit_stream_writer * self,
std::uint8_t data,
std::uint8_t min,
std::uint8_t max )

Writes a std::uint8_t value to the bit stream.

Parameters
dataData to write.
minMinimum value allowed for data.
maxMaximum value allowed for data.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_utf16_string()

bool nalchi_bit_stream_writer_write_utf16_string ( nalchi::bit_stream_writer * self,
const char16_t * str )

Writes a null-terminated UTF-16 string to the bit stream.

Parameters
strString to write.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_utf32_string()

bool nalchi_bit_stream_writer_write_utf32_string ( nalchi::bit_stream_writer * self,
const char32_t * str )

Writes a null-terminated UTF-32 string to the bit stream.

Parameters
strString to write.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_utf8_string()

bool nalchi_bit_stream_writer_write_utf8_string ( nalchi::bit_stream_writer * self,
const char8_t * str )

Writes a null-terminated UTF-8 string to the bit stream.

Parameters
strString to write.
Returns
true if writing has been successful, otherwise false.

◆ nalchi_bit_stream_writer_write_wide_string()

bool nalchi_bit_stream_writer_write_wide_string ( nalchi::bit_stream_writer * self,
const wchar_t * str )

Writes a null-terminated wide string to the bit stream.

Parameters
strString to write.
Returns
true if writing has been successful, otherwise false.