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


C++ TTiXmlNode::NextSibling方法代码示例

本文整理汇总了C++中TTiXmlNode::NextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ TTiXmlNode::NextSibling方法的具体用法?C++ TTiXmlNode::NextSibling怎么用?C++ TTiXmlNode::NextSibling使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TTiXmlNode的用法示例。


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

示例1: StreamOut

void TTiXmlElement::StreamOut( TTiXml_OSTREAM * stream ) const
{
	(*stream) << "<" << value;

	const TTiXmlAttribute* attrib;
	for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() )
	{	
		(*stream) << " ";
		attrib->StreamOut( stream );
	}

	// If this node has children, give it a closing tag. Else
	// make it an empty tag.
	TTiXmlNode* node;
	if ( firstChild )
	{ 		
		(*stream) << ">";

		for ( node = firstChild; node; node=node->NextSibling() )
		{
			node->StreamOut( stream );
		}
		(*stream) << "</" << value << ">";
	}
	else
	{
		(*stream) << " />";
	}
}
开发者ID:caoguoping,项目名称:warCraft,代码行数:29,代码来源:tinyxml.cpp

示例2: NextSiblingElement

TTiXmlElement* TTiXmlNode::NextSiblingElement( const char * _value )
{
	TTiXmlNode* node;

	for (	node = NextSibling( _value );
	node;
	node = node->NextSibling( _value ) )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
开发者ID:caoguoping,项目名称:warCraft,代码行数:13,代码来源:tinyxml.cpp

示例3: FirstChildElement

TTiXmlElement* TTiXmlNode::FirstChildElement()
{
	TTiXmlNode* node;

	for (	node = FirstChild();
			node;
			node = node->NextSibling() )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
开发者ID:caoguoping,项目名称:warCraft,代码行数:13,代码来源:tinyxml.cpp

示例4: CopyTo

void TTiXmlDocument::CopyTo( TTiXmlDocument* target ) const
{
	TTiXmlNode::CopyTo( target );

	target->error = error;
	target->errorDesc = errorDesc.c_str ();

	TTiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}	
}
开发者ID:caoguoping,项目名称:warCraft,代码行数:13,代码来源:tinyxml.cpp

示例5: Print

void TTiXmlElement::Print( FILE* cfile, int depth ) const
{
	int i;
	assert( cfile );
	for ( i=0; i<depth; i++ ) {
		fprintf( cfile, "    " );
	}

	fprintf( cfile, "<%s", value.c_str() );

	const TTiXmlAttribute* attrib;
	for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() )
	{
		fprintf( cfile, " " );
		attrib->Print( cfile, depth );
	}

	// There are 3 different formatting approaches:
	// 1) An element without children is printed as a <foo /> node
	// 2) An element with only a text child is printed as <foo> text </foo>
	// 3) An element with children is printed on multiple lines.
	TTiXmlNode* node;
	if ( !firstChild )
	{
		fprintf( cfile, " />" );
	}
	else if ( firstChild == lastChild && firstChild->ToText() )
	{
		fprintf( cfile, ">" );
		firstChild->Print( cfile, depth + 1 );
		fprintf( cfile, "</%s>", value.c_str() );
	}
	else
	{
		fprintf( cfile, ">" );

		for ( node = firstChild; node; node=node->NextSibling() )
		{
			if ( !node->ToText() )
			{
				fprintf( cfile, "\n" );
			}
			node->Print( cfile, depth+1 );
		}
		fprintf( cfile, "\n" );
		for( i=0; i<depth; ++i ) {
			fprintf( cfile, "    " );
		}
		fprintf( cfile, "</%s>", value.c_str() );
	}
}
开发者ID:edison9888,项目名称:LingPinWang,代码行数:51,代码来源:tinyxml.cpp

示例6: CopyTo

void TTiXmlDocument::CopyTo( TTiXmlDocument* target ) const
{
	TTiXmlNode::CopyTo( target );

	target->error = error;
	target->errorId = errorId;
	target->errorDesc = errorDesc;
	target->tabsize = tabsize;
	target->errorLocation = errorLocation;
	target->useMicrosoftBOM = useMicrosoftBOM;

	TTiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}	
}
开发者ID:edison9888,项目名称:LingPinWang,代码行数:17,代码来源:tinyxml.cpp


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