|
OpenTTD Source 20251117-master-g7398d2e290
|
Public Member Functions | |
| HeaderFileWriter (const std::filesystem::path &path) | |
| Open a file to write to. | |
| void | WriteStringID (const std::string &name, size_t stringid) override |
| Write the string ID. | |
| void | Finalise (const StringData &data) override |
| Finalise writing the file. | |
Public Member Functions inherited from HeaderWriter | |
| virtual | ~HeaderWriter ()=default |
| Especially destroy the subclasses. | |
| void | WriteHeader (const StringData &data) |
| Write the header information. | |
Public Member Functions inherited from FileWriter | |
| FileWriter (FileHandle &&file) | |
| Create the file writer, so it writes to a specific file. | |
| ~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. | |
| 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. | |
| 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. | |
| virtual | ~SaveFilter ()=default |
| Make sure the writers are properly closed. | |
Data Fields | |
| const std::filesystem::path | real_path |
| The real path we eventually want to write to. | |
| size_t | prev |
| The previous string ID that was printed. | |
| size_t | total_strings |
Data Fields inherited from FileWriter | |
| 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. | |
Definition at line 218 of file strgen.cpp.
|
inline |
Open a file to write to.
| path | The path to the file to open. |
Definition at line 229 of file strgen.cpp.
References FileWriter::output_stream.
|
inlineoverridevirtual |
Finalise writing the file.
| data | The data about the string. |
Implements HeaderWriter.
Definition at line 245 of file strgen.cpp.
References _plural_forms, FileWriter::Finalise(), FileWriter::output_stream, FileWriter::path, and StringData::Version().
|
inlineoverridevirtual |
Write the string ID.
| name | The name of the string. |
| stringid | The ID of the string. |
Implements HeaderWriter.
Definition at line 237 of file strgen.cpp.
References FileWriter::output_stream, and prev.
| size_t HeaderFileWriter::prev |
The previous string ID that was printed.
Definition at line 222 of file strgen.cpp.
Referenced by WriteStringID().
| const std::filesystem::path HeaderFileWriter::real_path |
The real path we eventually want to write to.
Definition at line 220 of file strgen.cpp.
| size_t HeaderFileWriter::total_strings |
Definition at line 223 of file strgen.cpp.