本文整理汇总了C++中Locale::getDisplayCountry方法的典型用法代码示例。如果您正苦于以下问题:C++ Locale::getDisplayCountry方法的具体用法?C++ Locale::getDisplayCountry怎么用?C++ Locale::getDisplayCountry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::getDisplayCountry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLocale
extern "C" jstring Java_libcore_icu_ICU_getDisplayCountryNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) {
Locale loc = getLocale(env, locale);
Locale targetLoc = getLocale(env, targetLocale);
UnicodeString str;
targetLoc.getDisplayCountry(loc, str);
return env->NewString(str.getBuffer(), str.length());
}
示例2: formatErrorMessage
void formatErrorMessage(UErrorCode &realStatus, const UnicodeString& pattern, const Locale& theLocale,
UErrorCode inStatus0, /* statusString 1 */ const Locale &inCountry2, double currency3, // these numbers are the message arguments.
UnicodeString &result)
{
if(U_FAILURE(realStatus))
return; // you messed up
UnicodeString errString1(u_errorName(inStatus0));
UnicodeString countryName2;
inCountry2.getDisplayCountry(theLocale,countryName2);
Formattable myArgs[] = {
Formattable((int32_t)inStatus0), // inStatus0 {0}
Formattable(errString1), // statusString1 {1}
Formattable(countryName2), // inCountry2 {2}
Formattable(currency3)// currency3 {3,number,currency}
};
MessageFormat *fmt = new MessageFormat("MessageFormat's API is broken!!!!!!!!!!!",realStatus);
fmt->setLocale(theLocale);
fmt->applyPattern(pattern, realStatus);
if (U_FAILURE(realStatus)) {
delete fmt;
return;
}
FieldPosition ignore = 0;
fmt->format(myArgs,4,result,ignore,realStatus);
delete fmt;
}
示例3: getDisplayCountryNative
static jstring getDisplayCountryNative(JNIEnv* env, jclass clazz,
jstring targetLocale, jstring locale) {
Locale loc = getLocale(env, locale);
Locale targetLoc = getLocale(env, targetLocale);
UnicodeString str;
targetLoc.getDisplayCountry(loc, str);
return env->NewString(str.getBuffer(), str.length());
}
示例4: getDisplayCountryNative
static jstring getDisplayCountryNative(JNIEnv* env, jclass clazz,
jstring targetLocale, jstring locale) {
// LOGI("ENTER getDisplayCountryNative");
UErrorCode status = U_ZERO_ERROR;
Locale loc = getLocale(env, locale);
Locale targetLoc = getLocale(env, targetLocale);
UnicodeString string;
targetLoc.getDisplayCountry(loc, string);
jstring result = getJStringFromUnicodeString(env, string);
return result;
}