OpenTTD
|
Public Member Functions | |
HeaderFileWriter (const char *filename) | |
Open a file to write to. | |
~HeaderFileWriter () | |
Free the filename. | |
void | WriteStringID (const char *name, int stringid) |
Write the string ID. | |
void | Finalise (const StringData &data) |
Finalise writing the file. | |
![]() | |
virtual | ~HeaderWriter () |
Especially destroy the subclasses. | |
void | WriteHeader (const StringData &data) |
Write the header information. | |
![]() | |
FileWriter (FILE *file) | |
Create the file writer, so it writes to a specific file. | |
~FileWriter () | |
Make sure everything is cleaned up. | |
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. | |
FileWriter (const char *filename) | |
Open a file to write to. | |
void | Finalise () |
Finalise the writing. | |
virtual | ~FileWriter () |
Make sure the file is closed. | |
![]() | |
SaveFilter (SaveFilter *chain) | |
Initialise this filter. | |
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. | |
![]() | |
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 277 of file strgen.cpp.
|
inline |
Open a file to write to.
filename | The file to open. |
Definition at line 287 of file strgen.cpp.
References FileWriter::fh.
|
inline |
|
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(), error(), FileWriter::fh, FileWriter::filename, FileWriter::Finalise(), lengthof, max(), real_filename, 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 301 of file strgen.cpp.
References FileWriter::fh, and prev.
int HeaderFileWriter::prev |
The previous string ID that was printed.
Definition at line 281 of file strgen.cpp.
Referenced by WriteStringID().
const char* HeaderFileWriter::real_filename |
The real file name we eventually want to write to.
Definition at line 279 of file strgen.cpp.
Referenced by Finalise(), and ~HeaderFileWriter().