OpenTTD Source 20241224-master-gee860a5c8e
|
Base class for all language writers. More...
#include <strgen.h>
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. | |
|
pure virtual |
Finalise writing the file.
Implemented in TranslationWriter, and LanguageFileWriter.
|
pure virtual |
Write a number of bytes.
buffer | The buffer to write. |
length | The amount of byte to write. |
Implemented in TranslationWriter, and LanguageFileWriter.
Referenced by WriteLang(), and WriteLength().
|
pure virtual |
Write the header metadata.
The multi-byte integers are already converted to the little endian format.
header | The header to write. |
Implemented in TranslationWriter, and LanguageFileWriter.
Referenced by WriteLang().
|
virtual |
Actually write the language.
data | The data about the string. |
Definition at line 895 of file strgen_base.cpp.
References _cur_line, _lang, _translated, Buffer::AppendByte(), Buffer::AppendUtf8(), StringData::CountInUse(), LangString::english, GB(), LanguagePackHeader::IDENT, LanguagePackHeader::ident, LangString::line, LanguagePackHeader::missing, LangString::name, LanguagePackHeader::offsets, StringData::strings, TAB_SIZE, StringData::tabs, LangString::translated, LangString::translated_cases, LanguagePackHeader::version, StringData::Version(), LanguagePackHeader::winlangid, Write(), WriteHeader(), and WriteLength().
Referenced by GameStrings::Compile().
|
virtual |
Write the length as a simple gamma.
length | The number to write. |
Reimplemented in TranslationWriter.
Definition at line 876 of file strgen_base.cpp.
References Write().
Referenced by WriteLang().