OpenTTD Source: LZMASaveFilter Struct Reference

OpenTTD Source 14.0-beta1

Public Member Functions | Data Fields
LZMASaveFilter Struct Reference

Filter using LZMA compression. More...

Inheritance diagram for LZMASaveFilter:

## Public Member Functions
| LZMASaveFilter (SaveFilter *chain, byte compression_level)
| Initialise this filter. More...
| ~LZMASaveFilter ()
| Clean up what we allocated.
void | WriteLoop (byte *p, size_t len, lzma_action action)
| Helper loop for writing the data. More...
void | Write (byte *buf, size_t size) override
| Write a given number of bytes into the savegame. More...
void | Finish () override
| Prepare everything to finish writing the savegame.
Public Member Functions inherited from SaveFilter
| SaveFilter (SaveFilter *chain)
| Initialise this filter. More...
virtual | ~SaveFilter ()
| Make sure the writers are properly closed.

## Data Fields
lzma_stream | lzma
| Stream state that we are writing to.
byte | fwrite_buf [MEMORY_CHUNK_SIZE]
| Buffer for writing to the file.
Data Fields inherited from SaveFilter
SaveFilter * | chain
| Chained to the (savegame) filters.

## Detailed Description

Filter using LZMA compression.

Definition at line 2545 of file saveload.cpp.

## Constructor & Destructor Documentation

## ◆ LZMASaveFilter()

LZMASaveFilter::LZMASaveFilter | ( | SaveFilter * | chain,
|  | byte | compression_level
| ) |  |
| inline

Initialise this filter.

Parameters

  chain | The next filter in this chain.
  compression_level | The requested level of compression.

Definition at line 2554 of file saveload.cpp.

References SlError().

## Member Function Documentation

## ◆ Write()

void LZMASaveFilter::Write | ( | byte * | buf,
|  | size_t | len
| ) |  |
| inlineoverridevirtual

Write a given number of bytes into the savegame.

Parameters

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

Implements SaveFilter.

Definition at line 2591 of file saveload.cpp.

References WriteLoop().

## ◆ WriteLoop()

void LZMASaveFilter::WriteLoop | ( | byte * | p,
|  | size_t | len,
|  | lzma_action | action
| ) |  |
| inline

Helper loop for writing the data.

Parameters

  p | The bytes to write.
  len | Amount of bytes to write.
  action | Action for lzma_code.

Definition at line 2571 of file saveload.cpp.

References fwrite_buf, and SlError().

Referenced by Finish(), and Write().

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

- src/saveload/saveload.cpp