|
| template<typename BUFFER, typename T> |
| bool | ghassanpl::buffer_append (BUFFER &&buffer, T &&val) |
| | Primary function to append a value (preferably the buffer element type) to the buffer.
|
| template<typename BUFFER> |
| bool | ghassanpl::buffer_reserve (BUFFER &buffer, size_t additional) |
| | Reserves additional elements in the buffer, if possible.
|
| template<typename BUFFER, typename RANGE> |
| size_t | ghassanpl::buffer_append_range (BUFFER &buffer, RANGE &&range) |
| | Appends elements in the range to the buffer.
|
| template<typename BUFFER, typename CHAR_TYPE> |
| size_t | ghassanpl::buffer_append_cstring_ptr (BUFFER &buffer, const CHAR_TYPE *cstr) |
| | Appends characters in the cstr to the buffer.
|
| template<typename BUFFER, typename CHAR_TYPE> |
| size_t | ghassanpl::buffer_append_cstring_ptr (BUFFER &buffer, const CHAR_TYPE *cstr, size_t max_len) |
| | Appends at most max_len characters in the cstr to the buffer.
|
| template<typename BUFFER, size_t N, typename CHAR_TYPE> |
| size_t | ghassanpl::buffer_append_cstring (BUFFER &buffer, const CHAR_TYPE(&cstr)[N]) |
| | Appends characters in the cstr literal array to the buffer.
|
| template<typename BUFFER, typename ELEMENT_TYPE = buffer_element_type<BUFFER>> |
| size_t | ghassanpl::buffer_append_varint (BUFFER &buffer, std::integral auto oval) |
| | Appends a variable number of uint8_ts to the buffer that encode the value oval in a minimal amount of space.
|
| template<typename BUFFER, typename ELEMENT_TYPE = buffer_element_type<BUFFER>> |
| size_t | ghassanpl::buffer_append_utf8 (BUFFER &buffer, char32_t cp) |
| | Appends UTF-8 codeunits that represent the Unicode code-point cp to the buffer. Assumes the codepoint is a valid Unicode codepoint that represents a character.
|
| template<typename BUFFER, typename STRING_TYPE, typename ELEMENT_TYPE = buffer_element_type<BUFFER>> |
| size_t | ghassanpl::buffer_append_utf8 (BUFFER &buffer, STRING_TYPE &&str) |
| | Appends UTF-8 codeunits that represent the char32_t-based range str to the buffer.
|
| template<typename BUFFER, typename POD> |
| size_t | ghassanpl::buffer_append_pod (BUFFER &buffer, POD const &pod) |
| | Appends a POD value's internal object representation to a buffer.
|
A buffer models a stream of byte-like elements that can be appended to.
The default, primary behavior is to append a single byte-like element to the buffer. Most other behaviors can be 'emulated' by repeatedly appending elements, but you are always free to provide your own overloads of the buffer_* functions. The default implementations will try to use methods/functions available in the standard library and its containers. Most functions return either the success boolean, or the number of elements successfully appended (in case of appending ranges).