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

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

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

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

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

示例1: fSpoofImpl

ConfusabledataBuilder::ConfusabledataBuilder(SpoofImpl *spImpl, UErrorCode &status) :    fSpoofImpl(spImpl),    fInput(NULL),    fSLTable(NULL),    fSATable(NULL),    fMLTable(NULL),    fMATable(NULL),    fKeySet(NULL),    fKeyVec(NULL),    fValueVec(NULL),    fStringTable(NULL),    fStringLengthsTable(NULL),    stringPool(NULL),    fParseLine(NULL),    fParseHexNum(NULL),    fLineNum(0){    if (U_FAILURE(status)) {        return;    }    fSLTable    = uhash_open(uhash_hashLong, uhash_compareLong, NULL, &status);    fSATable    = uhash_open(uhash_hashLong, uhash_compareLong, NULL, &status);    fMLTable    = uhash_open(uhash_hashLong, uhash_compareLong, NULL, &status);    fMATable    = uhash_open(uhash_hashLong, uhash_compareLong, NULL, &status);    fKeySet     = new UnicodeSet();    fKeyVec     = new UVector(status);    fValueVec   = new UVector(status);    stringPool = new SPUStringPool(status);}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:29,


示例2: initCache

U_CDECL_END/** Initializes the cache for resources */static voidinitCache(UErrorCode * status){	UBool makeCache;	UMTX_CHECK(&usprepMutex, (SHARED_DATA_HASHTABLE ==  NULL), makeCache);	if (makeCache)	{		UHashtable * newCache = uhash_open(hashEntry, compareEntries, NULL, status);		if (U_SUCCESS(*status))		{			umtx_lock(&usprepMutex);			if (SHARED_DATA_HASHTABLE == NULL)			{				SHARED_DATA_HASHTABLE = newCache;				ucln_common_registerCleanup(UCLN_COMMON_USPREP, usprep_cleanup);				newCache = NULL;			}			umtx_unlock(&usprepMutex);		}		if (newCache != NULL)		{			uhash_close(newCache);		}	}}
开发者ID:Botyto,项目名称:Core,代码行数:29,


示例3: UMTX_CHECK

 /*   udata_getCacheHashTable() *     Get the hash table used to store the data cache entries. *     Lazy create it if it doesn't yet exist. */static UHashtable *udata_getHashTable() {    UErrorCode   err = U_ZERO_ERROR;    UBool        cacheIsInitialized;    UHashtable  *tHT = NULL;    UMTX_CHECK(NULL, (gCommonDataCache != NULL), cacheIsInitialized);    if (cacheIsInitialized) {        return gCommonDataCache;    }    tHT = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &err);    /* Check for null pointer. */    if (tHT == NULL) {    	return NULL; /* TODO:  Handle this error better. */    }    uhash_setValueDeleter(tHT, DataCacheElement_deleter);    umtx_lock(NULL);    if (gCommonDataCache == NULL) {        gCommonDataCache = tHT;        tHT = NULL;        ucln_common_registerCleanup(UCLN_COMMON_UDATA, udata_cleanup);    }    umtx_unlock(NULL);    if (tHT != NULL) {        uhash_close(tHT);    }    if (U_FAILURE(err)) {        return NULL;      /* TODO:  handle this error better.  */    }    return gCommonDataCache;}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:38,


示例4: initAvailableMetaZoneIDs

static void U_CALLCONV initAvailableMetaZoneIDs () {    U_ASSERT(gMetaZoneIDs == NULL);    U_ASSERT(gMetaZoneIDTable == NULL);    ucln_i18n_registerCleanup(UCLN_I18N_ZONEMETA, zoneMeta_cleanup);    UErrorCode status = U_ZERO_ERROR;    gMetaZoneIDTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, &status);    if (U_FAILURE(status) || gMetaZoneIDTable == NULL) {        gMetaZoneIDTable = NULL;        return;    }    uhash_setKeyDeleter(gMetaZoneIDTable, uprv_deleteUObject);    // No valueDeleter, because the vector maintain the value objects    gMetaZoneIDs = new UVector(NULL, uhash_compareUChars, status);    if (U_FAILURE(status) || gMetaZoneIDs == NULL) {        gMetaZoneIDs = NULL;        uhash_close(gMetaZoneIDTable);        gMetaZoneIDTable = NULL;        return;    }    gMetaZoneIDs->setDeleter(uprv_free);    UResourceBundle *rb = ures_openDirect(NULL, gMetaZones, &status);    UResourceBundle *bundle = ures_getByKey(rb, gMapTimezonesTag, NULL, &status);    UResourceBundle res;    ures_initStackObject(&res);    while (U_SUCCESS(status) && ures_hasNext(bundle)) {        ures_getNextResource(bundle, &res, &status);        if (U_FAILURE(status)) {            break;        }        const char *mzID = ures_getKey(&res);        int32_t len = uprv_strlen(mzID);        UChar *uMzID = (UChar*)uprv_malloc(sizeof(UChar) * (len + 1));        if (uMzID == NULL) {            status = U_MEMORY_ALLOCATION_ERROR;            break;        }        u_charsToUChars(mzID, uMzID, len);        uMzID[len] = 0;        UnicodeString *usMzID = new UnicodeString(uMzID);        if (uhash_get(gMetaZoneIDTable, usMzID) == NULL) {            gMetaZoneIDs->addElement((void *)uMzID, status);            uhash_put(gMetaZoneIDTable, (void *)usMzID, (void *)uMzID, &status);        } else {            uprv_free(uMzID);            delete usMzID;        }    }    ures_close(&res);    ures_close(bundle);    ures_close(rb);    if (U_FAILURE(status)) {        uhash_close(gMetaZoneIDTable);        delete gMetaZoneIDs;        gMetaZoneIDTable = NULL;        gMetaZoneIDs = NULL;    }}
开发者ID:Akesure,项目名称:jxcore,代码行数:60,


示例5: fVec

SPUStringPool::SPUStringPool(UErrorCode &status) : fVec(NULL), fHash(NULL) {    fVec = new UVector(status);    fHash = uhash_open(uhash_hashUnicodeString,           // key hash function                       uhash_compareUnicodeString,        // Key Comparator                       NULL,                              // Value Comparator                       &status);}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:7,


示例6: hashIChars

static void hashIChars(void) {    static const char which[] = "which";    static const char WHICH2[] = "WHICH";    static const char where[] = "where";    UErrorCode status = U_ZERO_ERROR;    UHashtable *hash;    hash = uhash_open(uhash_hashIChars, uhash_compareIChars, NULL, &status);    if (U_FAILURE(status)) {        log_err("FAIL: uhash_open failed with %s and returned 0x%08x/n",                u_errorName(status), hash);        return;    }    if (hash == NULL) {        log_err("FAIL: uhash_open returned NULL/n");        return;    }    log_verbose("Ok: uhash_open returned 0x%08X/n", hash);    _put(hash, which, 1, 0);    _put(hash, WHICH2, 2, 1);    _put(hash, where, 3, 0);    if(uhash_count(hash) != 2){         log_err("FAIL: uhas_count() failed. Expected: 1, Got: %d/n", uhash_count(hash));    }    _remove(hash, which, 2);    uhash_close(hash);}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:29,


示例7: fHashtable

UnifiedCache::UnifiedCache(UErrorCode &status) :        fHashtable(NULL),        fEvictPos(UHASH_FIRST),        fNumValuesTotal(0),        fNumValuesInUse(0),        fMaxUnused(DEFAULT_MAX_UNUSED),        fMaxPercentageOfInUse(DEFAULT_PERCENTAGE_OF_IN_USE),        fAutoEvictedCount(0),        fNoValue(nullptr) {    if (U_FAILURE(status)) {        return;    }    fNoValue = new SharedObject();    if (fNoValue == nullptr) {        status = U_MEMORY_ALLOCATION_ERROR;        return;    }    fNoValue->softRefCount = 1;  // Add fake references to prevent fNoValue from being deleted    fNoValue->hardRefCount = 1;  // when other references to it are removed.    fNoValue->cachePtr = this;    fHashtable = uhash_open(            &ucache_hashKeys,            &ucache_compareKeys,            NULL,            &status);    if (U_FAILURE(status)) {        return;    }    uhash_setKeyDeleter(fHashtable, &ucache_deleteKey);}
开发者ID:basti1302,项目名称:node,代码行数:31,


示例8: lock

U_CDECL_ENDU_NAMESPACE_BEGINLocale *locale_set_default_internal(const char *id, UErrorCode& status) {    // Synchronize this entire function.    Mutex lock(&gDefaultLocaleMutex);    UBool canonicalize = FALSE;    // If given a NULL string for the locale id, grab the default    //   name from the system.    //   (Different from most other locale APIs, where a null name means use    //    the current ICU default locale.)    if (id == NULL) {        id = uprv_getDefaultLocaleID();   // This function not thread safe? TODO: verify.        canonicalize = TRUE; // always canonicalize host ID    }    char localeNameBuf[512];    if (canonicalize) {        uloc_canonicalize(id, localeNameBuf, sizeof(localeNameBuf)-1, &status);    } else {        uloc_getName(id, localeNameBuf, sizeof(localeNameBuf)-1, &status);    }    localeNameBuf[sizeof(localeNameBuf)-1] = 0;  // Force null termination in event of                                                 //   a long name filling the buffer.                                                 //   (long names are truncated.)                                                 //    if (U_FAILURE(status)) {        return gDefaultLocale;    }    if (gDefaultLocalesHashT == NULL) {        gDefaultLocalesHashT = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &status);        if (U_FAILURE(status)) {            return gDefaultLocale;        }        uhash_setValueDeleter(gDefaultLocalesHashT, deleteLocale);        ucln_common_registerCleanup(UCLN_COMMON_LOCALE, locale_cleanup);    }    Locale *newDefault = (Locale *)uhash_get(gDefaultLocalesHashT, localeNameBuf);    if (newDefault == NULL) {        newDefault = new Locale(Locale::eBOGUS);        if (newDefault == NULL) {            status = U_MEMORY_ALLOCATION_ERROR;            return gDefaultLocale;        }        newDefault->init(localeNameBuf, FALSE);        uhash_put(gDefaultLocalesHashT, (char*) newDefault->getName(), newDefault, &status);        if (U_FAILURE(status)) {            return gDefaultLocale;        }    }    gDefaultLocale = newDefault;    return gDefaultLocale;}
开发者ID:winlibs,项目名称:icu4c,代码行数:59,


示例9: Transliterator

/** * Copy constructor. */AnyTransliterator::AnyTransliterator(const AnyTransliterator& o) :    Transliterator(o),    target(o.target),    targetScript(o.targetScript){    // Don't copy the cache contents    UErrorCode ec = U_ZERO_ERROR;    cache = uhash_open(uhash_hashLong, uhash_compareLong, NULL, &ec);    uhash_setValueDeleter(cache, _deleteTransliterator);}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:13,


示例10: olsonToMetaInit

static void U_CALLCONV olsonToMetaInit(UErrorCode &status) {    U_ASSERT(gOlsonToMeta == NULL);    ucln_i18n_registerCleanup(UCLN_I18N_ZONEMETA, zoneMeta_cleanup);    gOlsonToMeta = uhash_open(uhash_hashUChars, uhash_compareUChars, NULL, &status);    if (U_FAILURE(status)) {        gOlsonToMeta = NULL;    } else {        uhash_setKeyDeleter(gOlsonToMeta, deleteUCharString);        uhash_setValueDeleter(gOlsonToMeta, deleteUVector);    }}
开发者ID:basti1302,项目名称:node,代码行数:11,


示例11: initCanonicalIDCache

static void U_CALLCONV initCanonicalIDCache(UErrorCode &status) {    gCanonicalIDCache = uhash_open(uhash_hashUChars, uhash_compareUChars, NULL, &status);    if (gCanonicalIDCache == NULL) {        status = U_MEMORY_ALLOCATION_ERROR;    }    if (U_FAILURE(status)) {        gCanonicalIDCache = NULL;    }    // No key/value deleters - keys/values are from a resource bundle    ucln_i18n_registerCleanup(UCLN_I18N_ZONEMETA, zoneMeta_cleanup);}
开发者ID:basti1302,项目名称:node,代码行数:11,


示例12: uhash_open

void CDFLocaleStyleData::Init(UErrorCode& status) {  if (unitsByVariant != NULL) {    return;  }  unitsByVariant = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &status);  if (U_FAILURE(status)) {    return;  }  uhash_setKeyDeleter(unitsByVariant, uprv_free);  uhash_setValueDeleter(unitsByVariant, deleteCDFUnits);}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:11,


示例13: TestBasic

static void TestBasic(void) {    const char one[4] =   {0x6F, 0x6E, 0x65, 0}; /* "one" */    const char one2[4] =  {0x6F, 0x6E, 0x65, 0}; /* Get around compiler optimizations */    const char two[4] =   {0x74, 0x77, 0x6F, 0}; /* "two" */    const char three[6] = {0x74, 0x68, 0x72, 0x65, 0x65, 0}; /* "three" */    const char omega[6] = {0x6F, 0x6D, 0x65, 0x67, 0x61, 0}; /* "omega" */    UErrorCode status = U_ZERO_ERROR;    UHashtable *hash;    hash = uhash_open(hashChars, isEqualChars,  &status);    if (U_FAILURE(status)) {        log_err("FAIL: uhash_open failed with %s and returned 0x%08x/n",                u_errorName(status), hash);        return;    }    if (hash == NULL) {        log_err("FAIL: uhash_open returned NULL/n");        return;    }    log_verbose("Ok: uhash_open returned 0x%08X/n", hash);    _put(hash, one, 1, 0);    _put(hash, omega, 24, 0);    _put(hash, two, 2, 0);    _put(hash, three, 3, 0);    _put(hash, one, -1, 1);    _put(hash, two, -2, 2);    _put(hash, omega, 48, 24);    _put(hash, one, 100, -1);    _get(hash, three, 3);    _remove(hash, two, -2);    _get(hash, two, 0);    _get(hash, one, 100);    _put(hash, two, 200, 0);    _get(hash, omega, 48);    _get(hash, two, 200);    if(_compareChars((void*)one, (void*)three) == TRUE ||        _compareChars((void*)one, (void*)one2) != TRUE ||        _compareChars((void*)one, (void*)one) != TRUE ||        _compareChars((void*)one, NULL) == TRUE  )  {        log_err("FAIL: compareChars failed/n");    }    if(_compareIChars((void*)one, (void*)three) == TRUE ||        _compareIChars((void*)one, (void*)one) != TRUE ||        _compareIChars((void*)one, (void*)one2) != TRUE ||        _compareIChars((void*)one, NULL) == TRUE  )  {        log_err("FAIL: compareIChars failed/n");    }         uhash_close(hash);}
开发者ID:andrewleech,项目名称:firebird,代码行数:53,


示例14: createCache

U_CDECL_END/** Initializes the cache for resources */static void U_CALLCONVcreateCache(UErrorCode &status) {    SHARED_DATA_HASHTABLE = uhash_open(hashEntry, compareEntries, NULL, &status);    if (U_FAILURE(status)) {        SHARED_DATA_HASHTABLE = NULL;    }    ucln_common_registerCleanup(UCLN_COMMON_USPREP, usprep_cleanup);}
开发者ID:basti1302,项目名称:node,代码行数:12,


示例15: uhash_open

void AlphabeticIndex::init(UErrorCode &status) {    // Initialize statics if needed.    AlphabeticIndex::staticInit(status);    // Put the object into a known state so that the destructor will function.    alreadyIn_             = NULL;    bucketList_            = NULL;    collator_              = NULL;    collatorPrimaryOnly_   = NULL;    currentBucket_         = NULL;    firstScriptCharacters_ = NULL;    initialLabels_         = NULL;    indexBuildRequired_    = TRUE;    inputRecords_          = NULL;    itemsIterIndex_        = 0;    labels_                = NULL;    labelsIterIndex_       = 0;    maxLabelCount_         = 99;    noDistinctSorting_     = NULL;    notAlphabetic_         = NULL;    recordCounter_         = 0;    if (U_FAILURE(status)) {        return;    }    alreadyIn_             = uhash_open(uhash_hashUnicodeString,    // Key Hash,                                        uhash_compareUnicodeString, // key Comparator,                                        NULL,                       // value Comparator                                        &status);    uhash_setKeyDeleter(alreadyIn_, uprv_deleteUObject);    uhash_setValueDeleter(alreadyIn_, uprv_deleteUObject);    bucketList_            = new UVector(status);    bucketList_->setDeleter(alphaIndex_deleteBucket);    labels_                = new UVector(status);    labels_->setDeleter(uprv_deleteUObject);    labels_->setComparer(uhash_compareUnicodeString);    inputRecords_          = new UVector(status);    inputRecords_->setDeleter(alphaIndex_deleteRecord);    noDistinctSorting_     = new UnicodeSet();    notAlphabetic_         = new UnicodeSet();    initialLabels_         = new UnicodeSet();    inflowLabel_.remove();    inflowLabel_.append((UChar)0x2026);    // Ellipsis    overflowLabel_ = inflowLabel_;    underflowLabel_ = inflowLabel_;    // TODO:  check for memory allocation failures.}
开发者ID:0omega,项目名称:platform_external_icu4c,代码行数:52,


示例16: ures_open

voidTimeZoneNamesImpl::initialize(const Locale& locale, UErrorCode& status) {    if (U_FAILURE(status)) {        return;    }    // Load zoneStrings bundle    UErrorCode tmpsts = U_ZERO_ERROR;   // OK with fallback warning..    fZoneStrings = ures_open(U_ICUDATA_ZONE, locale.getName(), &tmpsts);    fZoneStrings = ures_getByKeyWithFallback(fZoneStrings, gZoneStrings, fZoneStrings, &tmpsts);    if (U_FAILURE(tmpsts)) {        status = tmpsts;        cleanup();        return;    }    // Initialize hashtables holding time zone/meta zone names    fMZNamesMap = uhash_open(uhash_hashUChars, uhash_compareUChars, NULL, &status);    fTZNamesMap = uhash_open(uhash_hashUChars, uhash_compareUChars, NULL, &status);    if (U_FAILURE(status)) {        cleanup();        return;    }    uhash_setValueDeleter(fMZNamesMap, deleteZNames);    uhash_setValueDeleter(fTZNamesMap, deleteTZNames);    // no key deleters for name maps    // preload zone strings for the default zone    TimeZone *tz = TimeZone::createDefault();    const UChar *tzID = ZoneMeta::getCanonicalCLDRID(*tz);    if (tzID != NULL) {        loadStrings(UnicodeString(tzID));    }    delete tz;    return;}
开发者ID:00zhengfu00,项目名称:third_party,代码行数:38,


示例17: nscacheInit

static void U_CALLCONV nscacheInit() {    U_ASSERT(NumberingSystem_cache == NULL);    ucln_i18n_registerCleanup(UCLN_I18N_NUMFMT, numfmt_cleanup);    UErrorCode status = U_ZERO_ERROR;    NumberingSystem_cache = uhash_open(uhash_hashLong,                                       uhash_compareLong,                                       NULL,                                       &status);    if (U_FAILURE(status)) {        // Number Format code will run with no cache if creation fails.        NumberingSystem_cache = NULL;        return;    }    uhash_setValueDeleter(NumberingSystem_cache, deleteNumberingSystem);}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:15,


示例18: U_ASSERT

UnifiedCache::UnifiedCache(UErrorCode &status) {    if (U_FAILURE(status)) {        return;    }    U_ASSERT(gNoValue != NULL);    fHashtable = uhash_open(            &ucache_hashKeys,            &ucache_compareKeys,            NULL,            &status);    if (U_FAILURE(status)) {        return;    }    uhash_setKeyDeleter(fHashtable, &ucache_deleteKey);}
开发者ID:GuillaumeSmaha,项目名称:stringi,代码行数:15,


示例19: UVector64

//--------------------------------------------------------------------------////    init        Shared initialization for use by constructors.//                Bring an uninitialized RegexPattern up to a default state.////--------------------------------------------------------------------------void RegexPattern::init() {    fFlags            = 0;    fCompiledPat      = 0;    fLiteralText.remove();    fSets             = NULL;    fSets8            = NULL;    fDeferredStatus   = U_ZERO_ERROR;    fMinMatchLen      = 0;    fFrameSize        = 0;    fDataSize         = 0;    fGroupMap         = NULL;    fStaticSets       = NULL;    fStaticSets8      = NULL;    fStartType        = START_NO_INFO;    fInitialStringIdx = 0;    fInitialStringLen = 0;    fInitialChars     = NULL;    fInitialChar      = 0;    fInitialChars8    = NULL;    fNeedsAltInput    = FALSE;    fNamedCaptureMap  = NULL;    fPattern          = NULL; // will be set later    fPatternString    = NULL; // may be set later    fCompiledPat      = new UVector64(fDeferredStatus);    fGroupMap         = new UVector32(fDeferredStatus);    fSets             = new UVector(fDeferredStatus);    fInitialChars     = new UnicodeSet;    fInitialChars8    = new Regex8BitSet;    fNamedCaptureMap  = uhash_open(uhash_hashUnicodeString,     // Key hash function                                   uhash_compareUnicodeString,  // Key comparator function                                   uhash_compareLong,           // Value comparator function                                   &fDeferredStatus);    if (U_FAILURE(fDeferredStatus)) {        return;    }    if (fCompiledPat == NULL  || fGroupMap == NULL || fSets == NULL ||            fInitialChars == NULL || fInitialChars8 == NULL || fNamedCaptureMap == NULL) {        fDeferredStatus = U_MEMORY_ALLOCATION_ERROR;        return;    }    // Slot zero of the vector of sets is reserved.  Fill it here.    fSets->addElement((int32_t)0, fDeferredStatus);    // fNamedCaptureMap owns its key strings, type (UnicodeString *)    uhash_setKeyDeleter(fNamedCaptureMap, uprv_deleteUObject);}
开发者ID:Acorld,项目名称:WinObjC-Heading,代码行数:54,


示例20: cache

CollDataCache::CollDataCache(UErrorCode &status)    : cache(NULL){    if (U_FAILURE(status)) {        return;    }    cache = uhash_open(uhash_hashChars, uhash_compareChars, uhash_compareLong, &status);    if (U_FAILURE(status)) {        return;    }    uhash_setValueDeleter(cache, deleteCollDataCacheEntry);    uhash_setKeyDeleter(cache, deleteChars);}
开发者ID:Abocer,项目名称:android-4.2_r1,代码行数:16,


示例21: fIdentifier

U_CDECL_ENDIdentifierInfo::IdentifierInfo(UErrorCode &status):         fIdentifier(NULL), fRequiredScripts(NULL), fScriptSetSet(NULL),         fCommonAmongAlternates(NULL), fNumerics(NULL), fIdentifierProfile(NULL) {    if (U_FAILURE(status)) {        return;    }    {        Mutex lock(&gInitMutex);        if (!gStaticsAreInitialized) {            ASCII    = new UnicodeSet(0, 0x7f);            JAPANESE = new ScriptSet();            CHINESE  = new ScriptSet();            KOREAN   = new ScriptSet();            CONFUSABLE_WITH_LATIN = new ScriptSet();            if (ASCII == NULL || JAPANESE == NULL || CHINESE == NULL || KOREAN == NULL                    || CONFUSABLE_WITH_LATIN == NULL) {                status = U_MEMORY_ALLOCATION_ERROR;                return;            }            ASCII->freeze();            JAPANESE->set(USCRIPT_LATIN, status).set(USCRIPT_HAN, status).set(USCRIPT_HIRAGANA, status)                     .set(USCRIPT_KATAKANA, status);            CHINESE->set(USCRIPT_LATIN, status).set(USCRIPT_HAN, status).set(USCRIPT_BOPOMOFO, status);            KOREAN->set(USCRIPT_LATIN, status).set(USCRIPT_HAN, status).set(USCRIPT_HANGUL, status);            CONFUSABLE_WITH_LATIN->set(USCRIPT_CYRILLIC, status).set(USCRIPT_GREEK, status)                      .set(USCRIPT_CHEROKEE, status);            ucln_i18n_registerCleanup(UCLN_I18N_IDENTIFIER_INFO, IdentifierInfo_cleanup);            gStaticsAreInitialized = TRUE;        }    }    fIdentifier = new UnicodeString();    fRequiredScripts = new ScriptSet();    fScriptSetSet = uhash_open(uhash_hashScriptSet, uhash_compareScriptSet, NULL, &status);    uhash_setKeyDeleter(fScriptSetSet, uhash_deleteScriptSet);    fCommonAmongAlternates = new ScriptSet();    fNumerics = new UnicodeSet();    fIdentifierProfile = new UnicodeSet(0, 0x10FFFF);    if (U_SUCCESS(status) && (fIdentifier == NULL || fRequiredScripts == NULL || fScriptSetSet == NULL ||                              fCommonAmongAlternates == NULL || fNumerics == NULL || fIdentifierProfile == NULL)) {        status = U_MEMORY_ALLOCATION_ERROR;    }}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:46,


示例22: map

CEToStringsMap::CEToStringsMap(UErrorCode &status)    : map(NULL){    if (U_FAILURE(status)) {        return;    }    map = uhash_open(uhash_hashLong, uhash_compareLong,                     uhash_compareCaselessUnicodeString,                     &status);    if (U_FAILURE(status)) {        return;    }    uhash_setValueDeleter(map, deleteStringList);}
开发者ID:icu-project,项目名称:icu4c,代码行数:17,


示例23: getCDFLocaleStyleData

// getCDFLocaleStyleData returns pointer to formatting data for given locale and // style within the global cache. On cache miss, getCDFLocaleStyleData loads// the data from CLDR into the global cache before returning the pointer. If a// UNUM_LONG data is requested for a locale, and that locale does not have// UNUM_LONG data, getCDFLocaleStyleData will fall back to UNUM_SHORT data for// that locale.static const CDFLocaleStyleData* getCDFLocaleStyleData(const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status) {  if (U_FAILURE(status)) {    return NULL;  }  CDFLocaleData* result = NULL;  const char* key = inLocale.getName();  {    Mutex lock(&gCompactDecimalMetaLock);    if (gCompactDecimalData == NULL) {      gCompactDecimalData = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &status);      if (U_FAILURE(status)) {        return NULL;      }      uhash_setKeyDeleter(gCompactDecimalData, uprv_free);      uhash_setValueDeleter(gCompactDecimalData, deleteCDFLocaleData);      ucln_i18n_registerCleanup(UCLN_I18N_CDFINFO, cdf_cleanup);    } else {      result = (CDFLocaleData*) uhash_get(gCompactDecimalData, key);    }  }  if (result != NULL) {    return extractDataByStyleEnum(*result, style, status);  }  result = loadCDFLocaleData(inLocale, status);  if (U_FAILURE(status)) {    return NULL;  }  {    Mutex lock(&gCompactDecimalMetaLock);    CDFLocaleData* temp = (CDFLocaleData*) uhash_get(gCompactDecimalData, key);    if (temp != NULL) {      delete result;      result = temp;    } else {      uhash_put(gCompactDecimalData, uprv_strdup(key), (void*) result, &status);      if (U_FAILURE(status)) {        return NULL;      }    }  }  return extractDataByStyleEnum(*result, style, status);}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:50,


示例24: fRuleScanner

U_CDECL_ENDU_NAMESPACE_BEGINRBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules, UErrorCode &status)    :fRules(rules), fRuleScanner(rs), ffffString(UChar(0xffff)){    fHashTable       = NULL;    fCachedSetLookup = NULL;        fHashTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, &status);    // uhash_open checks status    if (U_FAILURE(status)) {        return;    }    uhash_setValueDeleter(fHashTable, RBBISymbolTableEntry_deleter);}
开发者ID:0x4d52,项目名称:JavaScriptCore-X,代码行数:19,


示例25: DayPeriodRulesData

void U_CALLCONV DayPeriodRules::load(UErrorCode &errorCode) {    if (U_FAILURE(errorCode)) {        return;    }    data = new DayPeriodRulesData();    data->localeToRuleSetNumMap = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &errorCode);    LocalUResourceBundlePointer rb_dayPeriods(ures_openDirect(NULL, "dayPeriods", &errorCode));    // Get the largest rule set number (so we allocate enough objects).    DayPeriodRulesCountSink countSink;    ures_getAllItemsWithFallback(rb_dayPeriods.getAlias(), "rules", countSink, errorCode);    // Populate rules.    DayPeriodRulesDataSink sink;    ures_getAllItemsWithFallback(rb_dayPeriods.getAlias(), "", sink, errorCode);    ucln_i18n_registerCleanup(UCLN_I18N_DAYPERIODRULES, dayPeriodRulesCleanup);}
开发者ID:DavidCai1993,项目名称:node,代码行数:19,


示例26: map

StringToCEsMap::StringToCEsMap(UErrorCode &status)    : map(NULL){    if (U_FAILURE(status)) {        return;    }    map = uhash_open(uhash_hashUnicodeString,                     uhash_compareUnicodeString,                     uhash_compareLong,                     &status);    if (U_FAILURE(status)) {        return;    }    uhash_setValueDeleter(map, deleteCEList);    uhash_setKeyDeleter(map, deleteUnicodeStringKey);}
开发者ID:Abocer,项目名称:android-4.2_r1,代码行数:19,


示例27: uhash_open

ZNStringPool::ZNStringPool(UErrorCode &status) {    fChunks = NULL;    fHash   = NULL;    if (U_FAILURE(status)) {        return;    }    fChunks = new ZNStringPoolChunk;    if (fChunks == NULL) {        status = U_MEMORY_ALLOCATION_ERROR;        return;    }    fHash   = uhash_open(uhash_hashUChars      /* keyHash */,                          uhash_compareUChars   /* keyComp */,                          uhash_compareUChars   /* valueComp */,                          &status);    if (U_FAILURE(status)) {        return;    }}
开发者ID:00zhengfu00,项目名称:third_party,代码行数:20,


示例28: fHashtable

UnifiedCache::UnifiedCache(UErrorCode &status) :        fHashtable(NULL),        fEvictPos(UHASH_FIRST),        fItemsInUseCount(0),        fMaxUnused(DEFAULT_MAX_UNUSED),        fMaxPercentageOfInUse(DEFAULT_PERCENTAGE_OF_IN_USE),        fAutoEvictedCount(0) {    if (U_FAILURE(status)) {        return;    }    U_ASSERT(gNoValue != NULL);    fHashtable = uhash_open(            &ucache_hashKeys,            &ucache_compareKeys,            NULL,            &status);    if (U_FAILURE(status)) {        return;    }    uhash_setKeyDeleter(fHashtable, &ucache_deleteKey);}
开发者ID:Mikhaska,项目名称:node,代码行数:21,



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


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