OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
OpenXcom::LanguagePlurality Class Referenceabstract

This class is the interface used to find plural forms for the different languages. More...

#include <LanguagePlurality.h>

Inheritance diagram for OpenXcom::LanguagePlurality:
OpenXcom::CyrillicPlurality OpenXcom::CzechPlurality OpenXcom::NoSingular OpenXcom::OneSingular OpenXcom::PolishPlurality OpenXcom::RomanianPlurality OpenXcom::ZeroOneSingular

Public Member Functions

virtual ~LanguagePlurality ()
 Allow proper destruction through base pointer.
 
virtual const char * getSuffix (unsigned n) const =0
 Get dictionary key suffix for value of n. More...
 

Static Public Member Functions

static LanguagePluralitycreate (const std::string &language)
 Create a concrete instance for a given language. More...
 

Detailed Description

This class is the interface used to find plural forms for the different languages.

Derived classes implement getSuffix() according to the specific language's rules.

Member Function Documentation

LanguagePlurality * OpenXcom::LanguagePlurality::create ( const std::string &  language)
static

Create a concrete instance for a given language.

Search and create a handler for the plurality rules of language.

Parameters
languageLocale of the language.
Returns
Plurality rules for that language.

If the language was not found, a default with the same rules as English is returned.

Parameters
languageThe target language.
Returns
A newly created LanguagePlurality instance for the given language.
virtual const char* OpenXcom::LanguagePlurality::getSuffix ( unsigned  n) const
pure virtual

Get dictionary key suffix for value of n.

Parameters
nThe number controlling the plurality.
Returns
Pointer to the zero-terminated suffix string.

Implemented in OpenXcom::RomanianPlurality, OpenXcom::PolishPlurality, OpenXcom::CzechPlurality, OpenXcom::CyrillicPlurality, OpenXcom::NoSingular, OpenXcom::ZeroOneSingular, and OpenXcom::OneSingular.


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