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.
## Data Fields
lzma_stream | lzma
| Stream state that we are writing to.

## Detailed Description

Filter using LZMA compression.

Definition at line 2177 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 2185 of file saveload.cpp.

References lzma, and SlError().

LZMASaveFilter::~LZMASaveFilter | ( |  | ) | `[inline]`

Clean up what we allocated.

Definition at line 2191 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 2223 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 2202 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