OpenTTD Source: ReadBuffer Struct Reference

OpenTTD Source 15.3

Public Member Functions | Data Fields
ReadBuffer Struct Reference

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

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

## Data Fields
uint8_t | buf [MEMORY_CHUNK_SIZE]
| Buffer we're going to read from.
uint8_t * | bufp = nullptr
| Location we're at reading the buffer.
uint8_t * | bufe = nullptr
| End of the buffer we can read from.
std::shared_ptr< LoadFilter > | reader {}
| The filter used to actually read.
size_t | read = 0
| The amount of read bytes so far from the filter.

## Detailed Description

A buffer for reading (and buffering) savegame data.

Definition at line 105 of file saveload.cpp.

## Constructor & Destructor Documentation

## ◆ ReadBuffer()

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

Initialise our variables.

Parameters

  reader | The filter to actually read data.

Definition at line 116 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 138 of file saveload.cpp.

References bufp.

## ◆ ReadByte()

uint8_t ReadBuffer::ReadByte | ( |  | ) |
| inline

Definition at line 120 of file saveload.cpp.

## Field Documentation

## ◆ buf

uint8_t ReadBuffer::buf[MEMORY_CHUNK_SIZE]

Buffer we're going to read from.

Definition at line 106 of file saveload.cpp.

## ◆ bufe

uint8_t* ReadBuffer::bufe = nullptr

End of the buffer we can read from.

Definition at line 108 of file saveload.cpp.

## ◆ bufp

uint8_t* ReadBuffer::bufp = nullptr

Location we're at reading the buffer.

Definition at line 107 of file saveload.cpp.

Referenced by GetSize().

## ◆ read

size_t ReadBuffer::read = 0

The amount of read bytes so far from the filter.

Definition at line 110 of file saveload.cpp.

## ◆ reader

std::shared_ptr<LoadFilter> ReadBuffer::reader {}

The filter used to actually read.

Definition at line 109 of file saveload.cpp.

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

- src/saveload/saveload.cpp