Home
last modified time | relevance | path

Searched refs:region (Results 1 – 25 of 49) sorted by relevance

12

/base/global/i18n_lite/interfaces/kits/js/builtin/src/
Dlocale_module.cpp41 char *region = reinterpret_cast<char *>(ace_malloc(MAX_REGION_LENGTH)); in GetRegion() local
42 if (region == nullptr) { in GetRegion()
45 (void)memset_s(region, MAX_REGION_LENGTH, 0x0, MAX_REGION_LENGTH); in GetRegion()
46 if (GLOBAL_GetRegion(region, MAX_REGION_LENGTH) != 0) { in GetRegion()
47 ace_free(region); in GetRegion()
50 return region; in GetRegion()
74 char *region = GetRegion(); in GetLocale() local
75 if (region == nullptr) { in GetLocale()
79 JSI::SetStringProperty(result, "countryOrRegion", region); in GetLocale()
80 ace_free(region); in GetLocale()
/base/global/resmgr_lite/frameworks/resmgr_lite/test/unittest/lite/common/
Dglobal_test.cpp86 char region[10]; variable
92 ret = GLOBAL_GetRegion(region, 10);
94 ASSERT_EQ(std::string("US"), region);
100 ret = GLOBAL_GetRegion(region, 10);
102 ASSERT_EQ(std::string("US"), region);
108 ret = GLOBAL_GetRegion(region, 10);
110 ASSERT_EQ(std::string("US"), region);
116 ret = GLOBAL_GetRegion(region, 10);
118 ASSERT_EQ(std::string("US"), region);
Dtest_common.cpp69 ResConfig *CreateResConfig(const char *language, const char *script, const char *region) in CreateResConfig() argument
75 resConfig->SetLocaleInfo(language, script, region); in CreateResConfig()
Dtest_common.h40 ResConfig *CreateResConfig(const char *language, const char *script, const char *region);
/base/global/i18n_standard/frameworks/intl/include/
Dmeasure_data.h25 uint32_t GetMask(const std::string &region);
26 void GetDefaultPreferredUnit(const std::string &region, const std::string &type, std::vector<std::s…
27 void GetFallbackPreferredUnit(const std::string &region, const std::string &usage, std::vector<std:…
28 void GetRestPreferredUnit(const std::string &region, const std::string &usage, std::vector<std::str…
29 void GetPreferredUnit(const std::string &region, const std::string &usage, std::vector<std::string>…
Dlocale_config.h33 static bool SetSystemRegion(const std::string &region);
41 static bool IsSuggested(const std::string &language, const std::string &region);
44 static std::string GetDisplayRegion(const std::string &region, const std::string &displayLocale,
54 static bool IsValidRegion(const std::string &region);
91 …tatic std::string GetRegionChangeLocale(const std::string &languageTag, const std::string &region);
/base/global/i18n_lite/frameworks/i18n/src/
Dlocale_info.cpp60 region = NewArrayAndCopy(newRegion, regionLength); in Init()
77 if ((region != nullptr) && (LenCharArray(region) > 0)) { in InitIdstr()
78 idStr = idStr + "-" + region; in InitIdstr()
119 Init(o.language, o.script, o.region, status); in LocaleInfo()
134 I18nFree((void *)region); in FreeResource()
149 ret = CompareLocaleItem(region, other.region); in operator ==()
165 if (o.region != nullptr) { in operator =()
166 region = NewArrayAndCopy(o.region, strlen(o.region)); in operator =()
189 return region; in GetRegion()
275 if ((region != nullptr) && (LenCharArray(region) > 1)) { in GetMask()
[all …]
/base/global/i18n_standard/frameworks/intl/src/
Dmeasure_data.cpp291 uint32_t GetMask(const string &region) in GetMask() argument
293 uint32_t firstChar = (region.c_str()[0] - CHAR_OFFSET); in GetMask()
294 uint32_t secondChar = (region.c_str()[1] - CHAR_OFFSET); in GetMask()
298 void GetDefaultPreferredUnit(const string &region, const string &type, vector<string> &units) in GetDefaultPreferredUnit() argument
300 switch (GetMask(region)) { in GetDefaultPreferredUnit()
322 void GetFallbackPreferredUnit(const string &region, const string &usage, vector<string> &units) in GetFallbackPreferredUnit() argument
324 switch (GetMask(region)) { in GetFallbackPreferredUnit()
372 void GetRestPreferredUnit(const string &region, const string &usage, vector<string> &units) in GetRestPreferredUnit() argument
374 switch (GetMask(region)) { in GetRestPreferredUnit()
414 GetFallbackPreferredUnit(region, usage, units); in GetRestPreferredUnit()
[all …]
Dlocale_info.cpp59 region = locale.getCountry(); in LocaleInfo()
64 if (region.length() == REGION_LEN) { in LocaleInfo()
65 baseName += "-" + region; in LocaleInfo()
87 region = locale.getCountry(); in LocaleInfo()
107 if (!region.empty()) { in ComputeFinalLocaleTag()
108 finalLocaleTag += "-" + region; in ComputeFinalLocaleTag()
169 region = configs["region"]; in ParseConfigs()
205 return region; in GetRegion()
Dlocale_config.cpp398 bool LocaleConfig::SetSystemRegion(const string &region) in SetSystemRegion() argument
403 if (!IsValidRegion(region)) { in SetSystemRegion()
411 newLocale = GetRegionChangeLocale(tag, region); in SetSystemRegion()
416 icu::Locale temp("", region.c_str()); in SetSystemRegion()
473 bool LocaleConfig::IsValidRegion(const string &region) in IsValidRegion() argument
475 string::size_type size = region.size(); in IsValidRegion()
480 if ((region[i] > 'Z') || (region[i] < 'A')) { in IsValidRegion()
556 bool LocaleConfig::IsSuggested(const std::string &language, const std::string &region) in IsSuggested() argument
559 vector<string> countries { region }; in IsSuggested()
667 string LocaleConfig::GetRegionChangeLocale(const string &languageTag, const string &region) in GetRegionChangeLocale() argument
[all …]
/base/global/resmgr_lite/frameworks/resmgr_lite/src/
Dglobal.cpp59 std::string language, script, region; in GLOBAL_ConfigLanguage() local
76 region.assign(appLanguage + indexEnd + 1); in GLOBAL_ConfigLanguage()
77 g_resConfig->SetLocaleInfo(language.c_str(), script.c_str(), region.c_str()); in GLOBAL_ConfigLanguage()
80 region.assign(appLanguage + indexStart + 1); in GLOBAL_ConfigLanguage()
81 g_resConfig->SetLocaleInfo(language.c_str(), nullptr, region.c_str()); in GLOBAL_ConfigLanguage()
104 int32_t GLOBAL_GetRegion(char *region, uint8_t len) in GLOBAL_GetRegion() argument
110 if (region == nullptr || len == 0) { in GLOBAL_GetRegion()
113 if (strncpy_s(region, len, g_resConfig->GetLocaleInfo()->GetRegion(), in GLOBAL_GetRegion()
Dres_locale.cpp63 RState ResLocale::SetRegion(const char *region, size_t len) in SetRegion() argument
78 *(temp + i) = toupper(*(region + i)); in SetRegion()
112 const char *region, size_t regionLen) in Init() argument
122 r = this->SetRegion(region, regionLen); in Init()
266 const char *region, in BuildFromParts() argument
299 len = Utils::StrLen(region); in BuildFromParts()
301 if (LocaleMatcher::IsRegionTag(region, len)) { in BuildFromParts()
302 tempRegion = region; in BuildFromParts()
375 LocaleInfo *BuildFromParts(const char *language, const char *script, const char *region, RState &rS… in BuildFromParts() argument
394 len = Utils::StrLen(region); in BuildFromParts()
[all …]
/base/global/i18n_lite/interfaces/kits/i18n/include/
Dlocale_info.h63 LocaleInfo(const char *lang, const char *script, const char *region);
73 LocaleInfo(const char *lang, const char *region);
206 char *region = nullptr; variable
212 void Init(const char *lang, const char *script, const char *region, int &status);
/base/global/resmgr_standard/frameworks/resmgr/src/utils/
Dutils.cpp112 const char *region) in EncodeLocale() argument
116 uint16_t regionData = Utils::EncodeRegion(region); in EncodeLocale()
146 uint16_t Utils::EncodeRegion(const char *region) in EncodeRegion() argument
148 if (Utils::IsStrEmpty(region)) { in EncodeRegion()
151 if (region[0] >= '0' && region[0] <= '9') { in EncodeRegion()
152 return Utils::EncodeLanguageOrRegion(region, '0'); in EncodeRegion()
154 return Utils::EncodeLanguageOrRegion(region, 'A'); in EncodeRegion()
/base/global/resmgr_lite/frameworks/resmgr_lite/src/utils/
Dutils.cpp112 const char *region) in EncodeLocale() argument
116 uint16_t regionData = Utils::EncodeRegion(region); in EncodeLocale()
146 uint16_t Utils::EncodeRegion(const char *region) in EncodeRegion() argument
148 if (Utils::IsStrEmpty(region)) { in EncodeRegion()
151 if (region[0] >= '0' && region[0] <= '9') { in EncodeRegion()
152 return Utils::EncodeLanguageOrRegion(region, '0'); in EncodeRegion()
154 return Utils::EncodeLanguageOrRegion(region, 'A'); in EncodeRegion()
/base/global/resmgr_lite/frameworks/resmgr_lite/include/
Dres_locale.h58 …static ResLocale *BuildFromParts(const char *language, const char *script, const char *region, RSt…
77 RState SetRegion(const char *region, size_t len);
84 const char *region, size_t regionLen);
Dres_config.h29 virtual RState SetLocaleInfo(const char *language, const char *script, const char *region) = 0;
60 LocaleInfo *BuildFromParts(const char *language, const char *script, const char *region, RState &rS…
/base/global/resmgr_standard/frameworks/resmgr/include/
Dres_locale.h58 …static ResLocale *BuildFromParts(const char *language, const char *script, const char *region, RSt…
77 RState SetRegion(const char *region, size_t len);
84 const char *region, size_t regionLen);
/base/global/resmgr_standard/frameworks/resmgr/src/
Dres_locale.cpp63 RState ResLocale::SetRegion(const char *region, size_t len) in SetRegion() argument
78 *(temp + i) = toupper(*(region + i)); in SetRegion()
112 const char *region, size_t regionLen) in Init() argument
122 r = this->SetRegion(region, regionLen); in Init()
272 const char *region, in BuildFromParts() argument
305 len = Utils::StrLen(region); in BuildFromParts()
307 if (LocaleMatcher::IsRegionTag(region, len)) { in BuildFromParts()
308 tempRegion = region; in BuildFromParts()
384 Locale *BuildFromParts(const char *language, const char *script, const char *region, RState &rState) in BuildFromParts() argument
403 len = Utils::StrLen(region); in BuildFromParts()
[all …]
/base/global/resmgr_standard/frameworks/resmgr/include/utils/
Dutils.h45 static uint16_t EncodeRegion(const char *region);
51 const char *region);
/base/global/resmgr_lite/frameworks/resmgr_lite/include/utils/
Dutils.h45 static uint16_t EncodeRegion(const char *region);
51 const char *region);
/base/global/resmgr_standard/interfaces/innerkits/include/
Dres_config.h29 virtual RState SetLocaleInfo(const char *language, const char *script, const char *region) = 0;
64 EXPORT_FUNC Locale *BuildFromParts(const char *language, const char *script, const char *region, RS…
/base/hiviewdfx/hiview/base/include/
Dlogger.h30 #define DEFINE_LOG_LABEL(region, name) \ argument
31 static unsigned int logLabelDomain = region; \
/base/global/resmgr_standard/frameworks/resmgr/test/unittest/common/
Dtest_common.cpp72 ResConfig *CreateResConfig(const char *language, const char *script, const char *region) in CreateResConfig() argument
78 resConfig->SetLocaleInfo(language, script, region); in CreateResConfig()
Dtest_common.h40 ResConfig *CreateResConfig(const char *language, const char *script, const char *region);

12