本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}