11#include "../core/backup_type.hpp"
12#include "../string_func.h"
15#include "../safeguards.h"
50 const char *
string =
reinterpret_cast<const char *
>(this->
data);
51 size_t string_length =
ttd_strnlen(
string, this->Remaining());
54 this->Skip(std::min(string_length + 1, this->Remaining()));
56 return std::string_view(
string, string_length);
const uint8_t * data
Current position within data.
uint32_t PeekDWord()
Read a single DWord (32 bits).
uint32_t ReadDWord()
Read a single DWord (32 bits).
uint16_t ReadWord()
Read a single Word (16 bits).
std::string_view ReadString()
Read a string.
uint32_t ReadVarSize(uint8_t size)
Read a value of the given number of bytes.
uint8_t ReadByte()
Read a single byte (8 bits).
NewGRF buffer reader definition.
size_t ttd_strnlen(const char *str, size_t maxlen)
Get the length of a string, within a limited buffer.
Class to backup a specific variable and restore it upon destruction of this object to prevent stack v...