OpenTTD Source  20241108-master-g80f628063a
ZlibLoadFilter Struct Reference

Filter using Zlib compression. More...

Inheritance diagram for ZlibLoadFilter:
LoadFilter

Public Member Functions

 ZlibLoadFilter (std::shared_ptr< LoadFilter > chain)
 Initialise this filter. More...
 
 ~ZlibLoadFilter ()
 Clean everything up.
 
size_t Read (uint8_t *buf, size_t size) override
 Read a given number of bytes from the savegame. More...
 
- Public Member Functions inherited from LoadFilter
 LoadFilter (std::shared_ptr< LoadFilter > chain)
 Initialise this filter. More...
 
virtual ~LoadFilter ()
 Make sure the writers are properly closed.
 
virtual void Reset ()
 Reset this filter to read from the beginning of the file.
 

Data Fields

z_stream z
 Stream state we are reading from.
 
uint8_t fread_buf [MEMORY_CHUNK_SIZE]
 Buffer for reading from the file.
 
- Data Fields inherited from LoadFilter
std::shared_ptr< LoadFilterchain
 Chained to the (savegame) filters.
 

Detailed Description

Filter using Zlib compression.

Definition at line 2415 of file saveload.cpp.

Constructor & Destructor Documentation

◆ ZlibLoadFilter()

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

Initialise this filter.

Parameters
chainThe next filter in this chain.

Definition at line 2423 of file saveload.cpp.

References SlError().

Member Function Documentation

◆ Read()

size_t ZlibLoadFilter::Read ( uint8_t *  buf,
size_t  len 
)
inlineoverridevirtual

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.

Implements LoadFilter.

Definition at line 2435 of file saveload.cpp.


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