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

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

?? xmlstring.cpp

?? IBM的解析xml的工具Xerces的源代碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/* * Copyright 1999-2004 The Apache Software Foundation. *  * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//* * $Id: XMLString.cpp,v 1.37 2004/09/28 09:35:05 amassari Exp $ */// ---------------------------------------------------------------------------//  Includes// ---------------------------------------------------------------------------#include <string.h>#include <ctype.h>#include <stdlib.h>#include <errno.h>#include <xercesc/util/XMLString.hpp>#include <xercesc/util/ArrayIndexOutOfBoundsException.hpp>#include <xercesc/util/IllegalArgumentException.hpp>#include <xercesc/util/NumberFormatException.hpp>#include <xercesc/util/OutOfMemoryException.hpp>#include <xercesc/util/RuntimeException.hpp>#include <xercesc/util/TranscodingException.hpp>#include <xercesc/util/Janitor.hpp>#include <xercesc/util/PlatformUtils.hpp>#include <xercesc/util/RefArrayVectorOf.hpp>#include <xercesc/util/TransService.hpp>#include <xercesc/util/XMLUniDefs.hpp>#include <xercesc/util/XMLUni.hpp>#include <xercesc/util/XMLUri.hpp>#include <xercesc/internal/XMLReader.hpp>XERCES_CPP_NAMESPACE_BEGIN// ---------------------------------------------------------------------------//  Local static data////  gConverter//      This is initialized when the user calls the platform init method,//      which calls our init method. This is the converter used for default//      conversion to/from the local code page.// ---------------------------------------------------------------------------static XMLLCPTranscoder*    gTranscoder = 0;static XMLCh                gNullStr[] ={    chOpenCurly, chLatin_n, chLatin_u, chLatin_l, chLatin_l, chCloseCurly, chNull};MemoryManager* XMLString::fgMemoryManager = 0;// ---------------------------------------------------------------------------//  XMLString: Public static methods// ---------------------------------------------------------------------------void XMLString::binToText(  const   unsigned long   toFormat                            ,       char* const     toFill                            , const unsigned int    maxChars                            , const unsigned int    radix                            , MemoryManager* const  manager){    static const char digitList[16] =    {          '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'        , 'A', 'B', 'C', 'D', 'E', 'F'    };    if (!maxChars)        ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager);    // Handle special case    if (!toFormat)    {        toFill[0] = '0';        toFill[1] = 0;        return;    }    // This is used to fill the temp buffer    unsigned int tmpIndex = 0;    // A copy of the conversion value that we can modify    unsigned int tmpVal = toFormat;    //    //  Convert into a temp buffer that we know is large enough. This avoids    //  having to check for overflow in the inner loops, and we have to flip    //  the resulting XMLString anyway.    //    char   tmpBuf[128];    //    //  For each radix, do the optimal thing. For bin and hex, we can special    //  case them and do shift and mask oriented stuff. For oct and decimal    //  there isn't much to do but bull through it with divides.    //    if (radix == 2)    {        while (tmpVal)        {            if (tmpVal & 0x1UL)                tmpBuf[tmpIndex++] = '1';            else                tmpBuf[tmpIndex++] = '0';            tmpVal >>= 1;        }    }     else if (radix == 16)    {        while (tmpVal)        {            const unsigned int charInd = (tmpVal & 0xFUL);            tmpBuf[tmpIndex++] = digitList[charInd];            tmpVal >>= 4;        }    }     else if ((radix == 8) || (radix == 10))    {        while (tmpVal)        {            const unsigned int charInd = (tmpVal % radix);            tmpBuf[tmpIndex++] = digitList[charInd];            tmpVal /= radix;        }    }    else    {        ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Str_UnknownRadix, manager);    }    // See if have enough room in the caller's buffer    if (tmpIndex > maxChars)    {        ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_TargetBufTooSmall, manager);    }    // Reverse the tmp buffer into the caller's buffer    unsigned int outIndex = 0;    for (; tmpIndex > 0; tmpIndex--)        toFill[outIndex++] = tmpBuf[tmpIndex-1];    // And cap off the caller's buffer    toFill[outIndex] = char(0);}void XMLString::binToText(  const   unsigned int    toFormat                            ,       char* const     toFill                            , const unsigned int    maxChars                            , const unsigned int    radix                            , MemoryManager* const  manager){    // Just call the unsigned long version    binToText((unsigned long)toFormat, toFill, maxChars, radix, manager);}void XMLString::binToText(  const   long            toFormat                            ,       char* const     toFill                            , const unsigned int    maxChars                            , const unsigned int    radix                            , MemoryManager* const  manager){    //    //  If its negative, then put a negative sign into the output and flip    //  the sign of the local temp value.    //    unsigned int startInd = 0;    unsigned long actualVal;    if (toFormat < 0)    {        toFill[0] = '-';        startInd++;        actualVal = (unsigned long)(toFormat * -1);    }     else    {        actualVal = (unsigned long)(toFormat);    }    // And now call the unsigned long version    binToText(actualVal, &toFill[startInd], maxChars, radix, manager);}void XMLString::binToText(  const   int             toFormat                            ,       char* const     toFill                            , const unsigned int    maxChars                            , const unsigned int    radix                            , MemoryManager* const  manager){    //    //  If its negative, then put a negative sign into the output and flip    //  the sign of the local temp value.    //    unsigned int startInd = 0;    unsigned long actualVal;    if (toFormat < 0)    {        toFill[0] = '-';        startInd++;        actualVal = (unsigned long)(toFormat * -1);    }     else    {        actualVal = (unsigned long)(toFormat);    }    // And now call the unsigned long version    binToText(actualVal, &toFill[startInd], maxChars, radix, manager);}void XMLString::catString(char* const target, const char* const src){    strcat(target, src);}int XMLString::compareIString(const char* const str1, const char* const str2){    return stricmp(str1, str2);}int XMLString::compareNString(  const   char* const     str1                                , const char* const     str2                                , const unsigned int    count){    // Watch for pathological secenario    if (!count)        return 0;    return strncmp(str1, str2, count);}int XMLString::compareNIString( const   char* const     str1                                , const char* const     str2                                , const unsigned int    count){    if (!count)        return 0;    return strnicmp(str1, str2, count);}int XMLString::compareString(   const   char* const    str1                                , const char* const    str2){    return strcmp(str1, str2);}void XMLString::copyString(         char* const    target                            , const char* const    src){    strcpy(target, src);}void XMLString::cut(        XMLCh* const    toCutFrom                    , const unsigned int    count){    #if defined(XML_DEBUG)    if (count > stringLen(toCutFrom))    {        // <TBD> This is bad of course    }    #endif    // If count is zero, then nothing to do    if (!count)        return;    XMLCh* targetPtr = toCutFrom;    XMLCh* srcPtr = toCutFrom + count;    while (*srcPtr)        *targetPtr++ = *srcPtr++;    // Cap it off at the new end    *targetPtr = 0;}unsigned int XMLString::hash(   const   char* const     tohash                                , const unsigned int    hashModulus                                , MemoryManager* const  manager){        if (!hashModulus)        ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_ZeroModulus, manager);    unsigned int hashVal = 0;    if (tohash) {        const char* curCh = tohash;        while (*curCh)        {            unsigned int top = hashVal >> 24;            hashVal += (hashVal * 37) + top + (unsigned int)(*curCh);            curCh++;        }    }    // Divide by modulus    return hashVal % hashModulus;}int XMLString::indexOf(const char* const toSearch, const char ch){    const unsigned int len = strlen(toSearch);    for (unsigned int i = 0; i < len; i++)    {        if (toSearch[i] == ch)            return i;    }    return -1;}int XMLString::indexOf( const   char* const     toSearch                        , const char            ch                        , const unsigned int    fromIndex                        , MemoryManager* const  manager){    const unsigned int len = strlen(toSearch);    // Make sure the start index is within the XMLString bounds	if ((int)fromIndex > ((int)len)-1)        ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);    for (unsigned int i = fromIndex; i < len; i++)    {        if (toSearch[i] == ch)            return i;    }    return -1;}int XMLString::lastIndexOf(const char* const toSearch, const char ch){    const int len = strlen(toSearch);    for (int i = len-1; i >= 0; i--)    {        if (toSearch[i] == ch)            return i;    }    return -1;}int XMLString::lastIndexOf( const   char* const     toSearch                            , const char            ch                            , const unsigned int    fromIndex                            , MemoryManager* const  manager){    const int len = strlen(toSearch);    // Make sure the start index is within the XMLString bounds	if ((int)fromIndex > len-1)        ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager);    for (int i = (int)fromIndex; i >= 0; i--)    {        if (toSearch[i] == ch)            return i;    }    return -1;}unsigned int XMLString::replaceTokens(          XMLCh* const    errText                                        , const unsigned int    maxChars                                        , const XMLCh* const    text1                                        , const XMLCh* const    text2                                        , const XMLCh* const    text3                                        , const XMLCh* const    text4                                        , MemoryManager* const  manager){    //    //  We have to build the string back into the source string, so allocate    //  a temp string and copy the orignal text to it. We'll then treat the    //  incoming buffer as a target buffer. Put a janitor on it to make sure    //  it gets cleaned up.    //    XMLCh* orgText = replicate(errText, manager);    ArrayJanitor<XMLCh> janText(orgText, manager);    XMLCh* pszSrc = orgText;    unsigned int curOutInd = 0;    while (*pszSrc && (curOutInd < maxChars))    {        //        //  Loop until we see a { character. Until we do, just copy chars        //  from src to target, being sure not to overrun the output buffer.        //        while ((*pszSrc != chOpenCurly) && (curOutInd < maxChars))        {            if (!*pszSrc)                break;            errText[curOutInd++] = *pszSrc++;        }        // If we did not find a curly, then we are done        if (*pszSrc != chOpenCurly)            break;        //        //  Probe this one to see if it matches our pattern of {x}. If not        //  then copy over those chars and go back to the first loop.        //        if ((*(pszSrc+1) >= chDigit_0)        &&  (*(pszSrc+1) <= chDigit_3)        &&  (*(pszSrc+2) == chCloseCurly))        {            //            //  Its one of our guys, so move the source pointer up past the            //  token we are replacing. First though get out the token number            //  character.            //            XMLCh tokCh = *(pszSrc+1);            pszSrc += 3;            // Now copy over the replacement text            const XMLCh* repText = 0;            if (tokCh == chDigit_0)                repText = text1;            else if (tokCh == chDigit_1)                repText = text2;            else if (tokCh == chDigit_2)                repText = text3;            else if (tokCh == chDigit_3)                repText = text4;            // If this one is null, copy over a null string            if (!repText)                repText = gNullStr;            while (*repText && (curOutInd < maxChars))                errText[curOutInd++] = *repText++;        }         else        {            // Escape the curly brace character and continue            errText[curOutInd++] = *pszSrc++;        }    }    // Copy over a null terminator    errText[curOutInd] = 0;    // And return the count of chars we output    return curOutInd;}XMLCh* XMLString::replicate(const XMLCh* const toRep){    // If a null string, return a null string!    XMLCh* ret = 0;    if (toRep)    {        const unsigned int len = stringLen(toRep);        ret = new XMLCh[len + 1];        memcpy(ret, toRep, (len + 1) * sizeof(XMLCh));    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月天久久比比资源色| 91网站在线播放| 亚洲福中文字幕伊人影院| 中文字幕在线观看一区二区| 亚洲精品一区二区三区蜜桃下载| 精品久久久久一区二区国产| 日本一区二区三区国色天香| 一个色综合av| 免费成人小视频| 大陆成人av片| 欧美日韩国产一区二区三区地区| 91精品国产全国免费观看| 日韩久久久久久| 欧美一卡二卡三卡| 国产女人水真多18毛片18精品视频| 2023国产精品自拍| 亚洲男人电影天堂| 欧美另类一区二区三区| 美女视频一区二区三区| 美女免费视频一区二区| 一区二区在线观看不卡| 首页国产丝袜综合| 91美女在线看| 欧美国产日本视频| 亚洲伦理在线免费看| 亚洲视频在线观看一区| 日韩一区日韩二区| 午夜精品视频一区| 成人av集中营| 欧美高清一级片在线| 91黄视频在线| 欧美一级理论性理论a| 欧美精品九九99久久| 欧美大片顶级少妇| 欧美性色aⅴ视频一区日韩精品| 9色porny自拍视频一区二区| 色婷婷久久久久swag精品| 中文字幕亚洲一区二区av在线| 国产成人一级电影| 国产精品国产三级国产有无不卡 | 色老汉一区二区三区| 一区二区三区在线视频免费| 欧美哺乳videos| 色婷婷激情一区二区三区| 亚洲成av人片一区二区梦乃| 国产午夜精品一区二区三区视频 | 国产精品综合在线视频| 亚洲成人免费影院| 国产精品污www在线观看| 欧美mv和日韩mv的网站| 成人污视频在线观看| 欧美人妇做爰xxxⅹ性高电影| 日韩一区二区三区在线| 欧美综合一区二区| 国产福利视频一区二区三区| 亚洲老司机在线| 欧美电视剧免费全集观看| 成人福利视频网站| 日本不卡1234视频| 一区二区三区毛片| 亚洲欧美一区二区久久| 日韩精品一区在线| 91麻豆福利精品推荐| 日韩影院免费视频| 久久久亚洲国产美女国产盗摄| 国产麻豆视频一区| 91精品国产美女浴室洗澡无遮挡| 91成人在线观看喷潮| 日韩一级片在线播放| 国产大片一区二区| 欧美人xxxx| 色综合天天狠狠| 99精品在线免费| 另类调教123区| 久久无码av三级| 波多野结衣精品在线| 欧美精品一区二区精品网| 91美女福利视频| 麻豆国产欧美一区二区三区| 精品日韩成人av| 国产伦精品一区二区三区免费| 日韩欧美色综合| 国产一区在线不卡| 一级中文字幕一区二区| 美女在线一区二区| 精品国产乱码久久久久久老虎| 成人黄色777网| 福利一区福利二区| av在线不卡观看免费观看| 懂色av中文一区二区三区 | 日韩精品电影在线| 免费欧美高清视频| 91黄色免费版| 亚洲精品久久7777| 国产福利一区二区三区视频在线| 色哦色哦哦色天天综合| 国产精品色一区二区三区| 国产精品乡下勾搭老头1| 91麻豆精品国产91久久久久久久久| 国产欧美视频在线观看| 久久精品久久综合| 欧美xxxx老人做受| 久久精品国产999大香线蕉| 欧美高清视频在线高清观看mv色露露十八 | 18欧美乱大交hd1984| 日韩美女在线视频| 久久精品一区二区三区不卡| 国产精品传媒入口麻豆| 久久成人麻豆午夜电影| 99久久精品国产网站| 精品国产污污免费网站入口 | 九一久久久久久| 久久精品免费观看| 99久久久久免费精品国产| 色综合久久久久久久久| 91麻豆免费观看| 欧美日韩国产高清一区二区三区 | 91视频一区二区| 国产一区美女在线| 欧美在线观看你懂的| 久久久久久久久99精品| 美女高潮久久久| 欧美二区三区的天堂| 日韩美女啊v在线免费观看| 国产一级精品在线| 日本韩国一区二区三区| 亚洲成av人片在线观看| 欧美成人精精品一区二区频| 成人综合在线网站| 亚洲国产精品久久人人爱蜜臀| 日韩欧美电影在线| 91国模大尺度私拍在线视频| 国产揄拍国内精品对白| 亚洲线精品一区二区三区八戒| 久久久另类综合| 日韩亚洲欧美高清| 色av成人天堂桃色av| 国产精品一区二区视频| 亚洲女同女同女同女同女同69| 国产亚洲一二三区| 日韩欧美一区二区视频| 亚洲电影一区二区| 欧美va在线播放| 久久国产精品一区二区| 国产精品区一区二区三| 91一区二区三区在线观看| 国产丝袜美腿一区二区三区| 91美女视频网站| 国产综合色视频| 亚洲人吸女人奶水| 欧美精品一区二区三区一线天视频 | 亚洲综合色自拍一区| 盗摄精品av一区二区三区| 精品精品国产高清a毛片牛牛| 日韩成人一级大片| 欧美日本一区二区三区四区| 精品一区二区三区视频| 日韩欧美国产一区二区在线播放| 欧美亚洲国产bt| 日韩精品综合一本久道在线视频| 不卡大黄网站免费看| 7777精品伊人久久久大香线蕉 | 欧美aⅴ一区二区三区视频| 色呦呦国产精品| 午夜私人影院久久久久| 久久久国产一区二区三区四区小说| 91在线视频在线| 粉嫩一区二区三区在线看| 九九视频精品免费| 国产尤物一区二区| 国产精品综合一区二区| 久久99国产精品久久99| 91精品久久久久久久91蜜桃| 精品va天堂亚洲国产| 精品剧情v国产在线观看在线| 欧美激情在线看| 婷婷激情综合网| 国产91富婆露脸刺激对白| 在线亚洲高清视频| 欧美韩国日本综合| 麻豆一区二区三| 92国产精品观看| 久久免费偷拍视频| 麻豆一区二区三区| 欧美少妇bbb| 亚洲乱码日产精品bd| 国产成人av一区二区三区在线| 欧美日本乱大交xxxxx| 国产清纯白嫩初高生在线观看91| 亚洲精品欧美在线| 蜜臀av一区二区在线免费观看 | 91蜜桃免费观看视频| 高清不卡在线观看| 色婷婷综合久久久久中文一区二区| 日本韩国精品在线| 日韩欧美国产电影| 国产欧美一区二区精品性色 | 中文字幕免费观看一区| 欧美电影免费观看高清完整版在线 | 亚洲最新视频在线播放|