OpenTTD Source 20241224-master-gee860a5c8e
LanguageWriter Struct Referenceabstract

Base class for all language writers. More...

#include <strgen.h>

Inheritance diagram for LanguageWriter:
LanguageFileWriter TranslationWriter

Public Member Functions

virtual void WriteHeader (const LanguagePackHeader *header)=0
 Write the header metadata.
 
virtual void Write (const uint8_t *buffer, size_t length)=0
 Write a number of bytes.
 
virtual void Finalise ()=0
 Finalise writing the file.
 
virtual ~LanguageWriter ()=default
 Especially destroy the subclasses.
 
virtual void WriteLength (uint length)
 Write the length as a simple gamma.
 
virtual void WriteLang (const StringData &data)
 Actually write the language.
 

Detailed Description

Base class for all language writers.

Definition at line 108 of file strgen.h.

Member Function Documentation

◆ Finalise()

virtual void LanguageWriter::Finalise ( )
pure virtual

Finalise writing the file.

Implemented in TranslationWriter, and LanguageFileWriter.

◆ Write()

virtual void LanguageWriter::Write ( const uint8_t *  buffer,
size_t  length 
)
pure virtual

Write a number of bytes.

Parameters
bufferThe buffer to write.
lengthThe amount of byte to write.

Implemented in TranslationWriter, and LanguageFileWriter.

Referenced by WriteLang(), and WriteLength().

◆ WriteHeader()

virtual void LanguageWriter::WriteHeader ( const LanguagePackHeader header)
pure virtual

Write the header metadata.

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

Parameters
headerThe header to write.

Implemented in TranslationWriter, and LanguageFileWriter.

Referenced by WriteLang().

◆ WriteLang()

◆ WriteLength()

void LanguageWriter::WriteLength ( uint  length)
virtual

Write the length as a simple gamma.

Parameters
lengthThe number to write.

Reimplemented in TranslationWriter.

Definition at line 876 of file strgen_base.cpp.

References Write().

Referenced by WriteLang().


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