OpenTTD Source: TranslationWriter Struct Reference

OpenTTD Source 14.0-beta1

Public Member Functions | Data Fields
TranslationWriter Struct Reference

Class for writing an encoded language. More...

Inheritance diagram for TranslationWriter:

## Public Member Functions
| TranslationWriter (StringList &strings)
| Writer for the encoded data. More...
void | WriteHeader (const LanguagePackHeader *) override
| Write the header metadata. More...
void | Finalise () override
| Finalise writing the file.
void | WriteLength (uint) override
| Write the length as a simple gamma. More...
void | Write (const byte *buffer, size_t length) override
| Write a number of bytes. More...
Public Member Functions inherited from LanguageWriter
virtual | ~LanguageWriter ()=default
| Especially destroy the subclasses.
virtual void | WriteLang (const StringData &data)
| Actually write the language. More...

## Data Fields
StringList & | strings
| The encoded strings.

## Detailed Description

Class for writing an encoded language.

Definition at line 113 of file game_text.cpp.

## Constructor & Destructor Documentation

## ◆ TranslationWriter()

TranslationWriter::TranslationWriter | ( | StringList & | strings | ) |
| inline

Writer for the encoded data.

Parameters

  strings | The string table to add the strings to.

Definition at line 120 of file game_text.cpp.

## Member Function Documentation

## ◆ Write()

void TranslationWriter::Write | ( | const byte * | buffer,
|  | size_t | length
| ) |  |
| inlineoverridevirtual

Write a number of bytes.

Parameters

  buffer | The buffer to write.
  length | The amount of byte to write.

Implements LanguageWriter.

Definition at line 139 of file game_text.cpp.

## ◆ WriteHeader()

void TranslationWriter::WriteHeader | ( | const LanguagePackHeader * | header | ) |
| inlineoverridevirtual

Write the header metadata.

The multi-byte integers are already converted to the little endian format.

Parameters

  header | The header to write.

Implements LanguageWriter.

Definition at line 124 of file game_text.cpp.

## ◆ WriteLength()

void TranslationWriter::WriteLength | ( | uint | length | ) |
| inlineoverridevirtual

Write the length as a simple gamma.

Parameters

  length | The number to write.

Reimplemented from LanguageWriter.

Definition at line 134 of file game_text.cpp.

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

- src/game/game_text.cpp