OpenTTD Source
20241121-master-g67a0fccfad
|
A reader that simply reads using fopen. More...
Public Member Functions | |
FileStringReader (StringData &data, const std::filesystem::path &file, bool master, bool translation) | |
Create the reader. More... | |
std::optional< std::string > | ReadLine () override |
Read a single line from the source of strings. More... | |
void | HandlePragma (char *str) override |
Handle the pragma of the file. More... | |
void | ParseFile () override |
Start parsing the file. | |
Public Member Functions inherited from StringReader | |
StringReader (StringData &data, const std::string &file, bool master, bool translation) | |
Prepare reading. More... | |
void | HandleString (char *str) |
Data Fields | |
std::ifstream | input_stream |
Data Fields inherited from StringReader | |
StringData & | data |
The data to fill during reading. | |
const std::string | file |
The file we are reading. | |
bool | master |
Are we reading the master file? | |
bool | translation |
Are we reading a translation, implies !master. However, the base translation will have this false. | |
A reader that simply reads using fopen.
Definition at line 71 of file strgen.cpp.
|
inline |
Create the reader.
data | The data to fill during reading. |
file | The file we are reading. |
master | Are we reading the master file? |
translation | Are we reading a translation? |
Definition at line 81 of file strgen.cpp.
References StringReader::file.
|
overridevirtual |
Handle the pragma of the file.
str | The pragma string to parse. |
Reimplemented from StringReader.
Definition at line 106 of file strgen.cpp.
References _lang, StringReader::data, LanguagePackHeader::isocode, LanguagePackHeader::name, StringData::next_string_id, LanguagePackHeader::own_name, strecpy(), TD_LTR, TD_RTL, and LanguagePackHeader::text_dir.
|
inlineoverridevirtual |
Read a single line from the source of strings.
Implements StringReader.
Definition at line 87 of file strgen.cpp.