OpenTTD Source: StringListReader Struct Reference

OpenTTD Source 12.2

Public Member Functions | Data Fields
StringListReader Struct Reference

A reader that simply reads using fopen. More...

Inheritance diagram for StringListReader:

## Public Member Functions
| StringListReader (StringData &data, const LanguageStrings &strings, bool master, bool translation)
| Create the reader. More...
char * | ReadLine (char *buffer, const char *last) override
| Read a single line from the source of strings. More...
Public Member Functions inherited from StringReader
| StringReader (StringData &data, const char *file, bool master, bool translation)
| Prepare reading. More...
virtual | ~StringReader ()
| Make sure the right reader gets freed.
void | HandleString (char *str)
virtual void | HandlePragma (char *str)
| Handle the pragma of the file. More...
virtual void | ParseFile ()
| Start parsing the file.

## Data Fields
StringList::const_iterator | p
| The current location of the iteration.
StringList::const_iterator | end
| The end of the iteration.
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.

## Detailed Description

A reader that simply reads using fopen.

Definition at line 106 of file game_text.cpp.

## Constructor & Destructor Documentation

## ◆ StringListReader()

StringListReader::StringListReader | ( | StringData & | data,
|  | const LanguageStrings & | strings,
|  | bool | master,
|  | bool | translation
| ) |  |
| inline

Create the reader.

Parameters

  data | The data to fill during reading.
  strings | The language strings we are reading.
  master | Are we reading the master file?
  translation | Are we reading a translation?

Definition at line 117 of file game_text.cpp.

## Member Function Documentation

## ◆ ReadLine()

char* StringListReader::ReadLine | ( | char * | buffer,
|  | const char * | last
| ) |  |
| inlineoverridevirtual

Read a single line from the source of strings.

Parameters

  buffer | The buffer to read the data in to.
  last | The last element in the buffer.

Returns
  The buffer, or nullptr if at the end of the file.

Implements StringReader.

Definition at line 122 of file game_text.cpp.

References strecpy().

The documentation for this struct was generated from the following file:

- src/game/game_text.cpp