|
OpenTTD Source 20260218-master-g2123fca5ea
|
Endian-aware buffer adapter that always reads values in little endian order. More...
#include <endian_buffer.hpp>
Public Member Functions | |
| EndianBufferReader (std::span< const uint8_t > buffer) | |
| void | rewind () |
| EndianBufferReader & | operator>> (std::string &data) |
| EndianBufferReader & | operator>> (EncodedString &data) |
| EndianBufferReader & | operator>> (bool &data) |
| template<typename... Targs> | |
| EndianBufferReader & | operator>> (std::tuple< Targs... > &data) |
| template<typename... Targs> | |
| EndianBufferReader & | operator>> (std::variant< Targs... > &variant) |
| EndianBufferReader & | operator>> (const std::monostate &) |
| template<ConvertibleThroughBase T> | |
| EndianBufferReader & | operator>> (T &data) |
| template<class T> | |
| EndianBufferReader & | operator>> (T &data) |
Static Public Member Functions | |
| template<typename Tvalue> | |
| static Tvalue | ToValue (std::span< const uint8_t > buffer) |
Private Member Functions | |
| template<class Ttuple, size_t... Tindices> | |
| void | ReadTuple (Ttuple &values, std::index_sequence< Tindices... >) |
| Helper function to read a tuple from the buffer. | |
| template<typename T, std::size_t I = 0> | |
| void | ReadVariant (uint8_t index, T &variant) |
| std::string | ReadStr () |
| Read overload for string data. | |
| template<class T> | |
| T | Read () |
| Fundamental read function. | |
Private Attributes | |
| std::span< const uint8_t > | buffer |
| Reference to storage buffer. | |
| size_t | read_pos = 0 |
| Current read position. | |
Endian-aware buffer adapter that always reads values in little endian order.
Definition at line 154 of file endian_buffer.hpp.
|
inline |
Definition at line 161 of file endian_buffer.hpp.
|
inline |
Definition at line 167 of file endian_buffer.hpp.
|
inline |
Definition at line 183 of file endian_buffer.hpp.
|
inline |
Definition at line 166 of file endian_buffer.hpp.
|
inline |
Definition at line 165 of file endian_buffer.hpp.
|
inline |
Definition at line 170 of file endian_buffer.hpp.
|
inline |
Definition at line 177 of file endian_buffer.hpp.
|
inline |
Definition at line 196 of file endian_buffer.hpp.
|
inline |
Definition at line 189 of file endian_buffer.hpp.
|
inlineprivate |
Fundamental read function.
Definition at line 261 of file endian_buffer.hpp.
References read_pos.
Referenced by ReadStr().
|
inlineprivate |
Read overload for string data.
Definition at line 245 of file endian_buffer.hpp.
|
inlineprivate |
Helper function to read a tuple from the buffer.
| values | The value to read into. |
Definition at line 221 of file endian_buffer.hpp.
|
inlineprivate |
Definition at line 227 of file endian_buffer.hpp.
|
inline |
Definition at line 163 of file endian_buffer.hpp.
|
inlinestatic |
Definition at line 207 of file endian_buffer.hpp.
|
private |
Reference to storage buffer.
Definition at line 156 of file endian_buffer.hpp.
|
private |
Current read position.
Definition at line 158 of file endian_buffer.hpp.