You.i Engine
CYILocaleBridge Class Referenceabstract

Detailed Description

Utility function to retrieve the current system locale.

This bridge is available on all platforms.

#include <platform/YiLocaleBridge.h>

Public Types

enum  TemperatureUnit : uint8_t {
  TemperatureUnit::Unknown = 0,
  TemperatureUnit::Celsius,
  TemperatureUnit::Fahrenheit
}
 
enum  MeasurementSystem : uint8_t {
  MeasurementSystem::Unknown = 0,
  MeasurementSystem::Metric,
  MeasurementSystem::Imperial
}
 
enum  CalendarType : uint8_t {
  CalendarType::Unknown = 0,
  CalendarType::Buddhist,
  CalendarType::ChineseLunar,
  CalendarType::Coptic,
  CalendarType::Ethiopic,
  CalendarType::Gregorian,
  CalendarType::Hebrew,
  CalendarType::Hijri,
  CalendarType::IndianNational,
  CalendarType::Islamic,
  CalendarType::ISO8601,
  CalendarType::Japanese,
  CalendarType::JapaneseLunar,
  CalendarType::Korean,
  CalendarType::KoreanLunar,
  CalendarType::Persian,
  CalendarType::Taiwan,
  CalendarType::TaiwanLunar,
  CalendarType::Thai,
  CalendarType::VietnameseLunar
}
 

Public Member Functions

 CYILocaleBridge ()
 
virtual ~CYILocaleBridge ()
 
virtual bool GetLocale (CYIString &rLanguageCode, CYIString &rCountryCode)
 
virtual std::vector< CYILocaleGetLocales (bool *pError=nullptr)=0
 
virtual std::vector< CYIStringGetLocalCurrencies ()=0
 
virtual CYIString GetLocalDecimalPoint ()=0
 
virtual CYIString GetLocalGroupingSeparator ()=0
 
virtual bool Uses24HourClock ()=0
 
virtual CYILocaleBridge::CalendarType GetLocalCalendar ()=0
 
virtual TemperatureUnit GetLocalTemperatureUnit ()=0
 
virtual MeasurementSystem GetLocalMeasurementSystem ()=0
 
virtual CYIString GetLocalDateFormat ()=0
 

Member Enumeration Documentation

◆ CalendarType

enum CYILocaleBridge::CalendarType : uint8_t
strong
Enumerator
Unknown 

Any calendar that was unrecognized

Buddhist 

Buddhist calendar type

ChineseLunar 

Chinese Lunar calendar type

Coptic 

Coptic calendar type

Ethiopic 

Ethiopic calendar type

Gregorian 

Gregorian calendar type

Hebrew 

Hebrew calendar type

Hijri 

Hijri calendar type

IndianNational 

Indian National calendar type

Islamic 

Islamic calendar type

ISO8601 

ISO-8601 calendar type

Japanese 

Japanese calendar type

JapaneseLunar 

Japanese Lunar calendar type

Korean 

Korean calendar type

KoreanLunar 

Korean Lunar calendar type

Persian 

Persian calendar type

Taiwan 

Taiwan calendar type

TaiwanLunar 

Taiwan Lunar calendar type

Thai 

Thai calendar type

VietnameseLunar 

Vietnamese Lunar calendar type

◆ MeasurementSystem

enum CYILocaleBridge::MeasurementSystem : uint8_t
strong
Enumerator
Unknown 
Metric 
Imperial 

◆ TemperatureUnit

enum CYILocaleBridge::TemperatureUnit : uint8_t
strong
Enumerator
Unknown 
Celsius 
Fahrenheit 

Constructor & Destructor Documentation

◆ CYILocaleBridge()

CYILocaleBridge::CYILocaleBridge ( )
inline

◆ ~CYILocaleBridge()

virtual CYILocaleBridge::~CYILocaleBridge ( )
inlinevirtual

Member Function Documentation

◆ GetLocalCalendar()

virtual CYILocaleBridge::CalendarType CYILocaleBridge::GetLocalCalendar ( )
pure virtual

Returns the calendar based on device settings.

◆ GetLocalCurrencies()

virtual std::vector<CYIString> CYILocaleBridge::GetLocalCurrencies ( )
pure virtual

Returns currencies as a vector of CYIString or an empty vector if getting local currency is not supported on the current platform. Currency is set to a 3 character ISO 4217 symbol. The fourth spacing character as seen in POSIX API is not returned.

◆ GetLocalDateFormat()

virtual CYIString CYILocaleBridge::GetLocalDateFormat ( )
pure virtual

Returns the date format for the current locale. Default implementation is the ISO 8601 date format "YYYY-MM-DD".

◆ GetLocalDecimalPoint()

virtual CYIString CYILocaleBridge::GetLocalDecimalPoint ( )
pure virtual

Returns the character used for the decimal point in the current locale.

◆ GetLocale()

virtual bool CYILocaleBridge::GetLocale ( CYIString rLanguageCode,
CYIString rCountryCode 
)
virtual

Returns true if the locale could be determined. rLanguageCode is set to a 2 character ISO-639-1 code and rCountryCode is set to a 2 character ISO-3166-1 code.

Deprecated:
This function is deprecated and may be removed in a future release. GetLocales() should be used instead.

◆ GetLocales()

virtual std::vector<CYILocale> CYILocaleBridge::GetLocales ( bool *  pError = nullptr)
pure virtual

Returns a vector of prefered locales. The value pointed-to by pError will be set to true if the locale couldn't be determined.

◆ GetLocalGroupingSeparator()

virtual CYIString CYILocaleBridge::GetLocalGroupingSeparator ( )
pure virtual

Returns the character used for the grouping separator in the current locale.

◆ GetLocalMeasurementSystem()

virtual MeasurementSystem CYILocaleBridge::GetLocalMeasurementSystem ( )
pure virtual

Returns the measurement system in the current locale.

◆ GetLocalTemperatureUnit()

virtual TemperatureUnit CYILocaleBridge::GetLocalTemperatureUnit ( )
pure virtual

Returns the temperature unit in the current locale.

◆ Uses24HourClock()

virtual bool CYILocaleBridge::Uses24HourClock ( )
pure virtual

Returns true if time strings should be formatted using a 24 hour clock, and false if time strings should be formatted using a 12 hour AM/PM clock.


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