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

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

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

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

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

示例1: ucol_getRulesEx

U_CAPI int32_t U_EXPORT2ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen) {    UErrorCode status = U_ZERO_ERROR;    int32_t len = 0;    int32_t UCAlen = 0;    const UChar* ucaRules = 0;    const UChar *rules = ucol_getRules(coll, &len);    if(delta == UCOL_FULL_RULES) {        /* take the UCA rules and append real rules at the end */        /* UCA rules will be probably coming from the root RB */        ucaRules = ures_getStringByKey(coll->rb,"UCARules",&UCAlen,&status);        /*        UResourceBundle* cresb = ures_getByKeyWithFallback(coll->rb, "collations", NULL, &status);        UResourceBundle*  uca = ures_getByKeyWithFallback(cresb, "UCA", NULL, &status);        ucaRules = ures_getStringByKey(uca,"Sequence",&UCAlen,&status);        ures_close(uca);        ures_close(cresb);        */    }    if(U_FAILURE(status)) {        return 0;    }    if(buffer!=0 && bufferLen>0){        *buffer=0;        if(UCAlen > 0) {            u_memcpy(buffer, ucaRules, uprv_min(UCAlen, bufferLen));        }        if(len > 0 && bufferLen > UCAlen) {            u_memcpy(buffer+UCAlen, rules, uprv_min(len, bufferLen-UCAlen));        }    }    return u_terminateUChars(buffer, bufferLen, len+UCAlen, &status);}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:33,


示例2: updateSrc

/** * Applies a new value to the text that serves as input at the current * processing step. This value is identical to the original one when we begin * the processing, but usually changes as the transformation progresses. *  * @param pTransform A pointer to the <code>UBiDiTransform</code> structure. * @param newSrc A pointer whose value is to be used as input text. * @param newLength A length of the new text in <code>UChar</code>s. * @param newSize A new source capacity in <code>UChar</code>s. * @param pErrorCode Pointer to the error code value. */static voidupdateSrc(UBiDiTransform *pTransform, const UChar *newSrc, uint32_t newLength,        uint32_t newSize, UErrorCode *pErrorCode){    if (newSize < newLength) {        *pErrorCode = U_BUFFER_OVERFLOW_ERROR;        return;    }    if (newSize > pTransform->srcSize) {        newSize += 50; // allocate slightly more than needed right now        if (pTransform->src != NULL) {            uprv_free(pTransform->src);            pTransform->src = NULL;        }        pTransform->src = (UChar *)uprv_malloc(newSize * sizeof(UChar));        if (pTransform->src == NULL) {            *pErrorCode = U_MEMORY_ALLOCATION_ERROR;            //pTransform->srcLength = pTransform->srcSize = 0;            return;        }        pTransform->srcSize = newSize;    }    u_strncpy(pTransform->src, newSrc, newLength);    pTransform->srcLength = u_terminateUChars(pTransform->src,    		pTransform->srcSize, newLength, pErrorCode);}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:37,


示例3: _iterate

static int32_t_iterate(UCharIterator *src, UBool forward,              UChar *dest, int32_t destCapacity,              const Normalizer2 *n2,              UBool doNormalize, UBool *pNeededToNormalize,              UErrorCode *pErrorCode) {    if(U_FAILURE(*pErrorCode)) {        return 0;    }    if(destCapacity<0 || (dest==NULL && destCapacity>0) || src==NULL) {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    if(pNeededToNormalize!=NULL) {        *pNeededToNormalize=FALSE;    }    if(!(forward ? src->hasNext(src) : src->hasPrevious(src))) {        return u_terminateUChars(dest, destCapacity, 0, pErrorCode);    }    UnicodeString buffer;    UChar32 c;    if(forward) {        /* get one character and ignore its properties */        buffer.append(uiter_next32(src));        /* get all following characters until we see a boundary */        while((c=uiter_next32(src))>=0) {            if(n2->hasBoundaryBefore(c)) {                /* back out the latest movement to stop at the boundary */                src->move(src, -U16_LENGTH(c), UITER_CURRENT);                break;            } else {                buffer.append(c);            }        }    } else {        while((c=uiter_previous32(src))>=0) {            /* always write this character to the front of the buffer */            buffer.insert(0, c);            /* stop if this just-copied character is a boundary */            if(n2->hasBoundaryBefore(c)) {                break;            }        }    }    UnicodeString destString(dest, 0, destCapacity);    if(buffer.length()>0 && doNormalize) {        n2->normalize(buffer, destString, *pErrorCode).extract(dest, destCapacity, *pErrorCode);        if(pNeededToNormalize!=NULL && U_SUCCESS(*pErrorCode)) {            *pNeededToNormalize= destString!=buffer;        }        return destString.length();    } else {        /* just copy the source characters */        return buffer.extract(dest, destCapacity, *pErrorCode);    }}
开发者ID:icu-project,项目名称:icu4c,代码行数:59,


示例4: _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,


示例5: u_strFromWCS

U_CAPI UChar* U_EXPORT2u_strFromWCS(UChar   *dest,             int32_t destCapacity,             int32_t *pDestLength,             const wchar_t *src,             int32_t srcLength,             UErrorCode *pErrorCode){    /* args check */    if(pErrorCode==NULL || U_FAILURE(*pErrorCode)){        return NULL;    }    if( (src==NULL && srcLength!=0) || srcLength < -1 ||        (destCapacity<0) || (dest == NULL && destCapacity > 0)    ) {        *pErrorCode = U_ILLEGAL_ARGUMENT_ERROR;        return NULL;    }#ifdef U_WCHAR_IS_UTF16    /* wchar_t is UTF-16 just do a memcpy */    if(srcLength == -1){        srcLength = u_strlen(src);    }    if(0 < srcLength && srcLength <= destCapacity){        uprv_memcpy(dest,src,srcLength*U_SIZEOF_UCHAR);    }    if(pDestLength){       *pDestLength = srcLength;    }    u_terminateUChars(dest,destCapacity,srcLength,pErrorCode);    return dest;#elif defined U_WCHAR_IS_UTF32    return u_strFromUTF32(dest, destCapacity, pDestLength,                          (UChar32*)src, srcLength, pErrorCode);#else    return _strFromWCS(dest,destCapacity,pDestLength,src,srcLength,pErrorCode);#endif}
开发者ID:119120119,项目名称:node,代码行数:49,


示例6: _getDisplayNameForComponent

static int32_t_getDisplayNameForComponent(const char * locale,                            const char * displayLocale,                            UChar * dest, int32_t destCapacity,                            UDisplayNameGetter * getter,                            const char * tag,                            UErrorCode * pErrorCode){	char localeBuffer[ULOC_FULLNAME_CAPACITY * 4];	int32_t length;	UErrorCode localStatus;	const char * root = NULL;	/* argument checking */	if (pErrorCode == NULL || U_FAILURE(*pErrorCode))	{		return 0;	}	if (destCapacity < 0 || (destCapacity > 0 && dest == NULL))	{		*pErrorCode = U_ILLEGAL_ARGUMENT_ERROR;		return 0;	}	localStatus = U_ZERO_ERROR;	length = (*getter)(locale, localeBuffer, sizeof(localeBuffer), &localStatus);	if (U_FAILURE(localStatus) || localStatus == U_STRING_NOT_TERMINATED_WARNING)	{		*pErrorCode = U_ILLEGAL_ARGUMENT_ERROR;		return 0;	}	if (length == 0)	{		return u_terminateUChars(dest, destCapacity, 0, pErrorCode);	}	root = tag == _kCountries ? U_ICUDATA_REGION : U_ICUDATA_LANG;	return _getStringOrCopyKey(root, displayLocale,	                           tag, NULL, localeBuffer,	                           localeBuffer,	                           dest, destCapacity,	                           pErrorCode);}
开发者ID:Botyto,项目名称:Core,代码行数:45,


示例7: ucnv_getDisplayName

U_CAPI int32_t U_EXPORT2ucnv_getDisplayName(const UConverter *cnv,                    const char *displayLocale,                    UChar *displayName, int32_t displayNameCapacity,                    UErrorCode *pErrorCode) {    UResourceBundle *rb;    const UChar *name;    int32_t length;    UErrorCode localStatus = U_ZERO_ERROR;    /* check arguments */    if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {        return 0;    }    if(cnv==NULL || displayNameCapacity<0 || (displayNameCapacity>0 && displayName==NULL)) {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    /* open the resource bundle and get the display name string */    rb=ures_open(NULL, displayLocale, pErrorCode);    if(U_FAILURE(*pErrorCode)) {        return 0;    }    /* use the internal name as the key */    name=ures_getStringByKey(rb, cnv->sharedData->staticData->name, &length, &localStatus);    ures_close(rb);    if(U_SUCCESS(localStatus)) {        /* copy the string */        if (*pErrorCode == U_ZERO_ERROR) {            *pErrorCode = localStatus;        }        u_memcpy(displayName, name, uprv_min(length, displayNameCapacity)*U_SIZEOF_UCHAR);    } else {        /* convert the internal name into a Unicode string */        length=(int32_t)uprv_strlen(cnv->sharedData->staticData->name);        u_charsToUChars(cnv->sharedData->staticData->name, displayName, uprv_min(length, displayNameCapacity));    }    return u_terminateUChars(displayName, displayNameCapacity, length, pErrorCode);}
开发者ID:AlexanderPankiv,项目名称:node,代码行数:43,


示例8: uscript_getSampleString

U_CAPI int32_t U_EXPORT2uscript_getSampleString(UScriptCode script, UChar *dest, int32_t capacity, UErrorCode *pErrorCode) {    if(U_FAILURE(*pErrorCode)) { return 0; }    if(capacity < 0 || (capacity > 0 && dest == NULL)) {        *pErrorCode = U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    int32_t sampleChar = getScriptProps(script) & 0x1fffff;    int32_t length;    if(sampleChar == 0) {        length = 0;    } else {        length = U16_LENGTH(sampleChar);        if(length <= capacity) {            int32_t i = 0;            U16_APPEND_UNSAFE(dest, i, sampleChar);        }    }    return u_terminateUChars(dest, capacity, length, pErrorCode);}
开发者ID:icu-project,项目名称:icu4c,代码行数:20,


示例9: rsource

int32_t NamePrepTransform::map(const UChar* src, int32_t srcLength,                         UChar* dest, int32_t destCapacity,                         UBool allowUnassigned,                        UParseError* /*parseError*/,                        UErrorCode& status ){    if(U_FAILURE(status)){        return 0;    }    //check arguments    if(src==NULL || srcLength<-1 || (dest==NULL && destCapacity!=0)) {        status=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    UnicodeString rsource(src,srcLength);    // map the code points    // transliteration also performs NFKC    mapping->transliterate(rsource);        const UChar* buffer = rsource.getBuffer();    int32_t bufLen = rsource.length();    // check if unassigned    if(allowUnassigned == FALSE){        int32_t bufIndex=0;        UChar32 ch =0 ;        for(;bufIndex<bufLen;){            U16_NEXT(buffer, bufIndex, bufLen, ch);            if(unassigned.contains(ch)){                status = U_IDNA_UNASSIGNED_ERROR;                return 0;            }        }    }    // check if there is enough room in the output    if(bufLen < destCapacity){        uprv_memcpy(dest,buffer,bufLen*U_SIZEOF_UCHAR);    }    return u_terminateUChars(dest, destCapacity, bufLen, &status);}
开发者ID:Andproject,项目名称:platform_external_icu4c,代码行数:41,


示例10: ubidi_writeReverse

U_CAPI int32_t U_EXPORT2ubidi_writeReverse(const UChar *src, int32_t srcLength,                   UChar *dest, int32_t destSize,                   uint16_t options,                   UErrorCode *pErrorCode) {    int32_t destLength;    if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {        return 0;    }    /* more error checking */    if( src==NULL || srcLength<-1 ||        destSize<0 || (destSize>0 && dest==NULL))    {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    /* do input and output overlap? */    if( dest!=NULL &&        ((src>=dest && src<dest+destSize) ||         (dest>=src && dest<src+srcLength)))    {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    if(srcLength==-1) {        srcLength=u_strlen(src);    }    if(srcLength>0) {        destLength=doWriteReverse(src, srcLength, dest, destSize, options, pErrorCode);    } else {        /* nothing to do */        destLength=0;    }    return u_terminateUChars(dest, destSize, destLength, pErrorCode);}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:40,


示例11: uloc_getDisplayKeywordValue

U_CAPI int32_t U_EXPORT2uloc_getDisplayKeywordValue(   const char* locale,                               const char* keyword,                               const char* displayLocale,                               UChar* dest,                               int32_t destCapacity,                               UErrorCode* status){    char keywordValue[ULOC_FULLNAME_CAPACITY*4];    int32_t capacity = ULOC_FULLNAME_CAPACITY*4;    int32_t keywordValueLen =0;    /* argument checking */    if(status==NULL || U_FAILURE(*status)) {        return 0;    }    if(destCapacity<0 || (destCapacity>0 && dest==NULL)) {        *status=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    /* get the keyword value */    keywordValue[0]=0;    keywordValueLen = uloc_getKeywordValue(locale, keyword, keywordValue, capacity, status);    /*      * if the keyword is equal to currency .. then to get the display name      * we need to do the fallback ourselves     */    if(uprv_stricmp(keyword, _kCurrency)==0){        int32_t dispNameLen = 0;        const UChar *dispName = NULL;                UResourceBundle *bundle     = ures_open(U_ICUDATA_CURR, displayLocale, status);        UResourceBundle *currencies = ures_getByKey(bundle, _kCurrencies, NULL, status);        UResourceBundle *currency   = ures_getByKeyWithFallback(currencies, keywordValue, NULL, status);                dispName = ures_getStringByIndex(currency, UCURRENCY_DISPLAY_NAME_INDEX, &dispNameLen, status);                /*close the bundles */        ures_close(currency);        ures_close(currencies);        ures_close(bundle);                if(U_FAILURE(*status)){            if(*status == U_MISSING_RESOURCE_ERROR){                /* we just want to write the value over if nothing is available */                *status = U_USING_DEFAULT_WARNING;            }else{                return 0;            }        }        /* now copy the dispName over if not NULL */        if(dispName != NULL){            if(dispNameLen <= destCapacity){                uprv_memcpy(dest, dispName, dispNameLen * U_SIZEOF_UCHAR);                return u_terminateUChars(dest, destCapacity, dispNameLen, status);            }else{                *status = U_BUFFER_OVERFLOW_ERROR;                return dispNameLen;            }        }else{            /* we have not found the display name for the value .. just copy over */            if(keywordValueLen <= destCapacity){                u_charsToUChars(keywordValue, dest, keywordValueLen);                return u_terminateUChars(dest, destCapacity, keywordValueLen, status);            }else{                 *status = U_BUFFER_OVERFLOW_ERROR;                return keywordValueLen;            }        }            }else{        return _getStringOrCopyKey(U_ICUDATA_LANG, displayLocale,                                   _kTypes, keyword,                                    keywordValue,                                   keywordValue,                                   dest, destCapacity,                                   status);    }}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:87,


示例12: uloc_getDisplayName

//.........这里部分代码省略.........                                    }                                }                                /* reset for call below */                                if(*pErrorCode == U_BUFFER_OVERFLOW_ERROR) {                                    *pErrorCode=U_ZERO_ERROR;                                }                                int32_t vlen = uloc_getDisplayKeywordValue(locale, kw, displayLocale,                                                                           p, cap, pErrorCode);                                if(len) {                                    if(vlen==0) {                                        --len; /* remove unneeded '=' */                                    }                                    /* restore cap and p to what they were at start */                                    cap=destCapacity-length;                                    if(cap <= 0) {                                        cap=0;                                    } else {                                        p=dest+length;                                    }                                }                                len+=vlen; /* total we added for key + '=' + value */                            }                        } break;                    } /* end switch */                    if (len>0) {                        /* we addeed a component, so add separator and write it if there's room. */                        if(len+sepLen<=cap) {                            const UChar * plimit = p + len;                            for (; p < plimit; p++) {                                if (*p == formatOpenParen) {                                    *p = formatReplaceOpenParen;                                } else if (*p == formatCloseParen) {                                    *p = formatReplaceCloseParen;                                }                            }                            for(int32_t i=0;i<sepLen;++i) {                                *p++=separator[i];                            }                        }                        length+=len+sepLen;                    } else if(subdone) {                        /* remove separator if we added it */                        if (length!=restPos) {                            length-=sepLen;                        }                        restLen=length-restPos;                        haveRest=restLen>0;                    }                }            }            if(*pErrorCode == U_BUFFER_OVERFLOW_ERROR) {                *pErrorCode=U_ZERO_ERROR;            }            if(subdone) {                if(haveLang && haveRest) {                    /* append internal portion of pattern, the first time,                       or last portion of pattern the second time */                    int32_t padLen;                    patPos+=subLen;                    padLen=(subi==0 ? sub1Pos : patLen)-patPos;                    if(length+padLen < destCapacity) {                        p=dest+length;                        for(int32_t i=0;i<padLen;++i) {                            *p++=pattern[patPos++];                        }                    } else {                        patPos+=padLen;                    }                    length+=padLen;                } else if(subi==0) {                    /* don't have first component, reset for second component */                    sub0Pos=0;                    length=0;                } else if(length>0) {                    /* true length is the length of just the component we got. */                    length=haveLang?langLen:restLen;                    if(dest && sub0Pos!=0) {                        if (sub0Pos+length<=destCapacity) {                            /* first component not at start of result,                               but we have full component in buffer. */                            u_memmove(dest, dest+(haveLang?langPos:restPos), length);                        } else {                            /* would have fit, but didn't because of pattern prefix. */                            sub0Pos=0; /* stops initial padding (and a second retry,                                          so we won't end up here again) */                            retry=TRUE;                        }                    }                }                ++subi; /* move on to next substitution */            }        }    } while(retry);    return u_terminateUChars(dest, destCapacity, length, pErrorCode);}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:101,


示例13: u_strFromPunycode

//.........这里部分代码省略.........            }            if(w>0x7fffffff/(BASE-t)) {                /* integer overflow */                *pErrorCode=U_ILLEGAL_CHAR_FOUND;                return 0;            }            w*=BASE-t;        }        /*         * Modification from sample code:         * Increments destCPCount here,         * where needed instead of in for() loop tail.         */        ++destCPCount;        bias=adaptBias(i-oldi, destCPCount, (UBool)(oldi==0));        /*         * i was supposed to wrap around from (incremented) destCPCount to 0,         * incrementing n each time, so we'll fix that now:         */        if(i/destCPCount>(0x7fffffff-n)) {            /* integer overflow */            *pErrorCode=U_ILLEGAL_CHAR_FOUND;            return 0;        }        n+=i/destCPCount;        i%=destCPCount;        /* not needed for Punycode: */        /* if (decode_digit(n) <= BASE) return punycode_invalid_input; */        if(n>0x10ffff || U_IS_SURROGATE(n)) {            /* Unicode code point overflow */            *pErrorCode=U_ILLEGAL_CHAR_FOUND;            return 0;        }        /* Insert n at position i of the output: */        cpLength=U16_LENGTH(n);        if(dest!=NULL && ((destLength+cpLength)<=destCapacity)) {            int32_t codeUnitIndex;            /*             * Handle indexes when supplementary code points are present.             *             * In almost all cases, there will be only BMP code points before i             * and even in the entire string.             * This is handled with the same efficiency as with UTF-32.             *             * Only the rare cases with supplementary code points are handled             * more slowly - but not too bad since this is an insertion anyway.             */            if(i<=firstSupplementaryIndex) {                codeUnitIndex=i;                if(cpLength>1) {                    firstSupplementaryIndex=codeUnitIndex;                } else {                    ++firstSupplementaryIndex;                }            } else {                codeUnitIndex=firstSupplementaryIndex;                U16_FWD_N(dest, codeUnitIndex, destLength, i-codeUnitIndex);            }            /* use the UChar index codeUnitIndex instead of the code point index i */            if(codeUnitIndex<destLength) {                uprv_memmove(dest+codeUnitIndex+cpLength,                             dest+codeUnitIndex,                             (destLength-codeUnitIndex)*U_SIZEOF_UCHAR);                if(caseFlags!=NULL) {                    uprv_memmove(caseFlags+codeUnitIndex+cpLength,                                 caseFlags+codeUnitIndex,                                 destLength-codeUnitIndex);                }            }            if(cpLength==1) {                /* BMP, insert one code unit */                dest[codeUnitIndex]=(UChar)n;            } else {                /* supplementary character, insert two code units */                dest[codeUnitIndex]=U16_LEAD(n);                dest[codeUnitIndex+1]=U16_TRAIL(n);            }            if(caseFlags!=NULL) {                /* Case of last character determines uppercase flag: */                caseFlags[codeUnitIndex]=IS_BASIC_UPPERCASE(src[in-1]);                if(cpLength==2) {                    caseFlags[codeUnitIndex+1]=FALSE;                }            }        }        destLength+=cpLength;        U_ASSERT(destLength>=0);        ++i;    }    return u_terminateUChars(dest, destCapacity, destLength, pErrorCode);}
开发者ID:AlexanderPankiv,项目名称:node,代码行数:101,


示例14: idnaref_toUnicode

//.........这里部分代码省略.........        //step 4: Remove the ACE Prefix        b1Prime = b1 + ACE_PREFIX_LENGTH;        b1PrimeLen  = b1Len - ACE_PREFIX_LENGTH;        //step 5: Decode using punycode        b2Len = convertFromPuny(b1Prime,b1PrimeLen, b2, b2Capacity, *status);        //b2Len = u_strFromPunycode(b2, b2Capacity,b1Prime,b1PrimeLen, caseFlags, status);        if(*status == U_BUFFER_OVERFLOW_ERROR){            // redo processing of string            /* we do not have enough room so grow the buffer*/            b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);            if(b2==NULL){                *status = U_MEMORY_ALLOCATION_ERROR;                goto CLEANUP;            }            *status = U_ZERO_ERROR; // reset error                        b2Len =  convertFromPuny(b1Prime,b1PrimeLen, b2, b2Len, *status);            //b2Len = u_strFromPunycode(b2, b2Len,b1Prime,b1PrimeLen,caseFlags, status);        }                        //step 6:Apply toASCII        b3Len = idnaref_toASCII(b2,b2Len,b3,b3Capacity,options,parseError, status);        if(*status == U_BUFFER_OVERFLOW_ERROR){            // redo processing of string            /* we do not have enough room so grow the buffer*/            b3 = (UChar*) uprv_malloc(b3Len * U_SIZEOF_UCHAR);            if(b3==NULL){                *status = U_MEMORY_ALLOCATION_ERROR;                goto CLEANUP;            }            *status = U_ZERO_ERROR; // reset error                        b3Len =  idnaref_toASCII(b2,b2Len,b3,b3Len, options, parseError, status);                }        //bail out on error        if(U_FAILURE(*status)){            goto CLEANUP;        }        //step 7: verify        if(compareCaseInsensitiveASCII(b1, b1Len, b3, b3Len) !=0){            *status = U_IDNA_VERIFICATION_ERROR;             goto CLEANUP;        }        //step 8: return output of step 5        reqLength = b2Len;        if(b2Len <= destCapacity) {            uprv_memmove(dest, b2, b2Len * U_SIZEOF_UCHAR);        }    }else{        // verify that STD3 ASCII rules are satisfied        if(useSTD3ASCIIRules == TRUE){            if( srcIsLDH == FALSE /* source contains some non-LDH characters */                || src[0] ==  HYPHEN || src[srcLength-1] == HYPHEN){                *status = U_IDNA_STD3_ASCII_RULES_ERROR;                /* populate the parseError struct */                if(srcIsLDH==FALSE){                    // failPos is always set the index of failure                    uprv_syntaxError(src,failPos, srcLength,parseError);                }else if(src[0] == HYPHEN){                    // fail position is 0                     uprv_syntaxError(src,0,srcLength,parseError);                }else{                    // the last index in the source is always length-1                    uprv_syntaxError(src, (srcLength>0) ? srcLength-1 : srcLength, srcLength,parseError);                }                goto CLEANUP;            }        }        //copy the source to destination        if(srcLength <= destCapacity){            uprv_memmove(dest,src,srcLength * U_SIZEOF_UCHAR);        }        reqLength = srcLength;    }CLEANUP:    if(b1 != b1Stack){        uprv_free(b1);    }    if(b2 != b2Stack){        uprv_free(b2);    }    uprv_free(caseFlags);    //    delete prep;    return u_terminateUChars(dest, destCapacity, reqLength, status);}
开发者ID:andrewleech,项目名称:firebird,代码行数:101,


示例15: _strFromWCS

//.........这里部分代码省略.........            }else{                /* the source is not null terminated and we are                  * end of source so we copy the source to a temp buffer                 * null terminate it and convert wchar_ts to chars                 */                if(nulLen >= _STACK_BUFFER_CAPACITY){                    /* Should rarely occcur */                    /* allocate new buffer buffer */                    pWStack =(wchar_t*) uprv_malloc(sizeof(wchar_t) * (nulLen + 1));                    if(pWStack==NULL){                        *pErrorCode = U_MEMORY_ALLOCATION_ERROR;                        goto cleanup;                    }                }                if(nulLen>0){                    /* copy the contents to tempStack */                    uprv_memcpy(pWStack,pSrc,nulLen*sizeof(wchar_t));                }                            /* null terminate the tempBuffer */                pWStack[nulLen] =0 ;                            if(remaining < (nulLen * MB_CUR_MAX)){                    /* Should rarely occur */                    int32_t len = (pCSrc-pCSave);                    pCSrc = pCSave;                    /* we do not have enough room so grow the buffer*/                    u_growAnyBufferFromStatic(cStack,(void**)&pCSrc,&cStackCap,                           cStackCap+(nulLen*MB_CUR_MAX),len,sizeof(char));                    pCSave = pCSrc;                    pCSrc = pCSave+len;                    remaining = cStackCap-(pCSrc - pCSave);                }                /* convert to chars */                retVal = uprv_wcstombs(pCSrc,pWStack,remaining);                            pCSrc += retVal;                pSrc  += nulLen;                srcLength-=nulLen; /* decrement the srcLength */                break;            }        }    }    /* OK..now we have converted from wchar_ts to chars now      * convert chars to UChars      */    pCSrcLimit = pCSrc;    pCSrc = pCSave;    pTarget = target= dest;    pTargetLimit = dest + destCapacity;            conv= u_getDefaultConverter(pErrorCode);        if(U_FAILURE(*pErrorCode)|| conv==NULL){        goto cleanup;    }        for(;;) {                *pErrorCode = U_ZERO_ERROR;                /* convert to stack buffer*/        ucnv_toUnicode(conv,&pTarget,pTargetLimit,(const char**)&pCSrc,pCSrcLimit,NULL,(UBool)(pCSrc==pCSrcLimit),pErrorCode);                /* increment count to number written to stack */        count+= pTarget - target;                if(*pErrorCode==U_BUFFER_OVERFLOW_ERROR){            target = uStack;            pTarget = uStack;            pTargetLimit = uStack + _STACK_BUFFER_CAPACITY;        } else {            break;        }            }        if(pDestLength){        *pDestLength =count;    }    u_terminateUChars(dest,destCapacity,count,pErrorCode);    cleanup:     if(cStack != pCSave){        uprv_free(pCSave);    }    if(wStack != pWStack){        uprv_free(pWStack);    }        u_releaseDefaultConverter(conv);    return dest;}
开发者ID:Andproject,项目名称:platform_external_icu4c,代码行数:101,


示例16: uidna_IDNToUnicode

U_CAPI int32_t U_EXPORT2uidna_IDNToUnicode(  const UChar* src, int32_t srcLength,                     UChar* dest, int32_t destCapacity,                     int32_t options,                     UParseError* parseError,                     UErrorCode* status){    if(status == NULL || U_FAILURE(*status)){        return 0;    }    if((src==NULL) || (srcLength < -1) || (destCapacity<0) || (!dest && destCapacity > 0)){        *status = U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    int32_t reqLength = 0;    UStringPrepProfile* nameprep = usprep_openByType(USPREP_RFC3491_NAMEPREP, status);    if(U_FAILURE(*status)){        return 0;    }    //initialize pointers    UChar *delimiter = (UChar*)src;    UChar *labelStart = (UChar*)src;    UChar *currentDest = (UChar*) dest;    int32_t remainingLen = srcLength;    int32_t remainingDestCapacity = destCapacity;    int32_t labelLen = 0, labelReqLength = 0;    UBool done = FALSE;    for(;;){        labelLen = getNextSeparator(labelStart,remainingLen, &delimiter,&done);        // The RFC states that        // <quote>        // ToUnicode never fails. If any step fails, then the original input        // is returned immediately in that step.        // </quote>        // _internal_toUnicode will copy the label.        /*if(labelLen==0 && done==FALSE){            *status = U_IDNA_ZERO_LENGTH_LABEL_ERROR;            break;        }*/        labelReqLength = _internal_toUnicode(labelStart, labelLen,                                             currentDest, remainingDestCapacity,                                             options, nameprep,                                             parseError, status);        if(*status == U_BUFFER_OVERFLOW_ERROR){            *status = U_ZERO_ERROR; // reset error            remainingDestCapacity = 0;        }        if(U_FAILURE(*status)){            break;        }        reqLength +=labelReqLength;        // adjust the destination pointer        if(labelReqLength < remainingDestCapacity){            currentDest = currentDest + labelReqLength;            remainingDestCapacity -= labelReqLength;        }else{            // should never occur            remainingDestCapacity = 0;        }        if(done == TRUE){            break;        }        // add the label separator        // Unlike the ToASCII operation we don't normalize the label separators        if(remainingDestCapacity > 0){            *currentDest++ = *(labelStart + labelLen);            remainingDestCapacity--;        }        reqLength++;        labelStart = delimiter;        if(remainingLen >0 ){            remainingLen = (int32_t)(srcLength - (delimiter - src));        }    }    if(reqLength > MAX_DOMAIN_NAME_LENGTH){        *status = U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR;    }    usprep_close(nameprep);    return u_terminateUChars(dest, destCapacity, reqLength, status);}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:98,


示例17: uidna_IDNToASCII

U_CAPI int32_t U_EXPORT2uidna_IDNToASCII(  const UChar *src, int32_t srcLength,                   UChar* dest, int32_t destCapacity,                   int32_t options,                   UParseError *parseError,                   UErrorCode *status){    if(status == NULL || U_FAILURE(*status)){        return 0;    }    if((src==NULL) || (srcLength < -1) || (destCapacity<0) || (!dest && destCapacity > 0)){        *status = U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    int32_t reqLength = 0;    UStringPrepProfile* nameprep = usprep_openByType(USPREP_RFC3491_NAMEPREP, status);    if(U_FAILURE(*status)){        return 0;    }    //initialize pointers    UChar *delimiter = (UChar*)src;    UChar *labelStart = (UChar*)src;    UChar *currentDest = (UChar*) dest;    int32_t remainingLen = srcLength;    int32_t remainingDestCapacity = destCapacity;    int32_t labelLen = 0, labelReqLength = 0;    UBool done = FALSE;    for(;;){        labelLen = getNextSeparator(labelStart,remainingLen, &delimiter,&done);        labelReqLength = 0;        if(!(labelLen==0 && done)){// make sure this is not a root label separator.            labelReqLength = _internal_toASCII( labelStart, labelLen,                                                currentDest, remainingDestCapacity,                                                options, nameprep,                                                parseError, status);            if(*status == U_BUFFER_OVERFLOW_ERROR){                *status = U_ZERO_ERROR; // reset error                remainingDestCapacity = 0;            }        }        if(U_FAILURE(*status)){            break;        }        reqLength +=labelReqLength;        // adjust the destination pointer        if(labelReqLength < remainingDestCapacity){            currentDest = currentDest + labelReqLength;            remainingDestCapacity -= labelReqLength;        }else{            // should never occur            remainingDestCapacity = 0;        }        if(done == TRUE){            break;        }        // add the label separator        if(remainingDestCapacity > 0){            *currentDest++ = FULL_STOP;            remainingDestCapacity--;        }        reqLength++;        labelStart = delimiter;        if(remainingLen >0 ){            remainingLen = (int32_t)(srcLength - (delimiter - src));        }    }    if(reqLength > MAX_DOMAIN_NAME_LENGTH){        *status = U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR;    }    usprep_close(nameprep);    return u_terminateUChars(dest, destCapacity, reqLength, status);}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:92,


示例18: _internal_toUnicode

//.........这里部分代码省略.........            b2Len =  u_strFromPunycode(b1Prime, b1PrimeLen, b2, b2Len, caseFlags, status);        }        //step 6:Apply toASCII        b3Len = uidna_toASCII(b2, b2Len, b3, b3Capacity, options, parseError, status);        if(*status == U_BUFFER_OVERFLOW_ERROR){            // redo processing of string            /* we do not have enough room so grow the buffer*/            b3 = (UChar*) uprv_malloc(b3Len * U_SIZEOF_UCHAR);            if(b3==NULL){                *status = U_MEMORY_ALLOCATION_ERROR;                goto CLEANUP;            }            *status = U_ZERO_ERROR; // reset error            b3Len =  uidna_toASCII(b2,b2Len,b3,b3Len,options,parseError, status);        }        //bail out on error        if(U_FAILURE(*status)){            goto CLEANUP;        }        //step 7: verify        if(compareCaseInsensitiveASCII(b1, b1Len, b3, b3Len) !=0){            // Cause the original to be returned.            *status = U_IDNA_VERIFICATION_ERROR;            goto CLEANUP;        }        //step 8: return output of step 5        reqLength = b2Len;        if(b2Len <= destCapacity) {            uprv_memmove(dest, b2, b2Len * U_SIZEOF_UCHAR);        }    }    else{        // See the start of this if statement for why this is commented out.        // verify that STD3 ASCII rules are satisfied        /*if(useSTD3ASCIIRules == TRUE){            if( srcIsLDH == FALSE // source contains some non-LDH characters                || src[0] ==  HYPHEN || src[srcLength-1] == HYPHEN){                *status = U_IDNA_STD3_ASCII_RULES_ERROR;                // populate the parseError struct                if(srcIsLDH==FALSE){                    // failPos is always set the index of failure                    uprv_syntaxError(src,failPos, srcLength,parseError);                }else if(src[0] == HYPHEN){                    // fail position is 0                    uprv_syntaxError(src,0,srcLength,parseError);                }else{                    // the last index in the source is always length-1                    uprv_syntaxError(src, (srcLength>0) ? srcLength-1 : srcLength, srcLength,parseError);                }                goto CLEANUP;            }        }*/        // just return the source        //copy the source to destination        if(srcLength <= destCapacity){            uprv_memmove(dest,src,srcLength * U_SIZEOF_UCHAR);        }        reqLength = srcLength;    }CLEANUP:    if(b1 != b1Stack && b1!=src){        uprv_free(b1);    }    if(b2 != b2Stack){        uprv_free(b2);    }    uprv_free(caseFlags);    // The RFC states that    // <quote>    // ToUnicode never fails. If any step fails, then the original input    // is returned immediately in that step.    // </quote>    // So if any step fails lets copy source to destination    if(U_FAILURE(*status)){        //copy the source to destination        if(dest && srcLength <= destCapacity){            // srcLength should have already been set earlier.            U_ASSERT(srcLength >= 0);            uprv_memmove(dest,src,srcLength * U_SIZEOF_UCHAR);        }        reqLength = srcLength;        *status = U_ZERO_ERROR;    }    return u_terminateUChars(dest, destCapacity, reqLength, status);}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:101,


示例19: _internal_toASCII

//.........这里部分代码省略.........        // 3(a) Verify the absence of non-LDH ASCII code points; that is, the        //  absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F.        // 3(b) Verify the absence of leading and trailing hyphen-minus; that        //  is, the absence of U+002D at the beginning and end of the        //  sequence.        if( srcIsLDH == FALSE /* source at this point should not contain anyLDH characters */            || b1[0] ==  HYPHEN || b1[b1Len-1] == HYPHEN){            *status = U_IDNA_STD3_ASCII_RULES_ERROR;            /* populate the parseError struct */            if(srcIsLDH==FALSE){                // failPos is always set the index of failure                uprv_syntaxError(b1,failPos, b1Len,parseError);            }else if(b1[0] == HYPHEN){                // fail position is 0                uprv_syntaxError(b1,0,b1Len,parseError);            }else{                // the last index in the source is always length-1                uprv_syntaxError(b1, (b1Len>0) ? b1Len-1 : b1Len, b1Len,parseError);            }            goto CLEANUP;        }    }    // Step 4: if the source is ASCII then proceed to step 8    if(srcIsASCII){        if(b1Len <= destCapacity){            uprv_memmove(dest, b1, b1Len * U_SIZEOF_UCHAR);            reqLength = b1Len;        }else{            reqLength = b1Len;            goto CLEANUP;        }    }else{        // step 5 : verify the sequence does not begin with ACE prefix        if(!startsWithPrefix(b1,b1Len)){            //step 6: encode the sequence with punycode            // do not preserve the case flags for now!            // TODO: Preserve the case while implementing the RFE            // caseFlags = (UBool*) uprv_malloc(b1Len * sizeof(UBool));            // uprv_memset(caseFlags,TRUE,b1Len);            b2Len = u_strToPunycode(b1,b1Len,b2,b2Capacity,caseFlags, status);            if(*status == U_BUFFER_OVERFLOW_ERROR){                // redo processing of string                /* we do not have enough room so grow the buffer*/                b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);                if(b2 == NULL){                    *status = U_MEMORY_ALLOCATION_ERROR;                    goto CLEANUP;                }                *status = U_ZERO_ERROR; // reset error                b2Len = u_strToPunycode(b1,b1Len,b2,b2Len,caseFlags, status);            }            //error bail out            if(U_FAILURE(*status)){                goto CLEANUP;            }            // TODO : Reconsider while implementing the case preserve RFE            // convert all codepoints to lower case ASCII            // toASCIILower(b2,b2Len);            reqLength = b2Len+ACE_PREFIX_LENGTH;            if(reqLength > destCapacity){                *status = U_BUFFER_OVERFLOW_ERROR;                goto CLEANUP;            }            //Step 7: prepend the ACE prefix            uprv_memcpy(dest,ACE_PREFIX,ACE_PREFIX_LENGTH * U_SIZEOF_UCHAR);            //Step 6: copy the contents in b2 into dest            uprv_memcpy(dest+ACE_PREFIX_LENGTH, b2, b2Len * U_SIZEOF_UCHAR);        }else{            *status = U_IDNA_ACE_PREFIX_ERROR;            //position of failure is 0            uprv_syntaxError(b1,0,b1Len,parseError);            goto CLEANUP;        }    }    // step 8: verify the length of label    if(reqLength > MAX_LABEL_LENGTH){        *status = U_IDNA_LABEL_TOO_LONG_ERROR;    }CLEANUP:    if(b1 != b1Stack){        uprv_free(b1);    }    if(b2 != b2Stack){        uprv_free(b2);    }    uprv_free(caseFlags);    return u_terminateUChars(dest, destCapacity, reqLength, status);}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:101,


示例20: ubidi_writeReordered

U_CAPI int32_t U_EXPORT2ubidi_writeReordered(UBiDi *pBiDi,                     UChar *dest, int32_t destSize,                     uint16_t options,                     UErrorCode *pErrorCode) {    const UChar *text;    UChar *saveDest;    int32_t length, destCapacity;    int32_t run, runCount, logicalStart, runLength;    if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {        return 0;    }    /* more error checking */    if( pBiDi==NULL ||        (text=pBiDi->text)==NULL || (length=pBiDi->length)<0 ||        destSize<0 || (destSize>0 && dest==NULL))    {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    /* do input and output overlap? */    if( dest!=NULL &&        ((text>=dest && text<dest+destSize) ||         (dest>=text && dest<text+pBiDi->originalLength)))    {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    if(length==0) {        /* nothing to do */        return u_terminateUChars(dest, destSize, 0, pErrorCode);    }    runCount=ubidi_countRuns(pBiDi, pErrorCode);    if(U_FAILURE(*pErrorCode)) {        return 0;    }    /* destSize shrinks, later destination length=destCapacity-destSize */    saveDest=dest;    destCapacity=destSize;    /*     * Option "insert marks" implies UBIDI_INSERT_LRM_FOR_NUMERIC if the     * reordering mode (checked below) is appropriate.     */    if(pBiDi->reorderingOptions & UBIDI_OPTION_INSERT_MARKS) {        options|=UBIDI_INSERT_LRM_FOR_NUMERIC;        options&=~UBIDI_REMOVE_BIDI_CONTROLS;    }    /*     * Option "remove controls" implies UBIDI_REMOVE_BIDI_CONTROLS     * and cancels UBIDI_INSERT_LRM_FOR_NUMERIC.     */    if(pBiDi->reorderingOptions & UBIDI_OPTION_REMOVE_CONTROLS) {        options|=UBIDI_REMOVE_BIDI_CONTROLS;        options&=~UBIDI_INSERT_LRM_FOR_NUMERIC;    }    /*     * If we do not perform the "inverse BiDi" algorithm, then we     * don't need to insert any LRMs, and don't need to test for it.     */    if((pBiDi->reorderingMode != UBIDI_REORDER_INVERSE_NUMBERS_AS_L) &&       (pBiDi->reorderingMode != UBIDI_REORDER_INVERSE_LIKE_DIRECT)  &&       (pBiDi->reorderingMode != UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL) &&       (pBiDi->reorderingMode != UBIDI_REORDER_RUNS_ONLY)) {        options&=~UBIDI_INSERT_LRM_FOR_NUMERIC;    }    /*     * Iterate through all visual runs and copy the run text segments to     * the destination, according to the options.     *     * The tests for where to insert LRMs ignore the fact that there may be     * BN codes or non-BMP code points at the beginning and end of a run;     * they may insert LRMs unnecessarily but the tests are faster this way     * (this would have to be improved for UTF-8).     *     * Note that the only errors that are set by doWriteXY() are buffer overflow     * errors. Ignore them until the end, and continue for preflighting.     */    if(!(options&UBIDI_OUTPUT_REVERSE)) {        /* forward output */        if(!(options&UBIDI_INSERT_LRM_FOR_NUMERIC)) {            /* do not insert BiDi controls */            for(run=0; run<runCount; ++run) {                if(UBIDI_LTR==ubidi_getVisualRun(pBiDi, run, &logicalStart, &runLength)) {                    runLength=doWriteForward(text+logicalStart, runLength,                                             dest, destSize,                                             (uint16_t)(options&~UBIDI_DO_MIRRORING), pErrorCode);                } else {                    runLength=doWriteReverse(text+logicalStart, runLength,                                             dest, destSize,                                             options, pErrorCode);                }                dest+=runLength;                destSize-=runLength;//.........这里部分代码省略.........
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:101,


示例21: caseMap

//.........这里部分代码省略.........    if(U_FAILURE(*pErrorCode)) {        return 0;    }    /* get the string length */    if(srcLength==-1) {        srcLength=u_strlen(src);    }    /* check for overlapping source and destination */    if( dest!=NULL &&        ((src>=dest && src<(dest+destCapacity)) ||         (dest>=src && dest<(src+srcLength)))    ) {        /* overlap: provide a temporary destination buffer and later copy the result */        if(destCapacity<=(sizeof(buffer)/U_SIZEOF_UCHAR)) {            /* the stack buffer is large enough */            temp=buffer;        } else {            /* allocate a buffer */            temp=(UChar *)uprv_malloc(destCapacity*U_SIZEOF_UCHAR);            if(temp==NULL) {                *pErrorCode=U_MEMORY_ALLOCATION_ERROR;                return 0;            }        }    } else {        temp=dest;    }    ownTitleIter=FALSE;    destLength=0;    if(toWhichCase==FOLD_CASE) {        destLength=ustr_foldCase(csp, temp, destCapacity, src, srcLength,                                 options, pErrorCode);    } else {        UCaseContext csc={ NULL };        int32_t locCache;        csc.p=(void *)src;        csc.limit=srcLength;        locCache=0;        /* the internal functions require locale!=NULL */        if(locale==NULL) {            locale=uloc_getDefault();        }        if(toWhichCase==TO_LOWER) {            destLength=_caseMap(csp, ucase_toFullLower,                                temp, destCapacity,                                src, &csc,                                0, srcLength,                                locale, &locCache, pErrorCode);        } else if(toWhichCase==TO_UPPER) {            destLength=_caseMap(csp, ucase_toFullUpper,                                temp, destCapacity,                                src, &csc,                                0, srcLength,                                locale, &locCache, pErrorCode);        } else /* if(toWhichCase==TO_TITLE) */ {    #if UCONFIG_NO_BREAK_ITERATION            *pErrorCode=U_UNSUPPORTED_ERROR;    #else            if(titleIter==NULL) {                titleIter=ubrk_open(UBRK_WORD, locale,                                    src, srcLength,                                    pErrorCode);                ownTitleIter=(UBool)U_SUCCESS(*pErrorCode);            }            if(U_SUCCESS(*pErrorCode)) {                destLength=_toTitle(csp, temp, destCapacity,                                    src, &csc, srcLength,                                    titleIter, locale, &locCache, pErrorCode);            }    #endif        }    }    if(temp!=dest) {        /* copy the result string to the destination buffer */        if(destLength>0) {            int32_t copyLength= destLength<=destCapacity ? destLength : destCapacity;            if(copyLength>0) {                uprv_memmove(dest, temp, copyLength*U_SIZEOF_UCHAR);            }        }        if(temp!=buffer) {            uprv_free(temp);        }    }#if !UCONFIG_NO_BREAK_ITERATION    if(ownTitleIter) {        ubrk_close(titleIter);    }#endif    return u_terminateUChars(dest, destCapacity, destLength, pErrorCode);}
开发者ID:mason105,项目名称:red5cpp,代码行数:101,


示例22: caseMap

static int32_tcaseMap(const UCaseMap *csm,        UChar *dest, int32_t destCapacity,        const UChar *src, int32_t srcLength,        int32_t toWhichCase,        UErrorCode *pErrorCode) {    UChar buffer[300];    UChar *temp;    int32_t destLength;    /* check argument values */    if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {        return 0;    }    if( destCapacity<0 ||        (dest==NULL && destCapacity>0) ||        src==NULL ||        srcLength<-1    ) {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    /* get the string length */    if(srcLength==-1) {        srcLength=u_strlen(src);    }    /* check for overlapping source and destination */    if( dest!=NULL &&        ((src>=dest && src<(dest+destCapacity)) ||         (dest>=src && dest<(src+srcLength)))    ) {        /* overlap: provide a temporary destination buffer and later copy the result */        if(destCapacity<=(sizeof(buffer)/U_SIZEOF_UCHAR)) {            /* the stack buffer is large enough */            temp=buffer;        } else {            /* allocate a buffer */            temp=(UChar *)uprv_malloc(destCapacity*U_SIZEOF_UCHAR);            if(temp==NULL) {                *pErrorCode=U_MEMORY_ALLOCATION_ERROR;                return 0;            }        }    } else {        temp=dest;    }    destLength=0;    if(toWhichCase==FOLD_CASE) {        destLength=ustr_foldCase(csm->csp, temp, destCapacity, src, srcLength,                                 csm->options, pErrorCode);    } else {        UCaseContext csc={ NULL };        csc.p=(void *)src;        csc.limit=srcLength;        if(toWhichCase==TO_LOWER) {            destLength=_caseMap(csm, ucase_toFullLower,                                temp, destCapacity,                                src, &csc,                                0, srcLength,                                pErrorCode);        } else if(toWhichCase==TO_UPPER) {            destLength=_caseMap(csm, ucase_toFullUpper,                                temp, destCapacity,                                src, &csc,                                0, srcLength,                                pErrorCode);        } else /* if(toWhichCase==TO_TITLE) */ {#if UCONFIG_NO_BREAK_ITERATION            *pErrorCode=U_UNSUPPORTED_ERROR;#else            /* UCaseMap is actually non-const in toTitle() APIs. */            destLength=_toTitle((UCaseMap *)csm, temp, destCapacity,                                src, &csc, srcLength,                                pErrorCode);#endif        }    }    if(temp!=dest) {        /* copy the result string to the destination buffer */        if(destLength>0) {            int32_t copyLength= destLength<=destCapacity ? destLength : destCapacity;            if(copyLength>0) {                uprv_memmove(dest, temp, copyLength*U_SIZEOF_UCHAR);            }        }        if(temp!=buffer) {            uprv_free(temp);        }    }    return u_terminateUChars(dest, destCapacity, destLength, pErrorCode);}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:99,


示例23: ustrcase_map

U_CFUNC int32_tustrcase_map(const UCaseMap *csm,             UChar *dest, int32_t destCapacity,             const UChar *src, int32_t srcLength,             UStringCaseMapper *stringCaseMapper,             UErrorCode *pErrorCode) {    UChar buffer[300];    UChar *temp;    int32_t destLength;    /* check argument values */    if(U_FAILURE(*pErrorCode)) {        return 0;    }    if( destCapacity<0 ||        (dest==NULL && destCapacity>0) ||        src==NULL ||        srcLength<-1    ) {        *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    /* get the string length */    if(srcLength==-1) {        srcLength=u_strlen(src);    }    /* check for overlapping source and destination */    if( dest!=NULL &&        ((src>=dest && src<(dest+destCapacity)) ||         (dest>=src && dest<(src+srcLength)))    ) {        /* overlap: provide a temporary destination buffer and later copy the result */        if(destCapacity<=UPRV_LENGTHOF(buffer)) {            /* the stack buffer is large enough */            temp=buffer;        } else {            /* allocate a buffer */            temp=(UChar *)uprv_malloc(destCapacity*U_SIZEOF_UCHAR);            if(temp==NULL) {                *pErrorCode=U_MEMORY_ALLOCATION_ERROR;                return 0;            }        }    } else {        temp=dest;    }    destLength=stringCaseMapper(csm, temp, destCapacity, src, srcLength, pErrorCode);    if(temp!=dest) {        /* copy the result string to the destination buffer */        if(destLength>0) {            int32_t copyLength= destLength<=destCapacity ? destLength : destCapacity;            if(copyLength>0) {                uprv_memmove(dest, temp, copyLength*U_SIZEOF_UCHAR);            }        }        if(temp!=buffer) {            uprv_free(temp);        }    }    return u_terminateUChars(dest, destCapacity, destLength, pErrorCode);}
开发者ID:119120119,项目名称:node,代码行数:66,


示例24: map

int32_t NamePrepTransform::process( const UChar* src, int32_t srcLength,                                     UChar* dest, int32_t destCapacity,                                     UBool allowUnassigned,                                    UParseError* parseError,                                    UErrorCode& status ){    // check error status    if(U_FAILURE(status)){        return 0;    }        //check arguments    if(src==NULL || srcLength<-1 || (dest==NULL && destCapacity!=0)) {        status=U_ILLEGAL_ARGUMENT_ERROR;        return 0;    }    UChar b1Stack[MAX_BUFFER_SIZE];    UChar *b1 = b1Stack;    int32_t b1Len,b1Capacity = MAX_BUFFER_SIZE;    int32_t b1Index = 0;    UCharDirection direction=U_CHAR_DIRECTION_COUNT, firstCharDir=U_CHAR_DIRECTION_COUNT;    UBool leftToRight=FALSE, rightToLeft=FALSE;    b1Len = map(src,srcLength, b1, b1Capacity,allowUnassigned,parseError, status);    if(status == U_BUFFER_OVERFLOW_ERROR){        // redo processing of string        /* we do not have enough room so grow the buffer*/        if(!u_growBufferFromStatic(b1Stack,&b1,&b1Capacity,b1Len,0)){            status = U_MEMORY_ALLOCATION_ERROR;            goto CLEANUP;        }        status = U_ZERO_ERROR; // reset error                b1Len = map(src,srcLength, b1, b1Len,allowUnassigned, parseError, status);            }    if(U_FAILURE(status)){        goto CLEANUP;    }    for(; b1Index<b1Len; ){        UChar32 ch = 0;        U16_NEXT(b1, b1Index, b1Len, ch);        if(prohibited.contains(ch) && ch!=0x0020){            status = U_IDNA_PROHIBITED_ERROR;            goto CLEANUP;        }        direction = u_charDirection(ch);        if(firstCharDir==U_CHAR_DIRECTION_COUNT){            firstCharDir = direction;        }        if(direction == U_LEFT_TO_RIGHT){            leftToRight = TRUE;        }        if(direction == U_RIGHT_TO_LEFT || direction == U_RIGHT_TO_LEFT_ARABIC){            rightToLeft = TRUE;        }    }               // satisfy 2    if( leftToRight == TRUE && rightToLeft == TRUE){        status = U_IDNA_CHECK_BIDI_ERROR;        goto CLEANUP;    }    //satisfy 3    if( rightToLeft == TRUE &&         !((firstCharDir == U_RIGHT_TO_LEFT || firstCharDir == U_RIGHT_TO_LEFT_ARABIC) &&          (direction == U_RIGHT_TO_LEFT || direction == U_RIGHT_TO_LEFT_ARABIC))       ){        status = U_IDNA_CHECK_BIDI_ERROR;        return FALSE;    }    if(b1Len <= destCapacity){        uprv_memmove(dest,b1, b1Len*U_SIZEOF_UCHAR);    }CLEANUP:    if(b1!=b1Stack){        uprv_free(b1);    }    return u_terminateUChars(dest, destCapacity, b1Len, &status);}
开发者ID:Andproject,项目名称:platform_external_icu4c,代码行数:94,


示例25: ucurr_forLocale

U_CAPI int32_t U_EXPORT2ucurr_forLocale(const char* locale,                UChar* buff,                int32_t buffCapacity,                UErrorCode* ec){    int32_t resLen = 0;    const UChar* s = NULL;    if (ec != NULL && U_SUCCESS(*ec)) {        if ((buff && buffCapacity) || !buffCapacity) {            UErrorCode localStatus = U_ZERO_ERROR;            char id[ULOC_FULLNAME_CAPACITY];            if ((resLen = uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus))) {                // there is a currency keyword. Try to see if it's valid                if(buffCapacity > resLen) {                    u_charsToUChars(id, buff, resLen);                }            } else {                // get country or country_variant in `id'                uint32_t variantType = idForLocale(locale, id, sizeof(id), ec);                if (U_FAILURE(*ec)) {                    return 0;                }#if !UCONFIG_NO_SERVICE                const UChar* result = CReg::get(id);                if (result) {                    if(buffCapacity > u_strlen(result)) {                        u_strcpy(buff, result);                    }                    return u_strlen(result);                }#endif                // Remove variants, which is only needed for registration.                char *idDelim = strchr(id, VAR_DELIM);                if (idDelim) {                    idDelim[0] = 0;                }                // Look up the CurrencyMap element in the root bundle.                UResourceBundle *rb = ures_openDirect(NULL, CURRENCY_DATA, &localStatus);                UResourceBundle *cm = ures_getByKey(rb, CURRENCY_MAP, rb, &localStatus);                UResourceBundle *countryArray = ures_getByKey(rb, id, cm, &localStatus);                UResourceBundle *currencyReq = ures_getByIndex(countryArray, 0, NULL, &localStatus);                s = ures_getStringByKey(currencyReq, "id", &resLen, &localStatus);                /*                Get the second item when PREEURO is requested, and this is a known Euro country.                If the requested variant is PREEURO, and this isn't a Euro country, assume                that the country changed over to the Euro in the future. This is probably                an old version of ICU that hasn't been updated yet. The latest currency is                probably correct.                */                if (U_SUCCESS(localStatus)) {                    if ((variantType & VARIANT_IS_PREEURO) && u_strcmp(s, EUR_STR) == 0) {                        currencyReq = ures_getByIndex(countryArray, 1, currencyReq, &localStatus);                        s = ures_getStringByKey(currencyReq, "id", &resLen, &localStatus);                    }                    else if ((variantType & VARIANT_IS_EURO)) {                        s = EUR_STR;                    }                }                ures_close(countryArray);                ures_close(currencyReq);                if ((U_FAILURE(localStatus)) && strchr(id, '_') != 0)                {                    // We don't know about it.  Check to see if we support the variant.                    uloc_getParent(locale, id, sizeof(id), ec);                    *ec = U_USING_FALLBACK_WARNING;                    return ucurr_forLocale(id, buff, buffCapacity, ec);                }                else if (*ec == U_ZERO_ERROR || localStatus != U_ZERO_ERROR) {                    // There is nothing to fallback to. Report the failure/warning if possible.                    *ec = localStatus;                }                if (U_SUCCESS(*ec)) {                    if(buffCapacity > resLen) {                        u_strcpy(buff, s);                    }                }            }            return u_terminateUChars(buff, buffCapacity, resLen, ec);        } else {            *ec = U_ILLEGAL_ARGUMENT_ERROR;        }    }    return resLen;}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:90,


示例26: idnaref_toASCII

//.........这里部分代码省略.........            *status = U_MEMORY_ALLOCATION_ERROR;            goto CLEANUP;        }        *status = U_ZERO_ERROR; // reset error                b1Len = prep->process(src,srcLength,b1, b1Len,allowUnassigned, parseError, *status);    }    // error bail out    if(U_FAILURE(*status)){        goto CLEANUP;    }    // step 3 & 4    for( j=0;j<b1Len;j++){        if(b1[j] > 0x7F){            srcIsASCII = FALSE;        }else if(prep->isLDHChar(b1[j])==FALSE){  // if the char is in ASCII range verify that it is an LDH character{            srcIsLDH = FALSE;        }    }        if(useSTD3ASCIIRules == TRUE){        // verify 3a and 3b        if( srcIsLDH == FALSE /* source contains some non-LDH characters */            || b1[0] ==  HYPHEN || b1[b1Len-1] == HYPHEN){            *status = U_IDNA_STD3_ASCII_RULES_ERROR;            goto CLEANUP;        }    }    if(srcIsASCII){        if(b1Len <= destCapacity){            uprv_memmove(dest, b1, b1Len * U_SIZEOF_UCHAR);            reqLength = b1Len;        }else{			reqLength = b1Len;            goto CLEANUP;        }    }else{        // step 5 : verify the sequence does not begin with ACE prefix        if(!startsWithPrefix(b1,b1Len)){            //step 6: encode the sequence with punycode            //caseFlags = (UBool*) uprv_malloc(b1Len * sizeof(UBool));            b2Len = convertToPuny(b1,b1Len, b2,b2Capacity,*status);            //b2Len = u_strToPunycode(b2,b2Capacity,b1,b1Len, caseFlags, status);            if(*status == U_BUFFER_OVERFLOW_ERROR){                // redo processing of string                /* we do not have enough room so grow the buffer*/                b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);                 if(b2 == NULL){                    *status = U_MEMORY_ALLOCATION_ERROR;                    goto CLEANUP;                }                *status = U_ZERO_ERROR; // reset error                                b2Len = convertToPuny(b1, b1Len, b2, b2Len, *status);                //b2Len = u_strToPunycode(b2,b2Len,b1,b1Len, caseFlags, status);            }            //error bail out            if(U_FAILURE(*status)){                goto CLEANUP;            }            reqLength = b2Len+ACE_PREFIX_LENGTH;            if(reqLength > destCapacity){                *status = U_BUFFER_OVERFLOW_ERROR;                goto CLEANUP;            }            //Step 7: prepend the ACE prefix            uprv_memcpy(dest,ACE_PREFIX,ACE_PREFIX_LENGTH * U_SIZEOF_UCHAR);            //Step 6: copy the contents in b2 into dest            uprv_memcpy(dest+ACE_PREFIX_LENGTH, b2, b2Len * U_SIZEOF_UCHAR);        }else{            *status = U_IDNA_ACE_PREFIX_ERROR;             goto CLEANUP;        }    }    if(reqLength > MAX_LABEL_LENGTH){        *status = U_IDNA_LABEL_TOO_LONG_ERROR;    }CLEANUP:    if(b1 != b1Stack){        uprv_free(b1);    }    if(b2 != b2Stack){        uprv_free(b2);    }    uprv_free(caseFlags);    //    delete prep;    return u_terminateUChars(dest, destCapacity, reqLength, status);}
开发者ID:andrewleech,项目名称:firebird,代码行数:101,


示例27: uloc_getDisplayName

//.........这里部分代码省略.........				/* keep preflighting */				*pErrorCode = U_ZERO_ERROR;			}		}		if (keywordCount > 1)		{			if (length + length3 + locSepLen <= destCapacity && keywordCount)			{				u_memcpy(dest + length + length3, dispLocSeparator, locSepLen);				length3 += locSepLen;			}		}	}	uenum_close(keywordEnum);	hasKeywords = length3 > 0;	length += length3;	if ((hasScript && !hasCountry)	    || ((hasScript || hasCountry) && !hasVariant && !hasKeywords)	    || ((hasScript || hasCountry || hasVariant) && !hasKeywords))	{		/* Remove separator  */		length -= locSepLen;	}	else if (hasLanguage && !hasScript && !hasCountry && !hasVariant && !hasKeywords)	{		/* Remove " (" */		length -= 2;	}	if (hasLanguage && (hasScript || hasCountry || hasVariant || hasKeywords))	{		/* append ")" */		if (length < destCapacity)		{			dest[length] = 0x29;		}		++length;		/* If the localized display pattern is something other than the default pattern of "{0} ({1})", then		 * then we need to do the formatting here.  It would be easier to use a messageFormat to do this, but we		 * can't since we don't have the APIs in the i18n library available to us at this point.		 */		if (locPatLen != defaultPatternLen ||		    u_strcmp(dispLocPattern, defaultPattern))  /* Something other than the default pattern */		{			UChar * p0 = u_strstr(dispLocPattern, pat0);			UChar * p1 = u_strstr(dispLocPattern, pat1);			u_terminateUChars(dest, destCapacity, length, pErrorCode);			if (p0 != NULL && p1 != NULL)     /* The pattern is well formed */			{				if (dest)				{					int32_t destLen = 0;					UChar * result = (UChar *)uprv_malloc((length + 1) * sizeof(UChar));					UChar * upos = (UChar *)dispLocPattern;					u_strcpy(result, dest);					dest[0] = 0;					while (*upos)					{						if (upos == p0)     /* Handle {0} substitution */						{							u_strncat(dest, result, p0Len);							destLen += p0Len;							dest[destLen] = 0; /* Null terminate */							upos += 3;						}						else if (upos == p1)       /* Handle {1} substitution */						{							UChar * p1Start = &result[p0Len + 2];							u_strncat(dest, p1Start, length - p0Len - 3);							destLen += (length - p0Len - 3);							dest[destLen] = 0; /* Null terminate */							upos += 3;						}						else     /* Something from the pattern not {0} or {1} */						{							u_strncat(dest, upos, 1);							upos++;							destLen++;							dest[destLen] = 0; /* Null terminate */						}					}					length = destLen;					uprv_free(result);				}			}		}	}	if (*pErrorCode == U_BUFFER_OVERFLOW_ERROR)	{		/* keep preflighting */		*pErrorCode = U_ZERO_ERROR;	}	return u_terminateUChars(dest, destCapacity, length, pErrorCode);}
开发者ID:Botyto,项目名称:Core,代码行数:101,


示例28: idnaref_IDNToUnicode

//.........这里部分代码省略.........                                      options, parseError, status);            if(*status == U_BUFFER_OVERFLOW_ERROR){                // redo processing of string                /* we do not have enough room so grow the buffer*/                b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);                if(b1==NULL){                    *status = U_MEMORY_ALLOCATION_ERROR;                    goto CLEANUP;                }                *status = U_ZERO_ERROR; // reset error                                b1Len = idnaref_toUnicode( labelStart, labelLen, b1, b1Len,                                            options, parseError, status);                            }                    if(U_FAILURE(*status)){                goto CLEANUP;            }            int32_t tempLen = (reqLength + b1Len );            // copy to dest            if( tempLen< destCapacity){                uprv_memmove(dest+reqLength, b1, b1Len * U_SIZEOF_UCHAR);            }            reqLength = tempLen;            // add the label separator            if(done == FALSE){                if(reqLength < destCapacity){                    dest[reqLength] = FULL_STOP;                }                reqLength++;            }            labelStart = delimiter;        }    }else{        for(;;){                        if(delimiter == src+srcLength){                break;            }            labelLen = getNextSeparator(labelStart, remainingLen, prep, &delimiter, &done, status);                        b1Len = idnaref_toUnicode( labelStart,labelLen, b1, b1Capacity,                                       options, parseError, status);            if(*status == U_BUFFER_OVERFLOW_ERROR){                // redo processing of string                /* we do not have enough room so grow the buffer*/                b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);                if(b1==NULL){                    *status = U_MEMORY_ALLOCATION_ERROR;                    goto CLEANUP;                }                *status = U_ZERO_ERROR; // reset error                                b1Len = idnaref_toUnicode( labelStart, labelLen, b1, b1Len,                                            options, parseError, status);                            }                    if(U_FAILURE(*status)){                goto CLEANUP;            }            int32_t tempLen = (reqLength + b1Len );            // copy to dest            if( tempLen< destCapacity){                uprv_memmove(dest+reqLength, b1, b1Len * U_SIZEOF_UCHAR);            }            reqLength = tempLen;            // add the label separator            if(done == FALSE){                if(reqLength < destCapacity){                    dest[reqLength] = FULL_STOP;                }                reqLength++;            }            labelStart = delimiter;            remainingLen = srcLength - (delimiter - src);        }    }CLEANUP:        if(b1 != b1Stack){        uprv_free(b1);    }    //    delete prep;        return u_terminateUChars(dest, destCapacity, reqLength, status);}
开发者ID:andrewleech,项目名称:firebird,代码行数:101,


示例29: u_strToPunycode

//.........这里部分代码省略.........        }    }    /* Finish the basic string - if it is not empty - with a delimiter. */    basicLength=destLength;    if(basicLength>0) {        if(destLength<destCapacity) {            dest[destLength]=DELIMITER;        }        ++destLength;    }    /*     * handledCPCount is the number of code points that have been handled     * basicLength is the number of basic code points     * destLength is the number of chars that have been output     */    /* Initialize the state: */    n=INITIAL_N;    delta=0;    bias=INITIAL_BIAS;    /* Main encoding loop: */    for(handledCPCount=basicLength; handledCPCount<srcCPCount; /* no op */) {        /*         * All non-basic code points < n have been handled already.         * Find the next larger one:         */        for(m=0x7fffffff, j=0; j<srcCPCount; ++j) {            q=cpBuffer[j]&0x7fffffff; /* remove case flag from the sign bit */            if(n<=q && q<m) {                m=q;            }        }        /*         * Increase delta enough to advance the decoder's         * <n,i> state to <m,0>, but guard against overflow:         */        if(m-n>(0x7fffffff-MAX_CP_COUNT-delta)/(handledCPCount+1)) {            *pErrorCode=U_INTERNAL_PROGRAM_ERROR;            return 0;        }        delta+=(m-n)*(handledCPCount+1);        n=m;        /* Encode a sequence of same code points n */        for(j=0; j<srcCPCount; ++j) {            q=cpBuffer[j]&0x7fffffff; /* remove case flag from the sign bit */            if(q<n) {                ++delta;            } else if(q==n) {                /* Represent delta as a generalized variable-length integer: */                for(q=delta, k=BASE; /* no condition */; k+=BASE) {                    /** RAM: comment out the old code for conformance with draft-ietf-idn-punycode-03.txt                    t=k-bias;                    if(t<TMIN) {                        t=TMIN;                    } else if(t>TMAX) {                        t=TMAX;                    }                    */                    t=k-bias;                    if(t<TMIN) {                        t=TMIN;                    } else if(k>=(bias+TMAX)) {                        t=TMAX;                    }                    if(q<t) {                        break;                    }                    if(destLength<destCapacity) {                        dest[destLength]=digitToBasic(t+(q-t)%(BASE-t), 0);                    }                    ++destLength;                    q=(q-t)/(BASE-t);                }                if(destLength<destCapacity) {                    dest[destLength]=digitToBasic(q, (UBool)(cpBuffer[j]<0));                }                ++destLength;                bias=adaptBias(delta, handledCPCount+1, (UBool)(handledCPCount==basicLength));                delta=0;                ++handledCPCount;            }        }        ++delta;        ++n;    }    return u_terminateUChars(dest, destCapacity, destLength, pErrorCode);}
开发者ID:AlexanderPankiv,项目名称:node,代码行数:101,



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


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