亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? icutransservice.cpp

?? IBM的解析xml的工具Xerces的源代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
        , false        , &err    );    if ((err != U_ZERO_ERROR) && (err != U_BUFFER_OVERFLOW_ERROR))    {        if (orgTarget != (UChar*)toFill)            getMemoryManager()->deallocate(orgTarget);//delete [] orgTarget;        if (fFixed)        {            XMLCh tmpBuf[17];            XMLString::binToText((unsigned int)(*startTarget), tmpBuf, 16, 16, getMemoryManager());            ThrowXMLwithMemMgr2            (                TranscodingException                , XMLExcepts::Trans_BadSrcCP                , tmpBuf                , getEncodingName()                , getMemoryManager()            );        }        else        {            ThrowXMLwithMemMgr(TranscodingException, XMLExcepts::Trans_BadSrcSeq, getMemoryManager());        }    }    // Calculate the bytes eaten and store in caller's param    bytesEaten = startSrc - srcData;    // And the characters decoded    const unsigned int charsDecoded = startTarget - orgTarget;    //    //  Translate the array of char offsets into an array of character    //  sizes, which is what the transcoder interface semantics requires.    //  If its fixed, then we can optimize it.    //    if (fFixed)    {        const unsigned char fillSize = (unsigned char)ucnv_getMaxCharSize(fConverter);        memset(charSizes, fillSize, maxChars);    }     else    {        //        //  We have to convert the series of offsets into a series of        //  sizes. If just one char was decoded, then its the total bytes        //  eaten. Otherwise, do a loop and subtract out each element from        //  its previous element.        //        if (charsDecoded == 1)        {            charSizes[0] = (unsigned char)bytesEaten;        }         else        {            //  ICU does not return an extra element to allow us to figure            //  out the last char size, so we have to compute it from the            //  total bytes used.            unsigned int index;            for (index = 0; index < charsDecoded - 1; index++)            {                charSizes[index] = (unsigned char)(fSrcOffsets[index + 1]                                                    - fSrcOffsets[index]);            }            if( charsDecoded > 0 ) {                charSizes[charsDecoded - 1] = (unsigned char)(bytesEaten                                              - fSrcOffsets[charsDecoded - 1]);            }        }    }    //    //  If XMLCh and UChar are not the same size, then we need to copy over    //  the temp buffer to the new one.    //    if (sizeof(UChar) != sizeof(XMLCh))    {        XMLCh* outPtr = toFill;        startTarget = orgTarget;        for (unsigned int index = 0; index < charsDecoded; index++)            *outPtr++ = XMLCh(*startTarget++);        // And delete the temp buffer        getMemoryManager()->deallocate(orgTarget);//delete [] orgTarget;    }    // Return the chars we put into the target buffer    return charsDecoded;}unsigned intICUTranscoder::transcodeTo( const   XMLCh* const    srcData                            , const unsigned int    srcCount                            ,       XMLByte* const  toFill                            , const unsigned int    maxBytes                            ,       unsigned int&   charsEaten                            , const UnRepOpts       options){    //    //  Get a pointer to the buffer to transcode. If UChar and XMLCh are    //  the same size here, then use the original. Else, create a temp    //  one and put a janitor on it.    //    const UChar* srcPtr;    UChar* tmpBufPtr = 0;    if (sizeof(XMLCh) == sizeof(UChar))    {        srcPtr = (const UChar*)srcData;    }    else    {        tmpBufPtr = convertToUChar(srcData, srcCount, getMemoryManager());        srcPtr = tmpBufPtr;    }    ArrayJanitor<UChar> janTmpBuf(tmpBufPtr, getMemoryManager());    //    //  Set the appropriate callback so that it will either fail or use    //  the rep char. Remember the old one so we can put it back.    //    UErrorCode  err = U_ZERO_ERROR;    UConverterFromUCallback oldCB = NULL;    #if (U_ICU_VERSION_MAJOR_NUM < 2)    void* orgContent;    #else    const void* orgContent;    #endif    ucnv_setFromUCallBack    (        fConverter        , (options == UnRep_Throw) ? UCNV_FROM_U_CALLBACK_STOP                                   : UCNV_FROM_U_CALLBACK_SUBSTITUTE        , NULL        , &oldCB        , &orgContent        , &err    );    //    //  Ok, lets transcode as many chars as we we can in one shot. The    //  ICU API gives enough info not to have to do this one char by char.    //    XMLByte*        startTarget = toFill;    const UChar*    startSrc = srcPtr;    err = U_ZERO_ERROR;    ucnv_fromUnicode    (        fConverter        , (char**)&startTarget        , (char*)(startTarget + maxBytes)        , &startSrc        , srcPtr + srcCount        , 0        , false        , &err    );    // Rememember the status before we possibly overite the error code    const bool res = (err == U_ZERO_ERROR);    // Put the old handler back    err = U_ZERO_ERROR;    UConverterFromUCallback orgAction = NULL;    ucnv_setFromUCallBack(fConverter, oldCB, NULL, &orgAction, &orgContent, &err);    if (!res)    {        XMLCh tmpBuf[17];        XMLString::binToText((unsigned int)*startSrc, tmpBuf, 16, 16, getMemoryManager());        ThrowXMLwithMemMgr2        (            TranscodingException            , XMLExcepts::Trans_Unrepresentable            , tmpBuf            , getEncodingName()            , getMemoryManager()        );    }    // Fill in the chars we ate from the input    charsEaten = startSrc - srcPtr;    // Return the chars we stored    return startTarget - toFill;}bool ICUTranscoder::canTranscodeTo(const unsigned int toCheck) const{    //    //  If the passed value is really a surrogate embedded together, then    //  we need to break it out into its two chars. Else just one. While    //  we are ate it, convert them to UChar format if required.    //    UChar           srcBuf[2];    unsigned int    srcCount = 1;    if (toCheck & 0xFFFF0000)    {        srcBuf[0] = UChar((toCheck >> 10) + 0xD800);        srcBuf[1] = UChar(toCheck & 0x3FF) + 0xDC00;        srcCount++;    }     else    {        srcBuf[0] = UChar(toCheck);    }    //    //  Set the callback so that it will fail instead of using the rep char.    //  Remember the old one so we can put it back.    //     UErrorCode  err = U_ZERO_ERROR;     UConverterFromUCallback oldCB = NULL;     #if (U_ICU_VERSION_MAJOR_NUM < 2)     void* orgContent;     #else     const void* orgContent;     #endif     ucnv_setFromUCallBack         (         fConverter         , UCNV_FROM_U_CALLBACK_STOP         , NULL         , &oldCB         , &orgContent         , &err         );    // Set upa temp buffer to format into. Make it more than big enough    char            tmpBuf[64];    char*           startTarget = tmpBuf;    const UChar*    startSrc = srcBuf;    err = U_ZERO_ERROR;    ucnv_fromUnicode    (        fConverter        , &startTarget        , startTarget + 64        , &startSrc        , srcBuf + srcCount        , 0        , false        , &err    );    // Save the result before we overight the error code    const bool res = (err == U_ZERO_ERROR);    // Put the old handler back    err = U_ZERO_ERROR;    UConverterFromUCallback orgAction = NULL;    ucnv_setFromUCallBack(fConverter, oldCB, NULL, &orgAction, &orgContent, &err);    return res;}// ---------------------------------------------------------------------------//  ICULCPTranscoder: Constructors and Destructor// ---------------------------------------------------------------------------ICULCPTranscoder::ICULCPTranscoder(UConverter* const toAdopt) :    fConverter(toAdopt){}ICULCPTranscoder::~ICULCPTranscoder(){    // If there is a converter, ask ICU to clean it up    if (fConverter)    {        // <TBD> Does this actually delete the structure???        ucnv_close(fConverter);        fConverter = 0;    }}// ---------------------------------------------------------------------------//  ICULCPTranscoder: Constructors and Destructor// ---------------------------------------------------------------------------unsigned int ICULCPTranscoder::calcRequiredSize(const XMLCh* const srcText                                                , MemoryManager* const manager){    if (!srcText)        return 0;    //    //  We do two different versions of this, according to whether XMLCh    //  is the same size as UChar or not.    //    UErrorCode err = U_ZERO_ERROR;    int32_t targetCap;    if (sizeof(XMLCh) == sizeof(UChar))    {        // Use a faux scope to synchronize while we do this        {            XMLMutexLock lockConverter(&fMutex);            targetCap = ucnv_fromUChars            (                fConverter                , 0                , 0                , (const UChar*)srcText                , -1                , &err            );        }    }    else    {        // Copy the source to a local temp        UChar* tmpBuf = convertToUChar(srcText, 0, manager);        ArrayJanitor<UChar> janTmp(tmpBuf, manager);        // Use a faux scope to synchronize while we do this        {            XMLMutexLock lockConverter(&fMutex);            targetCap = ucnv_fromUChars            (                fConverter                , 0                , 0                , tmpBuf                , -1                , &err            );        }    }    if (err != U_BUFFER_OVERFLOW_ERROR)        return 0;    return (unsigned int)targetCap;}unsigned int ICULCPTranscoder::calcRequiredSize(const char* const srcText                                                , MemoryManager* const manager){    if (!srcText)        return 0;    int32_t targetCap;    UErrorCode err = U_ZERO_ERROR;    // Use a faux scope to synchronize while we do this    {        XMLMutexLock lockConverter(&fMutex);        targetCap = ucnv_toUChars        (            fConverter            , 0            , 0            , srcText            , strlen(srcText)            , &err        );    }    if (err != U_BUFFER_OVERFLOW_ERROR)        return 0;#if (U_ICU_VERSION_MAJOR_NUM < 2)    // Subtract one since it includes the terminator space    return (unsigned int)(targetCap - 1);#else    // Starting ICU 2.0, this is fixed and all ICU String functions have consistent NUL-termination behavior.    // The returned length is always the number of output UChar's, not counting an additional, terminating NUL.    return (unsigned int)(targetCap);#endif}char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode){    char* retBuf = 0;    // Check for a couple of special cases    if (!toTranscode)        return retBuf;    if (!*toTranscode)    {        retBuf = new char[1];        retBuf[0] = 0;        return retBuf;    }    //    //  Get the length of the source string since we'll have to use it in    //  a couple places below.    //    const unsigned int srcLen = XMLString::stringLen(toTranscode);    //    //  If XMLCh and UChar are not the same size, then we have to make a    //  temp copy of the text to pass to ICU.    //    const UChar* actualSrc;    UChar* ncActual = 0;    if (sizeof(XMLCh) == sizeof(UChar))    {        actualSrc = (const UChar*)toTranscode;    }     else    {        // Allocate a non-const temp buf, but store it also in the actual        ncActual = convertToUChar(toTranscode, 0, XMLPlatformUtils::fgMemoryManager);        actualSrc = ncActual;    }    // Insure that the temp buffer, if any, gets cleaned up via the nc pointer    ArrayJanitor<UChar> janTmp(ncActual, XMLPlatformUtils::fgMemoryManager);    // Caculate a return buffer size not too big, but less likely to overflow    int32_t targetLen = (int32_t)(srcLen * 1.25);    // Allocate the return buffer    retBuf = new char[targetLen + 1];    //    //  Lock now while we call the converter. Use a faux block to do the    //  lock so that it unlocks immediately afterwards.    //    UErrorCode err = U_ZERO_ERROR;    int32_t targetCap;    {        XMLMutexLock lockConverter(&fMutex);        targetCap = ucnv_fromUChars        (            fConverter            , retBuf            , targetLen + 1            , actualSrc            , -1            , &err        );    }    // If targetLen is not enough then buffer overflow might occur    if ((err == U_BUFFER_OVERFLOW_ERROR) || (err == U_STRING_NOT_TERMINATED_WARNING))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费看欧美美女黄的网站| 中文字幕高清一区| 亚洲成av人片在www色猫咪| 色综合色狠狠天天综合色| 亚洲欧美日韩一区二区| 在线中文字幕一区二区| 视频在线观看国产精品| 欧美成人一级视频| 国产剧情一区二区三区| 亚洲视频小说图片| 欧美日韩精品专区| 久久精品国产成人一区二区三区 | 成人av电影在线| 亚洲美女在线一区| 欧美一卡2卡三卡4卡5免费| 精品亚洲国内自在自线福利| 久久久欧美精品sm网站| 色域天天综合网| 丝袜亚洲另类丝袜在线| 久久久久久久网| 91久久久免费一区二区| 久久国产视频网| 欧美极品美女视频| 欧美日韩视频专区在线播放| 国内精品久久久久影院薰衣草| 中文子幕无线码一区tr| 欧美日韩中文国产| 成人做爰69片免费看网站| 亚洲一区二区三区自拍| 久久久影院官网| 欧美视频一区二区在线观看| 国产一区二区中文字幕| 亚洲精品日产精品乱码不卡| 欧美成人艳星乳罩| 91麻豆国产自产在线观看| 久久99精品久久久| 夜夜嗨av一区二区三区| 久久久久成人黄色影片| 7777女厕盗摄久久久| 成人一道本在线| 爽爽淫人综合网网站| 国产精品少妇自拍| 日韩一区二区视频在线观看| av一区二区三区| 精品制服美女丁香| 亚洲h在线观看| 国产精品看片你懂得| 日韩欧美高清dvd碟片| 欧美主播一区二区三区| av一区二区三区在线| 国产精品一区二区在线观看不卡| 亚洲国产一区在线观看| 中文字幕一区二区三区在线观看| 精品少妇一区二区三区日产乱码| 欧美日韩综合一区| 99riav久久精品riav| 国产剧情一区二区三区| 久久精品国产99| 日韩和欧美一区二区| 亚洲一区成人在线| 综合久久国产九一剧情麻豆| 日本一区二区电影| 久久女同互慰一区二区三区| 日韩一区二区三区av| 欧美色网站导航| 在线观看一区二区视频| 99精品久久免费看蜜臀剧情介绍| 国产一区二区三区四区五区入口 | 色综合天天性综合| 成人黄色国产精品网站大全在线免费观看 | 久久九九全国免费| 精品久久久三级丝袜| 日韩一区二区电影| 欧美成人官网二区| 欧美xxxxxxxx| 精品99999| 国产丝袜在线精品| 中文字幕av一区 二区| 国产精品美女久久久久久久| 亚洲国产高清在线| 国产精品久久久久久久久动漫| 国产精品青草久久| ●精品国产综合乱码久久久久| 中文无字幕一区二区三区| 日本一区二区高清| 亚洲免费在线观看| 亚洲国产精品久久人人爱蜜臀| 亚洲一区二区av在线| 三级亚洲高清视频| 韩国精品一区二区| 豆国产96在线|亚洲| 91小视频免费观看| 欧美日韩亚洲国产综合| 日韩三级在线免费观看| 久久只精品国产| 国产精品理论在线观看| 亚洲综合在线视频| 首页欧美精品中文字幕| 国产一区二区日韩精品| 波多野结衣91| 欧美性一级生活| 日韩你懂的在线播放| 国产欧美日韩在线看| 亚洲卡通动漫在线| 奇米影视一区二区三区| 国产精品夜夜爽| 色久优优欧美色久优优| 3d动漫精品啪啪一区二区竹菊| 精品处破学生在线二十三| 中文字幕一区二区三| 日精品一区二区| 国产馆精品极品| 在线免费一区三区| 欧美成人国产一区二区| 亚洲伦理在线免费看| 麻豆精品视频在线观看| 成人精品亚洲人成在线| 欧美日韩成人在线| 国产欧美一区二区在线| 亚洲黄色小视频| 韩国女主播成人在线观看| 91久久免费观看| 久久综合99re88久久爱| 亚洲丰满少妇videoshd| 国产成人免费视频一区| 欧美日韩国产美| 国产精品护士白丝一区av| 日本美女一区二区| 色网站国产精品| 久久久久久电影| 日韩高清一级片| 91丨九色丨蝌蚪丨老版| 久久久久久久综合狠狠综合| 亚洲电影在线播放| 成人国产亚洲欧美成人综合网| 日韩欧美二区三区| 亚洲成人精品一区| 91一区二区在线| 国产网红主播福利一区二区| 午夜成人免费视频| 91精品1区2区| 中文字幕欧美国产| 狠狠网亚洲精品| 欧美精品久久天天躁| 依依成人综合视频| av一区二区三区黑人| 国产午夜精品久久久久久免费视| 热久久一区二区| 欧美日韩视频专区在线播放| 1000精品久久久久久久久| 福利一区福利二区| 久久久久久久久久电影| 精品无人码麻豆乱码1区2区 | 日韩视频不卡中文| 日韩精品免费专区| 欧美日韩另类一区| 亚洲国产精品尤物yw在线观看| 91女厕偷拍女厕偷拍高清| 国产精品美女一区二区| 国产精品一线二线三线精华| 久久综合一区二区| 国精产品一区一区三区mba视频| 欧美丰满少妇xxxxx高潮对白| 亚洲一区二区三区在线播放| 日本韩国一区二区三区| 亚洲黄色免费网站| 欧美日韩在线直播| 日韩二区三区四区| 日韩三级伦理片妻子的秘密按摩| 免费成人在线播放| 精品国产亚洲在线| 蜜桃视频第一区免费观看| 欧美成人一区二区三区在线观看| 麻豆精品久久久| 精品国产免费人成电影在线观看四季| 国产一区二区主播在线| 国产三级欧美三级日产三级99| 国产一区二区三区四区五区入口 | 在线播放日韩导航| 日韩精品久久久久久| 日韩一区二区免费在线电影| 久久不见久久见免费视频1| 日韩欧美中文一区二区| 国产一区在线观看麻豆| 国产欧美日韩激情| www.66久久| 亚洲一区视频在线观看视频| 欧美日韩在线精品一区二区三区激情| 天堂久久一区二区三区| 日韩欧美一二三四区| 粉嫩aⅴ一区二区三区四区五区 | 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 亚洲午夜精品在线| 91精品国产色综合久久久蜜香臀| 精品中文字幕一区二区小辣椒 | eeuss影院一区二区三区 | 欧美精品丝袜久久久中文字幕| 喷白浆一区二区| 国产亚洲欧美色| 日本精品视频一区二区三区|