OpenTTD Source
20241108-master-g80f628063a
|
Filter using LZMA compression. More...
Public Member Functions | |
LZMASaveFilter (std::shared_ptr< SaveFilter > chain, uint8_t compression_level) | |
Initialise this filter. More... | |
~LZMASaveFilter () | |
Clean up what we allocated. | |
void | WriteLoop (uint8_t *p, size_t len, lzma_action action) |
Helper loop for writing the data. More... | |
void | Write (uint8_t *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 (std::shared_ptr< 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. | |
uint8_t | fwrite_buf [MEMORY_CHUNK_SIZE] |
Buffer for writing to the file. | |
Data Fields inherited from SaveFilter | |
std::shared_ptr< SaveFilter > | chain |
Chained to the (savegame) filters. | |
Filter using LZMA compression.
Definition at line 2587 of file saveload.cpp.
|
inline |
Initialise this filter.
chain | The next filter in this chain. |
compression_level | The requested level of compression. |
Definition at line 2596 of file saveload.cpp.
References SlError().
|
inlineoverridevirtual |
Write a given number of bytes into the savegame.
buf | The bytes to write. |
len | The number of bytes to write. |
Implements SaveFilter.
Definition at line 2633 of file saveload.cpp.
References WriteLoop().
|
inline |
Helper loop for writing the data.
p | The bytes to write. |
len | Amount of bytes to write. |
action | Action for lzma_code. |
Definition at line 2613 of file saveload.cpp.
References SaveFilter::chain, fwrite_buf, and SlError().