OpenTTD
Public Member Functions | Data Fields
UnmappedChoiceList Struct Reference

Helper structure for mapping choice lists. More...

Inheritance diagram for UnmappedChoiceList:
ZeroedMemoryAllocator

Public Member Functions

 ~UnmappedChoiceList ()
 Clean everything up. More...
 
 UnmappedChoiceList (StringControlCode type, char *old_d, int offset)
 Initialise the mapping. More...
 
char * Flush (const LanguageMap *lm)
 Flush this choice list into the old d variable. More...
 
- Public Member Functions inherited from ZeroedMemoryAllocator
void * operator new (size_t size)
 Memory allocator for a single class instance. More...
 
void * operator new[] (size_t size)
 Memory allocator for an array of class instances. More...
 
void operator delete (void *ptr)
 Memory release for a single class instance. More...
 
void operator delete[] (void *ptr)
 Memory release for an array of class instances. More...
 

Data Fields

StringControlCode type
 The type of choice list.
 
char * old_d
 The old/original location of the "d" local variable.
 
int offset
 The offset for the plural/gender form.
 
SmallMap< byte, char * > strings
 Mapping of NewGRF supplied ID to the different strings in the choice list. More...
 

Detailed Description

Helper structure for mapping choice lists.

Definition at line 193 of file newgrf_text.cpp.

Constructor & Destructor Documentation

◆ ~UnmappedChoiceList()

UnmappedChoiceList::~UnmappedChoiceList ( )
inline

Clean everything up.

Definition at line 195 of file newgrf_text.cpp.

References free().

◆ UnmappedChoiceList()

UnmappedChoiceList::UnmappedChoiceList ( StringControlCode  type,
char *  old_d,
int  offset 
)
inline

Initialise the mapping.

Parameters
typeThe type of mapping.
old_dThe old begin of the string, i.e. from where to start writing again.
offsetThe offset to get the plural/gender from.

Definition at line 208 of file newgrf_text.cpp.

Member Function Documentation

◆ Flush()

char* UnmappedChoiceList::Flush ( const LanguageMap lm)
inline

Flush this choice list into the old d variable.

Parameters
lmThe current language mapping.
Returns
The new location of the output string.

Definition at line 225 of file newgrf_text.cpp.

References SmallMap< T, U, S >::Contains(), grfmsg(), GRFText::len, stredup(), and Utf8Encode().

Field Documentation

◆ strings

SmallMap<byte, char *> UnmappedChoiceList::strings

Mapping of NewGRF supplied ID to the different strings in the choice list.

Definition at line 218 of file newgrf_text.cpp.


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