OpenTTD Source
20241121-master-g67a0fccfad
|
Helper for reading strings. More...
#include <strgen.h>
Public Member Functions | |
StringReader (StringData &data, const std::string &file, bool master, bool translation) | |
Prepare reading. More... | |
void | HandleString (char *str) |
virtual std::optional< std::string > | ReadLine ()=0 |
Read a single line from the source of strings. More... | |
virtual void | HandlePragma (char *str) |
Handle the pragma of the file. More... | |
virtual void | ParseFile () |
Start parsing the file. | |
Data Fields | |
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. | |
StringReader::StringReader | ( | StringData & | data, |
const std::string & | file, | ||
bool | master, | ||
bool | translation | ||
) |
Prepare reading.
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 532 of file strgen_base.cpp.
|
virtual |
Handle the pragma of the file.
str | The pragma string to parse. |
Reimplemented in FileStringReader.
Definition at line 733 of file strgen_base.cpp.
References _lang, _plural_forms, lengthof, and LanguagePackHeader::plural_form.
|
pure virtual |
Read a single line from the source of strings.
Implemented in FileStringReader, and StringListReader.