LanguageInterface Class Reference

#include <stringresource.h>

Detailed Description

Class that handles string resources.

Public Member Functions

MAXON_METHOD String LoadResourceString (const Id &scope, const InternedId &keyValue)
 
MAXON_METHOD String GetName () const
 
MAXON_METHOD Id GetIdentifier () const
 
MAXON_METHOD LanguageRef GetFallbackLanguage () const
 
MAXON_METHOD String ToString (const maxon::FormatStatement *fs=nullptr) const
 

Static Public Member Functions

static MAXON_METHOD LanguageInterfaceAlloc (MAXON_SOURCE_LOCATION_DECLARATION)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (LanguageInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.language", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( LanguageInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.language"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ Alloc()

Allocator for common use.

Parameters
[in]allocLocationSource location.

◆ LoadResourceString()

MAXON_METHOD String LoadResourceString ( const Id scope,
const InternedId keyValue 
)

Loads a string from the resource.

Parameters
[in]scopeThe resource scope of a resource symbol.
[in]keyValueThe value of a resource symbol.
Returns
String.

◆ GetName()

MAXON_METHOD String GetName ( ) const

Returns the real (country-specific) name of a language.

Returns
The name.

◆ GetIdentifier()

MAXON_METHOD Id GetIdentifier ( ) const

Returns the identifier of a language.

Returns
The name.

◆ GetFallbackLanguage()

MAXON_METHOD LanguageRef GetFallbackLanguage ( ) const

Returns the fallback language of this language.

Returns
Nullptr if the language has no fallback language (e.g. "en-US" has none because it's the root of all languages).

◆ ToString()

MAXON_METHOD String ToString ( const maxon::FormatStatement fs = nullptr) const

Returns a String representation of this @CLASS.

Parameters
[in]formatStatementNullptr or additional formatting instruction.
Returns
String representation of this @CLASS.