OpenTTD Source
20241108-master-g80f628063a
|
Yes, simply writing to a file. More...
Public Member Functions | |
FileWriter (FileHandle &&file) | |
Create the file writer, so it writes to a specific file. More... | |
~FileWriter () | |
Make sure everything is cleaned up. | |
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. | |
FileWriter (const std::filesystem::path &path, std::ios_base::openmode openmode) | |
Open a file to write to. More... | |
void | Finalise () |
Finalise the writing. | |
virtual | ~FileWriter () |
Make sure the file is closed. | |
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 | |
std::optional< FileHandle > | file |
The file to write to. | |
std::ofstream | output_stream |
The stream to write all the output to. | |
const std::filesystem::path | path |
The file name we're writing to. | |
Data Fields inherited from SaveFilter | |
std::shared_ptr< SaveFilter > | chain |
Chained to the (savegame) filters. | |
Yes, simply writing to a file.
Base class for writing data to disk.
Definition at line 2244 of file saveload.cpp.
|
inline |
Create the file writer, so it writes to a specific file.
file | The file to write to. |
Definition at line 2251 of file saveload.cpp.
|
inline |
Open a file to write to.
path | The path to the file to open. |
openmode | The openmode flags for opening the file. |
Definition at line 200 of file strgen.cpp.
References path.
|
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 2261 of file saveload.cpp.
References SlError().