OpenTTD Source 20241224-master-gf74b0cf984
SaveFilter Struct Referenceabstract

Interface for filtering a savegame till it is written. More...

#include <saveload_filter.h>

Inheritance diagram for SaveFilter:
FileWriter LZMASaveFilter LZOSaveFilter NoCompSaveFilter PacketWriter ZlibSaveFilter HeaderFileWriter LanguageFileWriter

Public Member Functions

 SaveFilter (std::shared_ptr< SaveFilter > chain)
 Initialise this filter.
 
virtual ~SaveFilter ()=default
 Make sure the writers are properly closed.
 
virtual void Write (uint8_t *buf, size_t len)=0
 Write a given number of bytes into the savegame.
 
virtual void Finish ()
 Prepare everything to finish writing the savegame.
 

Data Fields

std::shared_ptr< SaveFilterchain
 Chained to the (savegame) filters.
 

Detailed Description

Interface for filtering a savegame till it is written.

Definition at line 57 of file saveload_filter.h.

Constructor & Destructor Documentation

◆ SaveFilter()

SaveFilter::SaveFilter ( std::shared_ptr< SaveFilter chain)
inline

Initialise this filter.

Parameters
chainThe next filter in this chain.

Definition at line 65 of file saveload_filter.h.

Member Function Documentation

◆ Finish()

virtual void SaveFilter::Finish ( )
inlinevirtual

Prepare everything to finish writing the savegame.

Reimplemented in PacketWriter, FileWriter, ZlibSaveFilter, and LZMASaveFilter.

Definition at line 82 of file saveload_filter.h.

◆ Write()

virtual void SaveFilter::Write ( uint8_t *  buf,
size_t  len 
)
pure virtual

Write a given number of bytes into the savegame.

Parameters
bufThe bytes to write.
lenThe number of bytes to write.

Implemented in PacketWriter, FileWriter, LZOSaveFilter, NoCompSaveFilter, ZlibSaveFilter, and LZMASaveFilter.

Field Documentation

◆ chain

std::shared_ptr<SaveFilter> SaveFilter::chain

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