OpenTTD Source: ZlibLoadFilter Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
ZlibLoadFilter Struct Reference

Filter using Zlib compression. More...

Inheritance diagram for ZlibLoadFilter:

## Public Member Functions
| ZlibLoadFilter (std::shared_ptr< LoadFilter > chain)
| Initialise this filter.
| ~ZlibLoadFilter ()
| Clean everything up.
size_t | Read (uint8_t *buf, size_t size) override
| Read a given number of bytes from the savegame.
Public Member Functions inherited from LoadFilter
| LoadFilter (std::shared_ptr< LoadFilter > chain)
| Initialise this filter.
virtual | ~LoadFilter ()=default
| 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< LoadFilter > | chain
| Chained to the (savegame) filters.

## Detailed Description

Filter using Zlib compression.

Definition at line 2562 of file saveload.cpp.

## Constructor & Destructor Documentation

## ◆ ZlibLoadFilter()

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

Initialise this filter.

Parameters

  chain | The next filter in this chain.

Definition at line 2570 of file saveload.cpp.

References SlError(), and z.

## ◆ ~ZlibLoadFilter()

ZlibLoadFilter::~ZlibLoadFilter | ( |  | ) |
| inline

Clean everything up.

Definition at line 2576 of file saveload.cpp.

References z.

## 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

  buf | The bytes to read.
  len | The number of bytes to read.

Returns
  The number of actually read bytes.

Implements LoadFilter.

Definition at line 2581 of file saveload.cpp.

References LoadFilter::chain, fread_buf, SlError(), and z.

## Field Documentation

## ◆ fread_buf

uint8_t ZlibLoadFilter::fread_buf[MEMORY_CHUNK_SIZE]

Buffer for reading from the file.

Definition at line 2564 of file saveload.cpp.

Referenced by Read().

## ◆ z

z_stream ZlibLoadFilter::z {}

Stream state we are reading from.

Definition at line 2563 of file saveload.cpp.

Referenced by Read(), ZlibLoadFilter(), and ~ZlibLoadFilter().

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

- src/saveload/saveload.cpp