OpenTTD Source 20241224-master-gf74b0cf984
|
Endian-aware buffer adapter that always writes values in little endian order. More...
#include <endian_buffer.hpp>
Public Member Functions | |
EndianBufferWriter (Titer buffer) | |
EndianBufferWriter (typename Titer::container_type &container) | |
EndianBufferWriter & | operator<< (const std::string &data) |
EndianBufferWriter & | operator<< (const char *data) |
EndianBufferWriter & | operator<< (std::string_view data) |
EndianBufferWriter & | operator<< (bool data) |
template<typename T > | |
EndianBufferWriter & | operator<< (const OverflowSafeInt< T > &data) |
template<typename... Targs> | |
EndianBufferWriter & | operator<< (const std::tuple< Targs... > &data) |
template<class T , std::enable_if_t< std::disjunction_v< std::negation< std::is_class< T > >, std::is_base_of< StrongTypedefBase, T > >, int > = 0> | |
EndianBufferWriter & | operator<< (const T data) |
Static Public Member Functions | |
template<typename Tvalue , typename Tbuf = std::vector<uint8_t>> | |
static Tbuf | FromValue (const Tvalue &data) |
Private Member Functions | |
template<class Ttuple , size_t... Tindices> | |
void | WriteTuple (const Ttuple &values, std::index_sequence< Tindices... >) |
Helper function to write a tuple to the buffer. | |
void | Write (std::string_view value) |
Write overload for string values. | |
template<class T > | |
void | Write (T value) |
Fundamental write function. | |
Private Attributes | |
Titer | buffer |
Output iterator for the destination buffer. | |
Endian-aware buffer adapter that always writes values in little endian order.
Definition at line 26 of file endian_buffer.hpp.
|
inline |
Definition at line 31 of file endian_buffer.hpp.
|
inline |
Definition at line 32 of file endian_buffer.hpp.
|
inlinestatic |
Definition at line 63 of file endian_buffer.hpp.
|
inline |
Definition at line 37 of file endian_buffer.hpp.
|
inline |
Definition at line 35 of file endian_buffer.hpp.
|
inline |
Definition at line 40 of file endian_buffer.hpp.
|
inline |
Definition at line 34 of file endian_buffer.hpp.
|
inline |
Definition at line 43 of file endian_buffer.hpp.
|
inline |
Definition at line 50 of file endian_buffer.hpp.
|
inline |
Definition at line 36 of file endian_buffer.hpp.
|
inlineprivate |
Write overload for string values.
Definition at line 80 of file endian_buffer.hpp.
|
inlineprivate |
|
inlineprivate |
Helper function to write a tuple to the buffer.
Definition at line 74 of file endian_buffer.hpp.
|
private |
Output iterator for the destination buffer.
Definition at line 28 of file endian_buffer.hpp.