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

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

?? tinyxmlparser.c

?? 一個簡單的xml解析代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*www.sourceforge.net/projects/tinyxmlOriginal code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com)This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use thissoftware in a product, an acknowledgment in the product documentationwould be appreciated but is not required.2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.3. This notice may not be removed or altered from any source distribution.*/#include "tinyxml.h"#include <ctype.h>namespace ebtinyxml{//#define DEBUG_PARSER// Note tha "PutString" hardcodes the same list. This// is less flexible than it appears. Changing the entries// or order will break putstring.	TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] = {    { "&amp;",  5, '&'},    { "&lt;",   4, '<'},    { "&gt;",   4, '>'},    { "&quot;", 6, '\"'},    { "&apos;", 6, '\''}};const char* TiXmlBase::SkipWhiteSpace( const char* p ) {    if( !p || !*p ) {        return 0;    }    while( p && *p ) {        if( isspace( *p ) || *p == '\n' || *p =='\r' ) {     // Still using old rules for white space.            /* add errorLine to provide more error information. by zhoujunfeng */            if(*p == '\n') {                errorLine++;            }            ++p;        } else            break;    }    return p;}#ifdef TIXML_USE_STL/*static*/ bool TiXmlBase::StreamWhiteSpace( TIXML_ISTREAM * in, TIXML_STRING * tag ) {    for( ;; ) {        if( !in->good() ) return false;        int c = in->peek();        if( !IsWhiteSpace( c ) )            return true;        *tag += in->get();    }}/*static*/ bool TiXmlBase::StreamTo( TIXML_ISTREAM * in, int character, TIXML_STRING * tag ) {    while( in->good() ) {        int c = in->peek();        if( c == character )            return true;        in->get();        *tag += c;    }    return false;}#endifconst char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name ) {    *name = "";    assert( p );    // Names start with letters or underscores.    // After that, they can be letters, underscores, numbers,    // hyphens, or colons. (Colons are valid ony for namespaces,    // but tinyxml can't tell namespaces from names.)    if(    p && *p            && ( isalpha( (unsigned char) *p ) || *p == '_' ) ) {        while(      p && *p                    &&  (       isalnum( (unsigned char ) *p )                                 || *p == '_'                                || *p == '-'                                || *p == '.'                                || *p == ':' ) ) {            (*name) += *p;            ++p;        }        return p;    }    return 0;}const char* TiXmlBase::GetEntity( const char* p, char* value ) {    // Presume an entity, and pull it out.    TIXML_STRING ent;    int i;    // Ignore the &#x entities.    if(    strncmp( "&#x", p, 3 ) == 0            && *(p+3)            && *(p+4) ) {        *value = 0;        if( isalpha( *(p+3) ) ) *value += ( tolower( *(p+3) ) - 'a' + 10 ) * 16;        else                     *value += ( *(p+3) - '0' ) * 16;        if( isalpha( *(p+4) ) ) *value += ( tolower( *(p+4) ) - 'a' + 10 );        else                     *value += ( *(p+4) - '0' );        return p+6;    }    // Now try to match it.    for( i=0; i<NUM_ENTITY; ++i ) {        if( strncmp( entity[i].str, p, entity[i].strLength ) == 0 ) {            assert( strlen( entity[i].str ) == entity[i].strLength );            *value = entity[i].chr;            return( p + entity[i].strLength );        }    }    // So it wasn't an entity, its unrecognized, or something like that.    *value = *p;    // Don't put back the last one, since we return it!    return p+1;}bool TiXmlBase::StringEqual( const char* p,                             const char* tag,                             bool ignoreCase ) {    assert( p );    if( !p || !*p ) {        assert( 0 );        return false;    }    if( tolower( *p ) == tolower( *tag ) ) {        const char* q = p;        if(ignoreCase) {            while( *q && *tag && *q == *tag ) {                ++q;                ++tag;            }            if( *tag == 0 ) {        // Have we found the end of the tag, and everything equal?                return true;            }        } else {            while( *q && *tag && tolower( *q ) == tolower( *tag ) ) {                ++q;                ++tag;            }            if( *tag == 0 ) {                return true;            }        }    }    return false;}const char* TiXmlBase::ReadText(    const char* p,                                     TIXML_STRING * text,                                     bool trimWhiteSpace,                                     const char* endTag,                                     bool caseInsensitive ) {    *text = "";    if(    !trimWhiteSpace         // certain tags always keep whitespace           || !condenseWhiteSpace ) {   // if true, whitespace is always kept        // Keep all the white space.        while(    p && *p                  && !StringEqual( p, endTag, caseInsensitive )             ) {            char c;            p = GetChar( p, &c );            (* text) += c;        }    } else {        bool whitespace = false;        // Remove leading white space:        p = SkipWhiteSpace( p );        while(    p && *p                  && !StringEqual( p, endTag, caseInsensitive ) ) {            if( *p == '\r' || *p == '\n' ) {                whitespace = true;                ++p;            } else if( isspace( *p ) ) {                whitespace = true;                ++p;            } else {                // If we've found whitespace, add it before the                // new character. Any whitespace just becomes a space.                if( whitespace ) {                    (* text) += ' ';                    whitespace = false;                }                char c;                p = GetChar( p, &c );                (* text) += c;            }        }    }    return p + strlen( endTag );}#ifdef TIXML_USE_STLvoid TiXmlDocument::StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ) {    // The basic issue with a document is that we don't know what we're    // streaming. Read something presumed to be a tag (and hope), then    // identify it, and call the appropriate stream method on the tag.    //    // This "pre-streaming" will never read the closing ">" so the    // sub-tag can orient itself.    if( !StreamTo( in, '<', tag ) ) {        SetError( TIXML_ERROR_PARSING_EMPTY );        return;    }    while( in->good() ) {        int tagIndex = tag->length();        while( in->good() && in->peek() != '>' ) {            int c = in->get();            (*tag) += (char) c;        }        if( in->good() ) {            // We now have something we presume to be a node of             // some sort. Identify it, and call the node to            // continue streaming.            TiXmlNode* node = Identify( tag->c_str() + tagIndex );            if( node ) {                node->StreamIn( in, tag );                bool isElement = node->ToElement() != 0;                delete node;                node = 0;                // If this is the root element, we're done. Parsing will be                // done by the >> operator.                if( isElement ) {                    return;                }            } else {                SetError( TIXML_ERROR );                return;            }        }    }    // We should have returned sooner.    SetError( TIXML_ERROR );}#endifconst char* TiXmlDocument::Parse( const char* p ) {    // Parse away, at the document level. Since a document    // contains nothing but other tags, most of what happens    // here is skipping white space.    //    // In this variant (as opposed to stream and Parse) we    // read everything we can.    /* add errorLine to provide more error information. by zhoujunfeng */    errorLine = 1;    if( !p || !*p ) {        SetError( TIXML_ERROR_DOCUMENT_EMPTY );        return(const char*)false;    }    p = SkipWhiteSpace( p );    if( !p ) {        SetError( TIXML_ERROR_DOCUMENT_EMPTY );        return(const char*)false;    }    while( p && *p ) {        TiXmlNode* node = Identify( p );        if( node ) {            p = node->Parse( p );            LinkEndChild( node );        } else {            break;        }        p = SkipWhiteSpace( p );    }    // All is well.    return p;}TiXmlNode* TiXmlNode::Identify( const char* p ) {    TiXmlNode* returnNode = 0;    p = SkipWhiteSpace( p );    if( !p || !*p || *p != '<' ) {        return 0;    }    TiXmlDocument* doc = GetDocument();    p = SkipWhiteSpace( p );    if( !p || !*p ) {        return 0;    }    // What is this thing?     // - Elements start with a letter or underscore, but xml is reserved.    // - Comments: <!--    // - Decleration: <?xml    // - Everthing else is unknown to tinyxml.    //    const char* xmlHeader = { "<?xml"};    const char* commentHeader = { "<!--"};    if( StringEqual( p, xmlHeader, true ) ) {#ifdef DEBUG_PARSER        TIXML_LOG( "XML parsing Declaration\n" );#endif        returnNode = new TiXmlDeclaration();    } else if(    isalpha( *(p+1) )                  || *(p+1) == '_' ) {#ifdef DEBUG_PARSER        TIXML_LOG( "XML parsing Element\n" );#endif        returnNode = new TiXmlElement( "" );    } else if( StringEqual( p, commentHeader, false ) ) {#ifdef DEBUG_PARSER        TIXML_LOG( "XML parsing Comment\n" );#endif        returnNode = new TiXmlComment();    } else {#ifdef DEBUG_PARSER        TIXML_LOG( "XML parsing Unknown\n" );#endif        returnNode = new TiXmlUnknown();    }    if( returnNode ) {        // Set the parent, so it can report errors        returnNode->parent = this;        //p = returnNode->Parse( p );    } else {        if( doc )            doc->SetError( TIXML_ERROR_OUT_OF_MEMORY );    }    return returnNode;}#ifdef TIXML_USE_STLvoid TiXmlElement::StreamIn (TIXML_ISTREAM * in, TIXML_STRING * tag) {    // We're called with some amount of pre-parsing. That is, some of "this"    // element is in "tag". Go ahead and stream to the closing ">"    while( in->good() ) {        int c = in->get();        (*tag) += (char) c ;        if( c == '>' )            break;    }    if( tag->length() < 3 ) return;    // Okay...if we are a "/>" tag, then we're done. We've read a complete tag.    // If not, identify and stream.    if(    tag->at( tag->length() - 1 ) == '>'            && tag->at( tag->length() - 2 ) == '/' ) {        // All good!        return;    } else if( tag->at( tag->length() - 1 ) == '>' ) {        // There is more. Could be:        //		text        //		closing tag        //		another node.        for( ;; ) {            StreamWhiteSpace( in, tag );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久aaaa| 成人91在线观看| 成人黄色软件下载| 日韩一区国产二区欧美三区| 亚洲欧美日韩综合aⅴ视频| 免费成人在线视频观看| 91精彩视频在线| 国产区在线观看成人精品| 日韩福利电影在线| 91久久精品一区二区| 亚洲欧洲色图综合| 国产在线麻豆精品观看| 欧美福利一区二区| 亚洲国产精品久久久男人的天堂 | 欧美久久久久久久久久| 亚洲天堂网中文字| bt欧美亚洲午夜电影天堂| 欧美精品一区二区在线观看| 日本网站在线观看一区二区三区| 99re成人精品视频| 国产精品人成在线观看免费| 国产精品一区二区三区四区| 精品国产一二三| 免费精品视频最新在线| 91精品国产黑色紧身裤美女| 五月天中文字幕一区二区| 欧美少妇bbb| 亚洲v精品v日韩v欧美v专区| 欧美亚洲一区二区在线观看| 亚洲曰韩产成在线| 欧美日韩黄色一区二区| 亚洲国产日韩a在线播放性色| 日本丶国产丶欧美色综合| 一区二区三区久久久| 欧美体内she精高潮| 一区二区三区.www| 欧美日韩国产免费| 欧美aaaaa成人免费观看视频| 777欧美精品| 精油按摩中文字幕久久| 久久久99精品免费观看| 不卡的av在线| 亚洲自拍偷拍九九九| 91麻豆精品国产91久久久久| 麻豆精品视频在线观看视频| 国产亚洲美州欧州综合国| 丁香另类激情小说| 艳妇臀荡乳欲伦亚洲一区| 7777精品伊人久久久大香线蕉完整版| 日本不卡视频在线| 国产嫩草影院久久久久| 99久久国产综合精品色伊| 亚洲国产另类av| 精品伦理精品一区| 99在线视频精品| 午夜免费欧美电影| 国产亚洲一区二区三区四区 | 欧美精品久久一区| 国产麻豆精品视频| 亚洲男同1069视频| 日韩欧美在线综合网| 成人激情动漫在线观看| 亚洲一区二区免费视频| 久久女同精品一区二区| 91福利精品第一导航| 久久精品二区亚洲w码| 综合色天天鬼久久鬼色| 欧美一级日韩免费不卡| 99国内精品久久| 久久精品国内一区二区三区| 成人欧美一区二区三区黑人麻豆 | 午夜欧美大尺度福利影院在线看| 久久人人爽人人爽| 在线视频你懂得一区| 国产伦精品一区二区三区视频青涩| 国产精品视频九色porn| 欧美一区二区三区小说| 成人动漫精品一区二区| 蜜桃视频一区二区三区| 国产精品久久久久久久久免费相片 | 人禽交欧美网站| 日日欢夜夜爽一区| 亚洲欧美一区二区在线观看| 精品剧情v国产在线观看在线| 一本久久精品一区二区| 国产精品一区二区黑丝| 日韩福利电影在线观看| 一区二区三区丝袜| 一区在线中文字幕| 国产三级精品三级| 日韩欧美中文一区二区| 欧美日韩国产小视频| 91一区一区三区| 处破女av一区二区| 国产自产v一区二区三区c| 日韩专区中文字幕一区二区| 亚洲精品高清视频在线观看| 国产精品国产成人国产三级 | 精品在线观看免费| 丝袜美腿亚洲综合| 夜夜爽夜夜爽精品视频| 亚洲欧美区自拍先锋| 国产精品亲子伦对白| 国产精品免费视频网站| 久久免费看少妇高潮| 久久久www免费人成精品| 欧美成人一级视频| 欧美成人一级视频| 精品蜜桃在线看| 欧美xxxxxxxxx| 精品国产乱码久久久久久影片| 欧美一二三四在线| 日韩免费高清av| 精品成人免费观看| 久久伊人蜜桃av一区二区| 久久久一区二区| 国产精品私人自拍| 中文字幕在线视频一区| 亚洲色欲色欲www| 亚洲国产精品久久人人爱| 又紧又大又爽精品一区二区| 亚洲精品videosex极品| 一区二区三区欧美日| 亚洲第一福利一区| 美女视频第一区二区三区免费观看网站| 亚洲超碰精品一区二区| 老司机午夜精品| 国产精品亚洲人在线观看| 成人av网站在线观看免费| 91免费看`日韩一区二区| 欧美亚洲精品一区| 日韩一区二区三区在线视频| 精品99久久久久久| 国产色产综合产在线视频| 亚洲男人的天堂在线观看| 亚洲va国产va欧美va观看| 久久激五月天综合精品| 成人激情动漫在线观看| 欧美三级在线播放| 久久嫩草精品久久久精品一| 亚洲欧美另类综合偷拍| 日韩精品一级中文字幕精品视频免费观看| 日本伊人午夜精品| 成人免费毛片aaaaa**| 欧美日韩一区二区在线视频| 久久日韩粉嫩一区二区三区| 亚洲天堂av老司机| 日本亚洲天堂网| www.亚洲人| 欧美精品 日韩| 国产欧美一区二区精品秋霞影院| 亚洲欧美另类综合偷拍| 精品一区二区三区在线观看 | 国产精品萝li| 日本特黄久久久高潮| jvid福利写真一区二区三区| 欧美猛男超大videosgay| 国产精品嫩草99a| 久久精品国产免费| 在线观看国产日韩| 久久精品一区二区三区四区| 亚洲第一主播视频| 99国产精品一区| www精品美女久久久tv| 午夜激情一区二区| av电影在线观看一区| 精品国产123| 丝袜美腿一区二区三区| jizz一区二区| 亚洲精品一区在线观看| 五月婷婷综合在线| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩午夜激情视频| 午夜精品久久久久| 欧美在线一二三| 中文字幕视频一区| 国产91高潮流白浆在线麻豆 | 亚洲欧美视频在线观看视频| 激情图片小说一区| 日韩午夜激情视频| 首页国产丝袜综合| 91豆麻精品91久久久久久| 亚洲丝袜美腿综合| 成人午夜视频网站| 国产三级精品三级| 国产美女在线精品| 久久新电视剧免费观看| 秋霞电影一区二区| 日韩一级二级三级精品视频| 视频在线观看一区二区三区| 欧洲色大大久久| 一区二区国产视频| 91精品福利在线| 亚洲成人一二三| 91超碰这里只有精品国产| 亚洲大片精品永久免费| 欧美肥胖老妇做爰| 秋霞午夜鲁丝一区二区老狼| 7777精品伊人久久久大香线蕉最新版| 亚洲国产精品一区二区www|