LanguageCode
Locale::GetLanguageCode(void) const
{
- if ((__languageCode == LANGUAGE_INVALID) && (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1))
- {
- return LANGUAGE_INVALID_RESERVED;
- }
return __languageCode;
}
CountryCode
Locale::GetCountryCode(void) const
{
- if ((__countryCode == COUNTRY_INVALID) && (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1))
- {
- return COUNTRY_INVALID_RESERVED;
- }
return __countryCode;
}
LanguageCode invalidLanguageCode = LANGUAGE_INVALID;
LanguageCode maxLangageCode = LANGUAGE_MAX;
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- invalidLanguageCode = LANGUAGE_INVALID_RESERVED;
- maxLangageCode = LanguageMaxReserved;
- }
-
if (!languageCodeString.IsEmpty())
{
for (int i = 0; i < maxLangageCode; i++)
CountryCode invalidCountryCode = COUNTRY_INVALID;
CountryCode maxCountryCode = COUNTRY_MAX;
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- invalidCountryCode = COUNTRY_INVALID_RESERVED;
- maxCountryCode = CountryMaxReserved;
- }
-
if(!countryCodeString.IsEmpty())
{
for (int i = 0; i < maxCountryCode; i++)
String
Locale::LanguageCodeToString(LanguageCode languageCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((languageCode >= LANGUAGE_AAR) && (languageCode < LanguageMaxReserved))
- ? LanguageCodeString3LetterArray[languageCode]
- : String();
- }
-
return ((languageCode > LANGUAGE_INVALID) && (languageCode < LANGUAGE_MAX))
? LanguageCodeString3LetterArray[languageCode]
: String();
String
Locale::CountryCodeToString(CountryCode countryCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((countryCode >= COUNTRY_AF) && (countryCode < CountryMaxReserved))
- ? CountryCodeString2LetterArray[countryCode]
- : String();
- }
-
return ((countryCode > COUNTRY_INVALID) && (countryCode < COUNTRY_MAX))
? CountryCodeString2LetterArray[countryCode]
: String();
String
Locale::LanguageCodeToTwoLetterLanguageCodeString(LanguageCode languageCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((languageCode >= LANGUAGE_AAR) && (languageCode < LanguageMaxReserved))
- ? _LocaleImpl::Get2LetterLanguageCodeString(LanguageCodeString3LetterArray[languageCode])
- : String();
- }
-
return ((languageCode > LANGUAGE_INVALID) && (languageCode < LANGUAGE_MAX))
? _LocaleImpl::Get2LetterLanguageCodeString(LanguageCodeString3LetterArray[languageCode])
: String();
std::unique_ptr<char[]> pLangStr (_StringConverter::CopyToCharArrayN(languageCodeString));
return StringToLanguageCode(_LocaleImpl::Get3LetterLanguageCodeString(pLangStr.get()));
}
- return (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? LANGUAGE_INVALID_RESERVED : LANGUAGE_INVALID;
+ return LANGUAGE_INVALID;
}
String
Locale::CountryCodeToThreeLetterCountryCodeString(CountryCode countryCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((countryCode >= COUNTRY_AF) && (countryCode < CountryMaxReserved))
- ? _LocaleImpl::Get3LetterCountryCodeString(CountryCodeString2LetterArray[countryCode])
- : String();
- }
-
return ((countryCode > COUNTRY_INVALID) && (countryCode < COUNTRY_MAX))
? _LocaleImpl::Get3LetterCountryCodeString(CountryCodeString2LetterArray[countryCode])
: String();
{
if (countryCodeString.GetLength() == 3)
{
- CountryCode maxCountryCode = (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- ? (CountryCode)(COUNTRY_INVALID_RESERVED - 1)
- : COUNTRY_MAX;
+ CountryCode maxCountryCode = COUNTRY_MAX;
for (int i = 0; i < maxCountryCode; i++)
{
}
}
- return (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? COUNTRY_INVALID_RESERVED : COUNTRY_INVALID;
+ return COUNTRY_INVALID;
}