您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ures_close函数代码示例

51自学网 2021-06-03 09:17:06
  C++
这篇教程C++ ures_close函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ures_close函数的典型用法代码示例。如果您正苦于以下问题:C++ ures_close函数的具体用法?C++ ures_close怎么用?C++ ures_close使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ures_close函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ures_initStackObject

ResourceBundle ResourceBundle::getNext(UErrorCode& status) {    UResourceBundle r;    ures_initStackObject(&r);    ures_getNextResource(fResource, &r, &status);    ResourceBundle res(&r, status);    if (U_SUCCESS(status)) {        ures_close(&r);    }    return res;}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:11,


示例2: getOlsonMeta

static UBool getOlsonMeta() {    if (OLSON_ZONE_COUNT == 0) {        UErrorCode ec = U_ZERO_ERROR;        UResourceBundle *top = ures_openDirect(0, kZONEINFO, &ec);        if (U_SUCCESS(ec)) {            getOlsonMeta(top);        }        ures_close(top);    }    return (OLSON_ZONE_COUNT > 0);}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:11,


示例3: ures_open

const UChar *getErrorName(UErrorCode errorNumber) {    UErrorCode status = U_ZERO_ERROR;    int32_t len = 0;    UResourceBundle *error = ures_open(currdir, locale, &status);    UResourceBundle *errorcodes = ures_getByKey(error, "errorcodes", NULL, &status);    const UChar *result = ures_getStringByIndex(errorcodes, errorNumber, &len, &status);    ures_close(errorcodes);    ures_close(error);    if(U_SUCCESS(status)) {        return result;    } else {        return baderror;    }}
开发者ID:andrewleech,项目名称:firebird,代码行数:20,


示例4: hasCollationElements

UBool hasCollationElements(const char *locName) {  UErrorCode status = U_ZERO_ERROR;  UResourceBundle *ColEl = NULL;  UResourceBundle *loc = ures_open(U_ICUDATA_COLL, locName, &status);  if(U_SUCCESS(status)) {    status = U_ZERO_ERROR;    ColEl = ures_getByKey(loc, "collations", ColEl, &status);    if(status == U_ZERO_ERROR) { /* do the test - there are real elements */      ures_close(ColEl);      ures_close(loc);      return TRUE;    }    ures_close(ColEl);    ures_close(loc);  }  return FALSE;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:20,


示例5: U_DEBUG_TZ_MSG

const UnicodeString U_EXPORT2TimeZone::getEquivalentID(const UnicodeString& id, int32_t index) {    U_DEBUG_TZ_MSG(("gEI(%d)/n", index));    UnicodeString result;    UErrorCode ec = U_ZERO_ERROR;    UResourceBundle res;    ures_initStackObject(&res);    UResourceBundle *top = openOlsonResource(id, res, ec);    int32_t zone = -1;    if (U_SUCCESS(ec)) {        int32_t size = ures_getSize(&res);        if (size == 4 || size == 6) {            UResourceBundle r;            ures_initStackObject(&r);            ures_getByIndex(&res, size-1, &r, &ec);            const int32_t* v = ures_getIntVector(&r, &size, &ec);            if (index >= 0 && index < size && getOlsonMeta()) {                zone = v[index];            }            ures_close(&r);        }    }    ures_close(&res);    if (zone >= 0) {        UResourceBundle *ares = ures_getByKey(top, kNAMES, NULL, &ec); // dereference Zones section        if (U_SUCCESS(ec)) {            int32_t idLen = 0;            const UChar* id = ures_getStringByIndex(ares, zone, &idLen, &ec);            result.fastCopyFrom(UnicodeString(TRUE, id, idLen));            U_DEBUG_TZ_MSG(("gei(%d) -> %d, len%d, %s/n", index, zone, result.length(), u_errorName(ec)));        }        ures_close(ares);    }    ures_close(top);#if defined(U_DEBUG_TZ)    if(result.length() ==0) {      U_DEBUG_TZ_MSG(("equiv [__, #%d] -> 0 (%s)/n", index, u_errorName(ec)));    }#endif    return result;}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:41,


示例6: getCurrencySymbolNative

static jstring getCurrencySymbolNative(JNIEnv* env, jclass clazz,         jstring locale, jstring currencyCode) {    // LOGI("ENTER getCurrencySymbolNative");    UErrorCode status = U_ZERO_ERROR;    const char *locName = env->GetStringUTFChars(locale, NULL);    UResourceBundle *root = ures_open(NULL, locName, &status);    env->ReleaseStringUTFChars(locale, locName);    if(U_FAILURE(status)) {        return NULL;    }    UResourceBundle *rootElems = ures_getByKey(root, "Currencies", NULL, &status);    if(U_FAILURE(status)) {        ures_close(root);        return NULL;    }    const char *currName = env->GetStringUTFChars(currencyCode, NULL);    UResourceBundle *currencyElems = ures_getByKey(rootElems, currName, NULL, &status);    env->ReleaseStringUTFChars(currencyCode, currName);    if(U_FAILURE(status)) {        ures_close(rootElems);        ures_close(root);        return NULL;    }    int currSymbL;    const jchar *currSymbU = ures_getStringByIndex(currencyElems, 0, &currSymbL, &status);    if(U_FAILURE(status)) {        ures_close(currencyElems);        ures_close(rootElems);        ures_close(root);        return NULL;    }    ures_close(currencyElems);    ures_close(rootElems);    ures_close(root);    if(currSymbL == 0) {        return NULL;    }    return env->NewString(currSymbU, currSymbL);}
开发者ID:llnull,项目名称:platform_dalvik,代码行数:46,


示例7: ures_openDirect

const UChar*TimeZone::getRegion(const UnicodeString& id) {    const UChar *result = WORLD;    UErrorCode ec = U_ZERO_ERROR;    UResourceBundle *rb = ures_openDirect(NULL, kZONEINFO, &ec);    // resolve zone index by name    UResourceBundle *res = ures_getByKey(rb, kNAMES, NULL, &ec);    int32_t idx = findInStringArray(res, id, ec);    // get region mapping    ures_getByKey(rb, kREGIONS, res, &ec);    const UChar *tmp = ures_getStringByIndex(res, idx, NULL, &ec);    if (U_SUCCESS(ec)) {        result = tmp;    }    ures_close(res);    ures_close(rb);    return result;}
开发者ID:hihihippp,项目名称:build-couchdb-1,代码行数:22,


示例8: initCDFLocaleStyleData

// initCDFLocaleStyleData loads formatting data for a particular style.// decimalFormatBundle is the "decimalFormat" resource bundle in CLDR.// Loaded data stored in result.static void initCDFLocaleStyleData(const UResourceBundle* decimalFormatBundle, CDFLocaleStyleData* result, UErrorCode& status) {  if (U_FAILURE(status)) {    return;  }  // Iterate through all the powers of 10.  int32_t size = ures_getSize(decimalFormatBundle);  UResourceBundle* power10 = NULL;  for (int32_t i = 0; i < size; ++i) {    power10 = ures_getByIndex(decimalFormatBundle, i, power10, &status);    if (U_FAILURE(status)) {      ures_close(power10);      return;    }    populatePower10(power10, result, status);    if (U_FAILURE(status)) {      ures_close(power10);      return;    }  }  ures_close(power10);  fillInMissing(result);}
开发者ID:icu-project,项目名称:icu4c,代码行数:25,


示例9: _getStringOrCopyKey

static int32_t_getStringOrCopyKey(const char *path, const char *locale,                    const char *tableKey,                     const char* subTableKey,                    const char *itemKey,                    const char *substitute,                    UChar *dest, int32_t destCapacity,                    UErrorCode *pErrorCode) {    const UChar *s = NULL;    int32_t length = 0;    if(itemKey==NULL) {        /* top-level item: normal resource bundle access */        UResourceBundle *rb;        rb=ures_open(path, locale, pErrorCode);        if(U_SUCCESS(*pErrorCode)) {            s=ures_getStringByKey(rb, tableKey, &length, pErrorCode);            /* see comment about closing rb near "return item;" in _res_getTableStringWithFallback() */            ures_close(rb);        }    } else {        /* Language code should not be a number. If it is, set the error code. */        if (!uprv_strncmp(tableKey, "Languages", 9) && uprv_strtol(itemKey, NULL, 10)) {            *pErrorCode = U_MISSING_RESOURCE_ERROR;        } else {            /* second-level item, use special fallback */            s=uloc_getTableStringWithFallback(path, locale,                                               tableKey,                                                subTableKey,                                               itemKey,                                               &length,                                               pErrorCode);        }    }    if(U_SUCCESS(*pErrorCode)) {        int32_t copyLength=uprv_min(length, destCapacity);        if(copyLength>0 && s != NULL) {            u_memcpy(dest, s, copyLength);        }    } else {        /* no string from a resource bundle: convert the substitute */        length=(int32_t)uprv_strlen(substitute);        u_charsToUChars(substitute, dest, uprv_min(length, destCapacity));        *pErrorCode=U_USING_DEFAULT_WARNING;    }    return u_terminateUChars(dest, destCapacity, length, pErrorCode);}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:51,


示例10: ures_openDirect

NumberingSystem* U_EXPORT2NumberingSystem::createInstanceByName(const char *name, UErrorCode& status) {         UResourceBundle *numberingSystemsInfo = NULL;     UResourceBundle *nsTop, *nsCurrent;     const UChar* description = NULL;     int32_t radix = 10;     int32_t algorithmic = 0;     int32_t len;     numberingSystemsInfo = ures_openDirect(NULL,gNumberingSystems, &status);     nsCurrent = ures_getByKey(numberingSystemsInfo,gNumberingSystems,NULL,&status);     nsTop = ures_getByKey(nsCurrent,name,NULL,&status);     description = ures_getStringByKey(nsTop,gDesc,&len,&status);	 ures_getByKey(nsTop,gRadix,nsCurrent,&status);     radix = ures_getInt(nsCurrent,&status);     ures_getByKey(nsTop,gAlgorithmic,nsCurrent,&status);     algorithmic = ures_getInt(nsCurrent,&status);     UBool isAlgorithmic = ( algorithmic == 1 );     UnicodeString nsd;     nsd.setTo(description);	 ures_close(nsCurrent);	 ures_close(nsTop);     ures_close(numberingSystemsInfo);     if (U_FAILURE(status)) {         status = U_UNSUPPORTED_ERROR;         return NULL;     }     NumberingSystem* ns = NumberingSystem::createInstance(radix,isAlgorithmic,nsd,status);     ns->setName(name);     return ns;}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:38,


示例11: sizeof

NumberingSystem* U_EXPORT2NumberingSystem::createInstance(const Locale & inLocale, UErrorCode& status) {    if (U_FAILURE(status)) {        return NULL;    }     char buffer[ULOC_KEYWORDS_CAPACITY];    int32_t count = inLocale.getKeywordValue("numbers",buffer, sizeof(buffer),status);    if ( count > 0 ) { // @numbers keyword was specified in the locale        buffer[count] = '/0'; // Make sure it is null terminated.        return NumberingSystem::createInstanceByName(buffer,status);    } else { // Find the default numbering system for this locale.        UResourceBundle *resource = ures_open(NULL, inLocale.getName(), &status);        UResourceBundle *numberElementsRes = ures_getByKey(resource,gNumberElements,NULL,&status);        const UChar *defaultNSName =            ures_getStringByKeyWithFallback(numberElementsRes, gDefault, &count, &status);        ures_close(numberElementsRes);        ures_close(resource);        if (U_FAILURE(status)) {            status = U_USING_FALLBACK_WARNING;            NumberingSystem *ns = new NumberingSystem();            return ns;        }         if ( count > 0 && count < ULOC_KEYWORDS_CAPACITY ) { // Default numbering system found           u_UCharsToChars(defaultNSName,buffer,count);            buffer[count] = '/0'; // Make sure it is null terminated.           return NumberingSystem::createInstanceByName(buffer,status);        } else {            status = U_USING_FALLBACK_WARNING;            NumberingSystem *ns = new NumberingSystem();            return ns;        }            }}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:38,


示例12: TZEnumeration

    TZEnumeration(const char* country) : map(NULL), len(0), pos(0) {        if (!getOlsonMeta()) {            return;        }        char key[] = {0, 0, 0, 0,0, 0, 0,0, 0, 0,0}; // e.g., "US", or "Default" for no country        if (country)  {          uprv_strncat(key, country, 2);        } else {          uprv_strcpy(key, kDEFAULT);        }        UErrorCode ec = U_ZERO_ERROR;        UResourceBundle *top = ures_openDirect(0, kZONEINFO, &ec);        top = ures_getByKey(top, kREGIONS, top, &ec); // dereference 'Regions' section        if (U_SUCCESS(ec)) {            UResourceBundle res;            ures_initStackObject(&res);            ures_getByKey(top, key, &res, &ec);            // The list of zones is a list of integers, from 0..n-1,            // where n is the total number of system zones.            const int32_t* v = ures_getIntVector(&res, &len, &ec);            if (U_SUCCESS(ec)) {                U_ASSERT(len > 0);                map = (int32_t*)uprv_malloc(sizeof(int32_t) * len);                if (map != 0) {                    for (uint16_t i=0; i<len; ++i) {                        U_ASSERT(v[i] >= 0 && v[i] < OLSON_ZONE_COUNT);                        map[i] = v[i];                    }                }            } else {              U_DEBUG_TZ_MSG(("Failed to load tz for region %s: %s/n", country, u_errorName(ec)));            }            ures_close(&res);        }        ures_close(top);    }
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:38,


示例13: ruleSets

RuleBasedNumberFormat::RuleBasedNumberFormat(URBNFRuleSetTag tag, const Locale& alocale, UErrorCode& status)  : ruleSets(NULL)  , ruleSetDescriptions(NULL)  , numRuleSets(0)  , defaultRuleSet(NULL)  , locale(alocale)  , collator(NULL)  , decimalFormatSymbols(NULL)  , lenient(FALSE)  , lenientParseRules(NULL)  , localizations(NULL){    if (U_FAILURE(status)) {        return;    }    const char* rules_tag = "RBNFRules";    const char* fmt_tag = "";    switch (tag) {    case URBNF_SPELLOUT: fmt_tag = "SpelloutRules"; break;    case URBNF_ORDINAL: fmt_tag = "OrdinalRules"; break;    case URBNF_DURATION: fmt_tag = "DurationRules"; break;    case URBNF_NUMBERING_SYSTEM: fmt_tag = "NumberingSystemRules"; break;    default: status = U_ILLEGAL_ARGUMENT_ERROR; return;    }    // TODO: read localization info from resource    LocalizationInfo* locinfo = NULL;    UResourceBundle* nfrb = ures_open(U_ICUDATA_RBNF, locale.getName(), &status);    if (U_SUCCESS(status)) {        setLocaleIDs(ures_getLocaleByType(nfrb, ULOC_VALID_LOCALE, &status),                     ures_getLocaleByType(nfrb, ULOC_ACTUAL_LOCALE, &status));        UResourceBundle* rbnfRules = ures_getByKeyWithFallback(nfrb, rules_tag, NULL, &status);        if (U_FAILURE(status)) {            ures_close(nfrb);        }        UResourceBundle* ruleSets = ures_getByKeyWithFallback(rbnfRules, fmt_tag, NULL, &status);        if (U_FAILURE(status)) {            ures_close(rbnfRules);            ures_close(nfrb);            return;        }        UnicodeString desc;        while (ures_hasNext(ruleSets)) {           desc.append(ures_getNextUnicodeString(ruleSets,NULL,&status));        }        UParseError perror;        init (desc, locinfo, perror, status);        ures_close(ruleSets);        ures_close(rbnfRules);    }    ures_close(nfrb);}
开发者ID:thlorenz,项目名称:chromium-deps-icu52,代码行数:58,


示例14: ulocdata_getMeasurementSystem

U_CAPI UMeasurementSystem U_EXPORT2ulocdata_getMeasurementSystem(const char *localeID, UErrorCode *status){    UResourceBundle* bundle=NULL;    UResourceBundle* measurement=NULL;    UMeasurementSystem system = UMS_LIMIT;    if(status == NULL || U_FAILURE(*status)){        return system;    }    bundle = measurementDataBundleForLocale(localeID, status);    measurement = ures_getByKeyWithFallback(bundle, MEASUREMENT_SYSTEM, NULL, status);    system = (UMeasurementSystem) ures_getInt(measurement, status);    ures_close(bundle);    ures_close(measurement);    return system;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:23,


示例15: getAmPmMarkers

static jobjectArray getAmPmMarkers(JNIEnv *env, UResourceBundle *gregorian) {        jobjectArray amPmMarkers;    jstring pmU, amU;    UErrorCode status = U_ZERO_ERROR;    UResourceBundle *gregorianElems;    gregorianElems = ures_getByKey(gregorian, "AmPmMarkers", NULL, &status);    if(U_FAILURE(status)) {        return NULL;    }    int lengthAm, lengthPm;    ures_resetIterator(gregorianElems);    const jchar* am = ures_getStringByIndex(gregorianElems, 0, &lengthAm, &status);    const jchar* pm = ures_getStringByIndex(gregorianElems, 1, &lengthPm, &status);    if(U_FAILURE(status)) {        ures_close(gregorianElems);        return NULL;    }        amPmMarkers = env->NewObjectArray(2, string_class, NULL);    amU = env->NewString(am, lengthAm);    env->SetObjectArrayElement(amPmMarkers, 0, amU);    env->DeleteLocalRef(amU);    pmU = env->NewString(pm, lengthPm);    env->SetObjectArrayElement(amPmMarkers, 1, pmU);    env->DeleteLocalRef(pmU);    ures_close(gregorianElems);    return amPmMarkers;}
开发者ID:llnull,项目名称:platform_dalvik,代码行数:37,


示例16: ures_open

const CompactTrieDictionary *ICULanguageBreakFactory::loadDictionaryFor(UScriptCode script, int32_t /*breakType*/) {    UErrorCode status = U_ZERO_ERROR;    // Open root from brkitr tree.    char dictnbuff[256];    char ext[4]={'/0'};    UResourceBundle *b = ures_open(U_ICUDATA_BRKITR, "", &status);    b = ures_getByKeyWithFallback(b, "dictionaries", b, &status);    b = ures_getByKeyWithFallback(b, uscript_getShortName(script), b, &status);    int32_t dictnlength = 0;    const UChar *dictfname = ures_getString(b, &dictnlength, &status);    if (U_SUCCESS(status) && (size_t)dictnlength >= sizeof(dictnbuff)) {        dictnlength = 0;        status = U_BUFFER_OVERFLOW_ERROR;    }    if (U_SUCCESS(status) && dictfname) {        UChar* extStart=u_strchr(dictfname, 0x002e);        int len = 0;        if(extStart!=NULL){            len = extStart-dictfname;            u_UCharsToChars(extStart+1, ext, sizeof(ext)); // nul terminates the buff            u_UCharsToChars(dictfname, dictnbuff, len);        }        dictnbuff[len]=0; // nul terminate    }    ures_close(b);    UDataMemory *file = udata_open(U_ICUDATA_BRKITR, ext, dictnbuff, &status);    if (U_SUCCESS(status)) {        const CompactTrieDictionary *dict = new CompactTrieDictionary(            file, status);        if (U_SUCCESS(status) && dict == NULL) {            status = U_MEMORY_ALLOCATION_ERROR;        }        if (U_FAILURE(status)) {            delete dict;            dict = NULL;        }        return dict;    } else if (dictfname != NULL){        //create dummy dict if dictionary filename not valid        UChar c = 0x0020;        status = U_ZERO_ERROR;        MutableTrieDictionary *mtd = new MutableTrieDictionary(c, status, TRUE);        mtd->addWord(&c, 1, status, 1);        return new CompactTrieDictionary(*mtd, status);      }    return NULL;}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:49,


示例17: loadData

TZNames*TZNames::createInstance(UResourceBundle* rb, const char* key, const UnicodeString& tzID) {    if (rb == NULL || key == NULL || *key == 0) {        return NULL;    }    const UChar** names = loadData(rb, key);    const UChar* locationName = NULL;    UChar* locationNameOwned = NULL;    UErrorCode status = U_ZERO_ERROR;    int32_t len = 0;    UResourceBundle* table = ures_getByKeyWithFallback(rb, key, NULL, &status);    locationName = ures_getStringByKeyWithFallback(table, gEcTag, &len, &status);    // ignore missing resource here    status = U_ZERO_ERROR;    ures_close(table);    if (locationName == NULL) {        UnicodeString tmpName;        int32_t tmpNameLen = 0;        TimeZoneNamesImpl::getDefaultExemplarLocationName(tzID, tmpName);        tmpNameLen = tmpName.length();        if (tmpNameLen > 0) {            locationNameOwned = (UChar*) uprv_malloc(sizeof(UChar) * (tmpNameLen + 1));            if (locationNameOwned) {                tmpName.extract(locationNameOwned, tmpNameLen + 1, status);                locationName = locationNameOwned;            }        }    }    TZNames* tznames = NULL;    if (locationName != NULL || names != NULL) {        tznames = new TZNames(names);        if (tznames == NULL) {            if (locationNameOwned) {                uprv_free(locationNameOwned);            }        }        tznames->fLocationName = locationName;        tznames->fLocationNameOwned = locationNameOwned;    }    return tznames;}
开发者ID:00zhengfu00,项目名称:third_party,代码行数:49,


示例18: loadListFormatInternal

static ListFormatInternal* loadListFormatInternal(        const Locale& locale, const char * style, UErrorCode& errorCode) {    UResourceBundle* rb = ures_open(NULL, locale.getName(), &errorCode);    if (U_FAILURE(errorCode)) {        ures_close(rb);        return NULL;    }    rb = ures_getByKeyWithFallback(rb, "listPattern", rb, &errorCode);    rb = ures_getByKeyWithFallback(rb, style, rb, &errorCode);    // TODO(Travis Keep): This is a hack until fallbacks can be added for    // listPattern/duration and listPattern/duration-narrow in CLDR.    if (errorCode == U_MISSING_RESOURCE_ERROR) {        errorCode = U_ZERO_ERROR;        rb = ures_getByKeyWithFallback(rb, "standard", rb, &errorCode);    }    if (U_FAILURE(errorCode)) {        ures_close(rb);        return NULL;    }    UnicodeString two, start, middle, end;    getStringByKey(rb, "2", two, errorCode);    getStringByKey(rb, "start", start, errorCode);    getStringByKey(rb, "middle", middle, errorCode);    getStringByKey(rb, "end", end, errorCode);    ures_close(rb);    if (U_FAILURE(errorCode)) {        return NULL;    }    ListFormatInternal* result = new ListFormatInternal(two, start, middle, end);    if (result == NULL) {        errorCode = U_MEMORY_ALLOCATION_ERROR;        return NULL;    }    return result;}
开发者ID:CoherentLabs,项目名称:CoherentWebCoreDependencies,代码行数:36,


示例19: u_getDataVersion

U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status) {    UResourceBundle *icudatares = NULL;    if (U_FAILURE(*status)) {        return;    }    if (dataVersionFillin != NULL) {        icudatares = ures_openDirect(NULL, U_ICU_VERSION_BUNDLE , status);        if (U_SUCCESS(*status)) {            ures_getVersionByKey(icudatares, U_ICU_DATA_KEY, dataVersionFillin, status);        }        ures_close(icudatares);    }}
开发者ID:AceRiddle,项目名称:node,代码行数:15,


示例20: ures_openDirect

UnicodeString&TimeZone::dereferOlsonLink(const UnicodeString& linkTo, UnicodeString& linkFrom) {    UErrorCode ec = U_ZERO_ERROR;    linkFrom.remove();    UResourceBundle *top = ures_openDirect(0, kZONEINFO, &ec);    UResourceBundle *res = getZoneByName(top, linkTo, NULL, ec);    if (U_SUCCESS(ec)) {        if (ures_getSize(res) == 1) {            int32_t deref = ures_getInt(res, &ec);            UResourceBundle *nres = ures_getByKey(top, kNAMES, NULL, &ec); // dereference Names section            int32_t len;            const UChar* tmp = ures_getStringByIndex(nres, deref, &len, &ec);            if (U_SUCCESS(ec)) {                linkFrom.setTo(tmp, len);            }            ures_close(nres);        } else {            linkFrom.setTo(linkTo);        }    }    ures_close(res);    ures_close(top);    return linkFrom;}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:24,


示例21: ures_close

voidTimeZoneNamesImpl::cleanup() {    if (fZoneStrings != NULL) {        ures_close(fZoneStrings);        fZoneStrings = NULL;    }    if (fMZNamesMap != NULL) {        uhash_close(fMZNamesMap);        fMZNamesMap = NULL;    }    if (fTZNamesMap != NULL) {        uhash_close(fTZNamesMap);        fTZNamesMap = NULL;    }}
开发者ID:00zhengfu00,项目名称:third_party,代码行数:15,


示例22: hasCollationElements

UBool hasCollationElements(const char *locName) {  UErrorCode status = U_ZERO_ERROR;  UResourceBundle *loc = ures_open(U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "coll", locName, &status);;  if(U_SUCCESS(status)) {    status = U_ZERO_ERROR;    loc = ures_getByKey(loc, "collations", loc, &status);    ures_close(loc);    if(status == U_ZERO_ERROR) { /* do the test - there are real elements */      return TRUE;    }  }  return FALSE;}
开发者ID:icu-project,项目名称:icu4c,代码行数:16,


示例23: getID

 UBool getID(int32_t i) {     UErrorCode ec = U_ZERO_ERROR;     int32_t idLen = 0;     const UChar* id = NULL;     UResourceBundle *top = ures_openDirect(0, kZONEINFO, &ec);     top = ures_getByKey(top, kNAMES, top, &ec); // dereference Zones section     id = ures_getStringByIndex(top, i, &idLen, &ec);     if(U_FAILURE(ec)) {         unistr.truncate(0);     }     else {         unistr.fastCopyFrom(UnicodeString(TRUE, id, idLen));     }     ures_close(top);     return U_SUCCESS(ec); }
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:16,


示例24: ures_openDirect

UnicodeString& U_EXPORT2ZoneMeta::getZoneIdByMetazone(const UnicodeString &mzid, const UnicodeString &region, UnicodeString &result) {    UErrorCode status = U_ZERO_ERROR;    const UChar *tzid = NULL;    int32_t tzidLen = 0;    char keyBuf[ZID_KEY_MAX + 1];    int32_t keyLen = 0;    if (mzid.isBogus() || mzid.length() > ZID_KEY_MAX) {        result.setToBogus();        return result;    }    keyLen = mzid.extract(0, mzid.length(), keyBuf, ZID_KEY_MAX + 1, US_INV);    keyBuf[keyLen] = 0;    UResourceBundle *rb = ures_openDirect(NULL, gMetaZones, &status);    ures_getByKey(rb, gMapTimezonesTag, rb, &status);    ures_getByKey(rb, keyBuf, rb, &status);    if (U_SUCCESS(status)) {        // check region mapping        if (region.length() == 2 || region.length() == 3) {            keyLen = region.extract(0, region.length(), keyBuf, ZID_KEY_MAX + 1, US_INV);            keyBuf[keyLen] = 0;            tzid = ures_getStringByKey(rb, keyBuf, &tzidLen, &status);            if (status == U_MISSING_RESOURCE_ERROR) {                status = U_ZERO_ERROR;            }        }        if (U_SUCCESS(status) && tzid == NULL) {            // try "001"            tzid = ures_getStringByKey(rb, gWorldTag, &tzidLen, &status);        }    }    ures_close(rb);    if (tzid == NULL) {        result.setToBogus();    } else {        result.setTo(tzid, tzidLen);    }    return result;}
开发者ID:basti1302,项目名称:node,代码行数:45,


示例25: ures_close

ResourceBundle& ResourceBundle::operator=(const ResourceBundle& other){    if(this == &other) {        return *this;    }    if(fResource != 0) {        ures_close(fResource);        fResource = NULL;    }    UErrorCode status = U_ZERO_ERROR;    if (other.fResource) {        fResource = ures_copyResb(0, other.fResource, &status);    } else {        /* Copying a bad resource bundle */        fResource = NULL;    }    return *this;}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:18,


示例26: ures_getByIndex

UBool RBTestData::nextCase(const DataMap *& nextCase, UErrorCode &status){  UErrorCode intStatus = U_ZERO_ERROR;  UResourceBundle *currCase = ures_getByIndex(fCases, fCurrentCase++, NULL, &intStatus);  if(U_SUCCESS(intStatus)) {    if(fCurrCase == NULL) {      fCurrCase = new RBDataMap(fHeaders, currCase, status);    } else {      ((RBDataMap *)fCurrCase)->init(fHeaders, currCase, status);    }    ures_close(currCase);    nextCase = fCurrCase;    return TRUE;  } else {    nextCase = NULL;    return FALSE;  }}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:18,


示例27: ulocdata_getMeasurementSystem

U_CAPI UMeasurementSystem U_EXPORT2ulocdata_getMeasurementSystem(const char *localeID, UErrorCode *status){    UResourceBundle* measurement=NULL;    UMeasurementSystem system = UMS_LIMIT;    if(status == NULL || U_FAILURE(*status)){        return system;    }    measurement = measurementTypeBundleForLocale(localeID, MEASUREMENT_SYSTEM, status);    system = (UMeasurementSystem) ures_getInt(measurement, status);    ures_close(measurement);    return system;}
开发者ID:JoeDoyle23,项目名称:node,代码行数:18,



注:本文中的ures_close函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ures_getByKey函数代码示例
C++ ureg_writemask函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。