OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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

## Data Fields
lzma_stream | lzma
| Stream state that we are writing to.
Data Fields inherited from SaveFilter
SaveFilter * | chain
| Chained to the (savegame) filters.

## Detailed Description

Filter using LZMA compression.

Definition at line 2267 of file saveload.cpp.

## Constructor & Destructor Documentation

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 2275 of file saveload.cpp.

References lzma, and SlError().

LZMASaveFilter::~LZMASaveFilter | ( |  | ) |
| inline

Clean up what we allocated.

Definition at line 2281 of file saveload.cpp.

References lzma.

## Member Function Documentation

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

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 2313 of file saveload.cpp.

References 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 2292 of file saveload.cpp.

References SaveFilter::chain, lzma, MEMORY_CHUNK_SIZE, SlError(), and SaveFilter::Write().

Referenced by Finish(), and Write().

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

- src/saveload/saveload.cpp