当前位置: 首页>>代码示例>>C++>>正文


C++ TIXML_LOG函数代码示例

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


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

示例1: SkipWhiteSpace

TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding )
{
	TiXmlNode* returnNode = 0;

	p = SkipWhiteSpace( p, encoding );
	if( !p || !*p || *p != '<' )
	{
		return 0;
	}

	p = SkipWhiteSpace( p, encoding );

	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 = { "<!--" };
	const char* dtdHeader = { "<!" };
	const char* cdataHeader = { "<![CDATA[" };

	if ( StringEqual( p, xmlHeader, true, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Declaration\n" );
		#endif
		returnNode = new TiXmlDeclaration();
	}
	else if ( StringEqual( p, commentHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Comment\n" );
		#endif
		returnNode = new TiXmlComment();
	}
	else if ( StringEqual( p, cdataHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing CDATA\n" );
		#endif
		TiXmlText* text = new TiXmlText( "" );
		text->SetCDATA( true );
		returnNode = text;
	}
	else if ( StringEqual( p, dtdHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Unknown(1)\n" );
		#endif
		returnNode = new TiXmlUnknown();
	}
	else if (    IsAlpha( *(p+1), encoding )
			  || *(p+1) == '_' )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Element\n" );
		#endif
		returnNode = new TiXmlElement( "" );
	}
	else
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Unknown(2)\n" );
		#endif
		returnNode = new TiXmlUnknown();
	}

	if ( returnNode )
	{
		// Set the parent, so it can report errors
		returnNode->parent = this;
	}
	return returnNode;
}
开发者ID:fangbaolei,项目名称:EC700IR,代码行数:82,代码来源:tinyxmlparser.cpp

示例2: SkipWhiteSpace

TiXmlNode* TiXmlNode::Identify( const TIXML_CHAR* p, TiXmlEncoding encoding )
{
	TiXmlNode* returnNode = 0;

	p = SkipWhiteSpace( p, encoding );
	if( !p || !*p || *p != _TIXML_L('<') )
	{
		return 0;
	}

	TiXmlDocument* doc = GetDocument();
	p = SkipWhiteSpace( p, encoding );

	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 TIXML_CHAR* xmlHeader = { _TIXML_L("<?xml") };
	const TIXML_CHAR* commentHeader = { _TIXML_L("<!--") };
	const TIXML_CHAR* dtdHeader = { _TIXML_L("<!") };
	const TIXML_CHAR* cdataHeader = { _TIXML_L("<![CDATA[") };

	if ( StringEqual( p, xmlHeader, true, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( _TIXML_L("XML parsing Declaration\n") );
		#endif
		returnNode = new TiXmlDeclaration();
	}
	else if ( StringEqual( p, commentHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( _TIXML_L("XML parsing Comment\n") );
		#endif
		returnNode = new TiXmlComment();
	}
	else if ( StringEqual( p, cdataHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( _TIXML_L("XML parsing CDATA\n") );
		#endif
		TiXmlText* text = new TiXmlText( _TIXML_L("") );
		text->SetCDATA( true );
		returnNode = text;
	}
	else if ( StringEqual( p, dtdHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( _TIXML_L("XML parsing Unknown(1)\n") );
		#endif
		returnNode = new TiXmlUnknown();
	}
	else if (    IsAlpha( *(p+1), encoding )
			  || *(p+1) == _TIXML_L('_') )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( _TIXML_L("XML parsing Element\n") );
		#endif
		returnNode = new TiXmlElement( _TIXML_L("") );
	}
	else
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( _TIXML_L("XML parsing Unknown(2)\n") );
		#endif
		returnNode = new TiXmlUnknown();
	}

	if ( returnNode )
	{
		// Set the parent, so it can report errors
		returnNode->parent = this;
	}
	else
	{
		if ( doc )
			doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
	}
	return returnNode;
}
开发者ID:ThePirateOld,项目名称:four-mp,代码行数:88,代码来源:tinyxmlparser.cpp

示例3: SkipWhiteSpace

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;
    }
    else
    {
        if ( doc )
            doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0 );
    }
    return returnNode;
}
开发者ID:vovoid,项目名称:vsxu-archive,代码行数:70,代码来源:tinyxmlparser.cpp

示例4: SkipWhiteSpace

// We're expecting a tag; identify what kind here and allocate the
// appropriate type of node (but don't parse yet). We'll return null if
// we can't find a "<" as the next non-whitespace character, or if we
// find the "<" but it is followed by nothing but whitespace. Note that
// we're only looking at the beginning of the tag, we won't check to see
// if it is terminated properly.
TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding )
{
    TiXmlNode* returnNode = 0;

    p = SkipWhiteSpace( p, encoding );
    if( !p || !*p || *p != '<' )
    {
        return 0; // couldn't find the tag-opening "<"
    }

    TiXmlDocument* doc = GetDocument();
    p = SkipWhiteSpace( p, encoding );

    if ( !p || !*p )
    {
        return 0; // a lone "<" at the end of the document
    }

    // What is this thing?
    // - Elements:      < X    where X is a letter or underscore;
    //                         white space optional between "<" and "X".
    // - Comments:      <!--
    // - Declaration:   <?xml
    // - CDATA Text:    <![CDATA[
    // - All other tags are unknown to tinyxml.
    //

    const char* xmlHeader = { "<?xml" };
    const char* commentHeader = { "<!--" };
    const char* dtdHeader = { "<!" }; // treated as "unknown"
    const char* cdataHeader = { "<![CDATA[" };

    if ( StringEqual( p, xmlHeader, true, encoding ) )
    {
        #ifdef DEBUG_PARSER
            TIXML_LOG( "XML parsing Declaration\n" );
        #endif
        returnNode = new TiXmlDeclaration();
    }
    else if ( StringEqual( p, commentHeader, false, encoding ) )
    {
        #ifdef DEBUG_PARSER
            TIXML_LOG( "XML parsing Comment\n" );
        #endif
        returnNode = new TiXmlComment();
    }
    else if ( StringEqual( p, cdataHeader, false, encoding ) )
    {
        #ifdef DEBUG_PARSER
            TIXML_LOG( "XML parsing CDATA\n" );
        #endif
        TiXmlText* text = new TiXmlText( "" );
        text->SetCDATA( true );
        returnNode = text;
    }
    else if ( StringEqual( p, dtdHeader, false, encoding ) )
    {
        #ifdef DEBUG_PARSER
            TIXML_LOG( "XML parsing Unknown(1)\n" );
        #endif
        returnNode = new TiXmlUnknown();
    }
    else if (    IsAlpha( *(p+1), encoding )
              || *(p+1) == '_' )
    {
        #ifdef DEBUG_PARSER
            TIXML_LOG( "XML parsing Element\n" );
        #endif
        returnNode = new TiXmlElement( "" );
    }
    else
    {
        #ifdef DEBUG_PARSER
            TIXML_LOG( "XML parsing Unknown(2)\n" );
        #endif
        returnNode = new TiXmlUnknown();
    }

    if ( returnNode )
    {
        // Set the parent, so it can report errors
        returnNode->parent = this;
    }
    else
    {
        if ( doc )
            doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
    }
    return returnNode;
}
开发者ID:thomasklau,项目名称:simbody,代码行数:96,代码来源:tinyxmlparser.cpp


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