OpenTTD Source 20241224-master-gf74b0cf984
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.
 
virtual ~LoadFilter ()=default
 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.
 
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 FileReader, NoCompLoadFilter, ZlibLoadFilter, LZMALoadFilter, LZOLoadFilter, and PacketReader.

◆ Reset()

virtual void LoadFilter::Reset ( )
inlinevirtual

Reset this filter to read from the beginning of the file.

Reimplemented in PacketReader, and FileReader.

Definition at line 40 of file saveload_filter.h.

Field Documentation

◆ chain

std::shared_ptr<LoadFilter> LoadFilter::chain

Chained to the (savegame) filters.

Definition at line 16 of file saveload_filter.h.

Referenced by NoCompLoadFilter::Read(), ZlibLoadFilter::Read(), LZMALoadFilter::Read(), and LZOLoadFilter::Read().


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