UnmappedChoiceList Struct Reference

Helper structure for mapping choice lists. More...

Inheritance diagram for UnmappedChoiceList:
ZeroedMemoryAllocator

Public Member Functions

 ~UnmappedChoiceList ()
 Clean everything up.
 UnmappedChoiceList (StringControlCode type, char *old_d, int offset)
 Initialise the mapping.
char * Flush (const LanguageMap *lm)
 Flush this choice list into the old d variable.

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.

Detailed Description

Helper structure for mapping choice lists.

Definition at line 253 of file newgrf_text.cpp.


Constructor & Destructor Documentation

UnmappedChoiceList::~UnmappedChoiceList (  )  [inline]

Clean everything up.

Definition at line 255 of file newgrf_text.cpp.

References SmallVector< T, S >::Begin(), SmallVector< T, S >::End(), and strings.

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

Initialise the mapping.

Parameters:
type The type of mapping.
old_d The old begin of the string, i.e. from where to start writing again.
offset The offset to get the plural/gender from.

Definition at line 268 of file newgrf_text.cpp.


Member Function Documentation

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

Flush this choice list into the old d variable.

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

Definition at line 285 of file newgrf_text.cpp.

References _current_language, SmallMap< T, U, S >::Contains(), GB(), LanguageMap::GetReverseMapping(), grfmsg(), LanguagePackHeader::num_cases, LanguagePackHeader::num_genders, offset, old_d, LanguageMap::plural_form, strings, type, and Utf8Encode().

Referenced by TranslateTTDPatchCodes().


Field Documentation

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

Definition at line 278 of file newgrf_text.cpp.

Referenced by Flush(), TranslateTTDPatchCodes(), and ~UnmappedChoiceList().


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

Generated on Sun Jan 9 16:03:32 2011 for OpenTTD by  doxygen 1.6.1