OpenTTD Source 20241224-master-gee860a5c8e
HeaderWriter Struct Referenceabstract

Base class for writing the header, i.e. More...

#include <strgen.h>

Inheritance diagram for HeaderWriter:
HeaderFileWriter StringNameWriter

Public Member Functions

virtual void WriteStringID (const std::string &name, int stringid)=0
 Write the string ID.
 
virtual void Finalise (const StringData &data)=0
 Finalise writing the file.
 
virtual ~HeaderWriter ()=default
 Especially destroy the subclasses.
 
void WriteHeader (const StringData &data)
 Write the header information.
 

Detailed Description

Base class for writing the header, i.e.

the STR_XXX to numeric value.

Definition at line 87 of file strgen.h.

Member Function Documentation

◆ Finalise()

virtual void HeaderWriter::Finalise ( const StringData data)
pure virtual

Finalise writing the file.

Parameters
dataThe data about the string.

Implemented in StringNameWriter, and HeaderFileWriter.

◆ WriteHeader()

void HeaderWriter::WriteHeader ( const StringData data)

Write the header information.

Parameters
dataThe data about the string.

Definition at line 786 of file strgen_base.cpp.

References StringData::max_strings, StringData::strings, and WriteStringID().

Referenced by GameStrings::Compile().

◆ WriteStringID()

virtual void HeaderWriter::WriteStringID ( const std::string &  name,
int  stringid 
)
pure virtual

Write the string ID.

Parameters
nameThe name of the string.
stringidThe ID of the string.

Implemented in StringNameWriter, and HeaderFileWriter.

Referenced by WriteHeader().


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