OpenTTD Source
12.0-beta2
|
Public Member Functions | |
HeaderFileWriter (const char *filename) | |
Open a file to write to. More... | |
~HeaderFileWriter () | |
Free the filename. | |
void | WriteStringID (const char *name, int stringid) |
Write the string ID. More... | |
void | Finalise (const StringData &data) |
Finalise writing the file. More... | |
![]() | |
virtual | ~HeaderWriter () |
Especially destroy the subclasses. | |
void | WriteHeader (const StringData &data) |
Write the header information. More... | |
![]() | |
FileWriter (FILE *file) | |
Create the file writer, so it writes to a specific file. More... | |
~FileWriter () | |
Make sure everything is cleaned up. | |
void | Write (byte *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 char *filename) | |
Open a file to write to. More... | |
void | Finalise () |
Finalise the writing. | |
virtual | ~FileWriter () |
Make sure the file is closed. | |
![]() | |
SaveFilter (SaveFilter *chain) | |
Initialise this filter. More... | |
virtual | ~SaveFilter () |
Make sure the writers are properly closed. | |
Data Fields | |
const char * | real_filename |
The real file name we eventually want to write to. | |
int | prev |
The previous string ID that was printed. | |
uint | total_strings |
![]() | |
FILE * | file |
The file to write to. | |
FILE * | fh |
The file handle we're writing to. | |
const char * | filename |
The file name we're writing to. | |
![]() | |
SaveFilter * | chain |
Chained to the (savegame) filters. | |
Definition at line 275 of file strgen.cpp.
|
inline |
Open a file to write to.
filename | The file to open. |
Definition at line 286 of file strgen.cpp.
References FileWriter::fh.
|
inlinevirtual |
Finalise writing the file.
data | The data about the string. |
Implements HeaderWriter.
Definition at line 308 of file strgen.cpp.
References _plural_forms, CompareFiles(), FileWriter::fh, FileWriter::filename, FileWriter::Finalise(), lengthof, and StringData::Version().
|
inlinevirtual |
Write the string ID.
name | The name of the string. |
stringid | The ID of the string. |
Implements HeaderWriter.
Definition at line 300 of file strgen.cpp.
References FileWriter::fh, and prev.