OpenTTD Source  20241121-master-g67a0fccfad
ReadBuffer Struct Reference

A buffer for reading (and buffering) savegame data. More...

Public Member Functions

 ReadBuffer (std::shared_ptr< LoadFilter > reader)
 Initialise our variables. More...
 
uint8_t ReadByte ()
 
size_t GetSize () const
 Get the size of the memory dump made so far. More...
 

Data Fields

uint8_t buf [MEMORY_CHUNK_SIZE]
 Buffer we're going to read from.
 
uint8_t * bufp
 Location we're at reading the buffer.
 
uint8_t * bufe
 End of the buffer we can read from.
 
std::shared_ptr< LoadFilterreader
 The filter used to actually read.
 
size_t read
 The amount of read bytes so far from the filter.
 

Detailed Description

A buffer for reading (and buffering) savegame data.

Definition at line 87 of file saveload.cpp.

Constructor & Destructor Documentation

◆ ReadBuffer()

ReadBuffer::ReadBuffer ( std::shared_ptr< LoadFilter reader)
inline

Initialise our variables.

Parameters
readerThe filter to actually read data.

Definition at line 98 of file saveload.cpp.

Member Function Documentation

◆ GetSize()

size_t ReadBuffer::GetSize ( ) const
inline

Get the size of the memory dump made so far.

Returns
The size.

Definition at line 120 of file saveload.cpp.

References bufp.


The documentation for this struct was generated from the following file: