OpenTTD Source  20241121-master-g67a0fccfad
LoadFilter Struct Referenceabstract

Interface for filtering a savegame till it is loaded. More...

#include <saveload_filter.h>

Inheritance diagram for LoadFilter:
FileReader LZMALoadFilter LZOLoadFilter NoCompLoadFilter PacketReader ZlibLoadFilter

Public Member Functions

 LoadFilter (std::shared_ptr< LoadFilter > chain)
 Initialise this filter. More...
 
virtual ~LoadFilter ()
 Make sure the writers are properly closed.
 
virtual size_t Read (uint8_t *buf, size_t len)=0
 Read a given number of bytes from the savegame. More...
 
virtual void Reset ()
 Reset this filter to read from the beginning of the file.
 

Data Fields

std::shared_ptr< LoadFilterchain
 Chained to the (savegame) filters.
 

Detailed Description

Interface for filtering a savegame till it is loaded.

Definition at line 14 of file saveload_filter.h.

Constructor & Destructor Documentation

◆ LoadFilter()

LoadFilter::LoadFilter ( std::shared_ptr< LoadFilter chain)
inline

Initialise this filter.

Parameters
chainThe next filter in this chain.

Definition at line 22 of file saveload_filter.h.

Member Function Documentation

◆ Read()

virtual size_t LoadFilter::Read ( uint8_t *  buf,
size_t  len 
)
pure virtual

Read a given number of bytes from the savegame.

Parameters
bufThe bytes to read.
lenThe number of bytes to read.
Returns
The number of actually read bytes.

Implemented in PacketReader, LZOLoadFilter, LZMALoadFilter, ZlibLoadFilter, NoCompLoadFilter, and FileReader.


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