本文整理汇总了C++中TiXmlNode::StreamOut方法的典型用法代码示例。如果您正苦于以下问题:C++ TiXmlNode::StreamOut方法的具体用法?C++ TiXmlNode::StreamOut怎么用?C++ TiXmlNode::StreamOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiXmlNode
的用法示例。
在下文中一共展示了TiXmlNode::StreamOut方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StreamOut
void TiXmlElement::StreamOut( TIXML_OSTREAM * stream ) const
{
(*stream) << TEXT("<") << value;
TiXmlAttribute* attrib;
for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() )
{
(*stream) << TEXT(" ");
attrib->StreamOut( stream );
}
// If this node has children, give it a closing tag. Else
// make it an empty tag.
TiXmlNode* node;
if ( firstChild )
{
(*stream) << TEXT(">");
for ( node = firstChild; node; node=node->NextSibling() )
{
node->StreamOut( stream );
}
(*stream) << TEXT("</") << value << TEXT(">");
}
else
{
(*stream) << TEXT(" />");
}
}
示例2: StreamOut
void TiXmlElement::StreamOut( TIXML_OSTREAM * stream, bool unclosed ) const
{
(*stream) << "<" << value;
const TiXmlAttribute* 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.
TiXmlNode* node;
if ( firstChild )
{
(*stream) << ">";
for ( node = firstChild; node; node=node->NextSibling() )
{
node->StreamOut( stream );
}
(*stream) << (unclosed ? "<" : "</") << value << ">";
}
else
{
if ( unclosed )
(*stream) << " >";
else
(*stream) << " />";
}
}