|
OpenTTD
|
A reader that simply reads using fopen. More...
Public Member Functions | |
| FileStringReader (StringData &data, const char *file, bool master, bool translation) | |
| Create the reader. | |
| virtual | ~FileStringReader () |
| Free/close the file. | |
| char * | ReadLine (char *buffer, const char *last) |
| Read a single line from the source of strings. | |
| void | HandlePragma (char *str) |
| Handle the pragma of the file. | |
| void | ParseFile () |
| Start parsing the file. | |
Public Member Functions inherited from StringReader | |
| StringReader (StringData &data, const char *file, bool master, bool translation) | |
| Prepare reading. | |
| virtual | ~StringReader () |
| Make sure the right reader gets freed. | |
| void | HandleString (char *str) |
Data Fields | |
| FILE * | fh |
| The file we are reading. | |
Data Fields inherited from StringReader | |
| StringData & | data |
| The data to fill during reading. | |
| const char * | 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 102 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 112 of file strgen.cpp.
|
inlinevirtual |
|
virtual |
Handle the pragma of the file.
| str | The pragma string to parse. |
Reimplemented from StringReader.
Definition at line 142 of file strgen.cpp.
References _lang, LanguagePackHeader::cases, StringReader::data, LanguagePackHeader::digit_decimal_separator, LanguagePackHeader::digit_group_separator, LanguagePackHeader::digit_group_separator_currency, error(), LanguagePackHeader::genders, LanguagePackHeader::isocode, lastof, StringReader::master, MAX_NUM_CASES, MAX_NUM_GENDERS, LanguagePackHeader::name, NBSP, LanguagePackHeader::newgrflangid, StringData::next_string_id, LanguagePackHeader::num_cases, LanguagePackHeader::num_genders, LanguagePackHeader::own_name, strecpy(), TD_LTR, TD_RTL, LanguagePackHeader::text_dir, and LanguagePackHeader::winlangid.
|
inlinevirtual |
Read a single line from the source of strings.
| buffer | The buffer to read the data in to. |
| last | The last element in the buffer. |
Implements StringReader.
Definition at line 125 of file strgen.cpp.
References ClampToU16(), and fh.
1.8.1.2