本文整理汇总了C++中TiXmlText::Column方法的典型用法代码示例。如果您正苦于以下问题:C++ TiXmlText::Column方法的具体用法?C++ TiXmlText::Column怎么用?C++ TiXmlText::Column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiXmlText
的用法示例。
在下文中一共展示了TiXmlText::Column方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
"\t<door wall='east'/>"
"</room>";
TiXmlDocument doc;
doc.Parse( str );
TiXmlHandle docHandle( &doc );
TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" );
TiXmlHandle commentHandle = docHandle.FirstChildElement( "room" ).FirstChild();
TiXmlHandle textHandle = docHandle.FirstChildElement( "room" ).ChildElement( "door", 0 ).FirstChild();
TiXmlHandle door0Handle = docHandle.FirstChildElement( "room" ).ChildElement( 0 );
TiXmlHandle door1Handle = docHandle.FirstChildElement( "room" ).ChildElement( 1 );
assert( docHandle.Node() );
assert( roomHandle.Element() );
assert( commentHandle.Node() );
assert( textHandle.Text() );
assert( door0Handle.Element() );
assert( door1Handle.Element() );
TiXmlDeclaration* declaration = doc.FirstChild()->ToDeclaration();
assert( declaration );
TiXmlElement* room = roomHandle.Element();
assert( room );
TiXmlAttribute* doors = room->FirstAttribute();
assert( doors );
TiXmlText* text = textHandle.Text();
TiXmlComment* comment = commentHandle.Node()->ToComment();
assert( comment );
TiXmlElement* door0 = door0Handle.Element();
TiXmlElement* door1 = door1Handle.Element();
XmlTest( "Location tracking: Declaration row", declaration->Row(), 1 );
XmlTest( "Location tracking: Declaration col", declaration->Column(), 5 );
XmlTest( "Location tracking: room row", room->Row(), 1 );
XmlTest( "Location tracking: room col", room->Column(), 45 );
XmlTest( "Location tracking: doors row", doors->Row(), 1 );
XmlTest( "Location tracking: doors col", doors->Column(), 51 );
XmlTest( "Location tracking: Comment row", comment->Row(), 2 );
XmlTest( "Location tracking: Comment col", comment->Column(), 3 );
XmlTest( "Location tracking: text row", text->Row(), 3 );
XmlTest( "Location tracking: text col", text->Column(), 24 );
XmlTest( "Location tracking: door0 row", door0->Row(), 3 );
XmlTest( "Location tracking: door0 col", door0->Column(), 5 );
XmlTest( "Location tracking: door1 row", door1->Row(), 4 );
XmlTest( "Location tracking: door1 col", door1->Column(), 5 );
}
{
const char* str = "\t<?xml version=\"1.0\" standalone=\"no\" ?>\t<room doors='2'>\n"
"</room>";
TiXmlDocument doc;
doc.SetTabSize( 8 );
doc.Parse( str );
TiXmlHandle docHandle( &doc );
TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" );
assert( docHandle.Node() );
assert( roomHandle.Element() );
TiXmlElement* room = roomHandle.Element();
assert( room );
TiXmlAttribute* doors = room->FirstAttribute();
assert( doors );
示例2: main
//.........这里部分代码省略.........
ele->SetAttribute( "str", "strValue" );
ele->SetAttribute( "int", 1 );
ele->SetDoubleAttribute( "double", -1.0 );
const char* cStr = ele->Attribute( "str" );
ele->QueryIntAttribute( "int", &iVal );
ele->QueryDoubleAttribute( "double", &dVal );
XmlTest( "Attribute round trip. c-string.", "strValue", cStr );
XmlTest( "Attribute round trip. int.", 1, iVal );
XmlTest( "Attribute round trip. double.", -1, (int)dVal );
}
{
const char* str = "\t<?xml version=\"1.0\" standalone=\"no\" ?>\t<room doors='2'>\n"
"</room>";
TiXmlDocument doc;
doc.SetTabSize( 8 );
doc.Parse( str );
TiXmlHandle docHandle( &doc );
TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" );
assert( docHandle.Node() );
assert( roomHandle.Element() );
TiXmlElement* room = roomHandle.Element();
assert( room );
TiXmlAttribute* doors = room->FirstAttribute();
assert( doors );
XmlTest( "Location tracking: Tab 8: room row", room->Row(), 1 );
XmlTest( "Location tracking: Tab 8: room col", room->Column(), 49 );
XmlTest( "Location tracking: Tab 8: doors row", doors->Row(), 1 );
XmlTest( "Location tracking: Tab 8: doors col", doors->Column(), 55 );
}
{
const char* str = "\t<?xml version=\"1.0\" standalone=\"no\" ?>\t<room doors='2'>\n"
" <!-- Silly example -->\n"
" <door wall='north'>A great door!</door>\n"
"\t<door wall='east'/>"
"</room>";
TiXmlDocument doc;
doc.Parse( str );
TiXmlHandle docHandle( &doc );
TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" );
TiXmlHandle commentHandle = docHandle.FirstChildElement( "room" ).FirstChild();
TiXmlHandle textHandle = docHandle.FirstChildElement( "room" ).ChildElement( "door", 0 ).FirstChild();
TiXmlHandle door0Handle = docHandle.FirstChildElement( "room" ).ChildElement( 0 );
TiXmlHandle door1Handle = docHandle.FirstChildElement( "room" ).ChildElement( 1 );
assert( docHandle.Node() );
assert( roomHandle.Element() );
assert( commentHandle.Node() );
assert( textHandle.Text() );
assert( door0Handle.Element() );
assert( door1Handle.Element() );
TiXmlDeclaration* declaration = doc.FirstChild()->ToDeclaration();
assert( declaration );
TiXmlElement* room = roomHandle.Element();
assert( room );
示例3: main
//.........这里部分代码省略.........
"\t<door wall='east'/>"
"</room>";
TiXmlDocument doc;
doc.Parse( str );
TiXmlHandle docHandle( &doc );
TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" );
TiXmlHandle commentHandle = docHandle.FirstChildElement( "room" ).FirstChild();
TiXmlHandle textHandle = docHandle.FirstChildElement( "room" ).ChildElement( "door", 0 ).FirstChild();
TiXmlHandle door0Handle = docHandle.FirstChildElement( "room" ).ChildElement( 0 );
TiXmlHandle door1Handle = docHandle.FirstChildElement( "room" ).ChildElement( 1 );
assert( docHandle.Node() );
assert( roomHandle.Element() );
assert( commentHandle.Node() );
assert( textHandle.Text() );
assert( door0Handle.Element() );
assert( door1Handle.Element() );
TiXmlDeclaration* declaration = doc.FirstChild()->ToDeclaration();
assert( declaration );
TiXmlElement* room = roomHandle.Element();
assert( room );
TiXmlAttribute* doors = room->FirstAttribute();
assert( doors );
TiXmlText* text = textHandle.Text();
TiXmlComment* comment = commentHandle.Node()->ToComment();
assert( comment );
TiXmlElement* door0 = door0Handle.Element();
TiXmlElement* door1 = door1Handle.Element();
XmlTest( "Location tracking: Declaration row", declaration->Row(), 1 );
XmlTest( "Location tracking: Declaration col", declaration->Column(), 5 );
XmlTest( "Location tracking: room row", room->Row(), 1 );
XmlTest( "Location tracking: room col", room->Column(), 45 );
XmlTest( "Location tracking: doors row", doors->Row(), 1 );
XmlTest( "Location tracking: doors col", doors->Column(), 51 );
XmlTest( "Location tracking: Comment row", comment->Row(), 2 );
XmlTest( "Location tracking: Comment col", comment->Column(), 3 );
XmlTest( "Location tracking: text row", text->Row(), 3 );
XmlTest( "Location tracking: text col", text->Column(), 24 );
XmlTest( "Location tracking: door0 row", door0->Row(), 3 );
XmlTest( "Location tracking: door0 col", door0->Column(), 5 );
XmlTest( "Location tracking: door1 row", door1->Row(), 4 );
XmlTest( "Location tracking: door1 col", door1->Column(), 5 );
}
{
const char* str = "\t<?xml version=\"1.0\" standalone=\"no\" ?>\t<room doors='2'>\n"
"</room>";
TiXmlDocument doc;
doc.SetTabSize( 8 );
doc.Parse( str );
TiXmlHandle docHandle( &doc );
TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" );
assert( docHandle.Node() );
assert( roomHandle.Element() );
TiXmlElement* room = roomHandle.Element();
assert( room );
TiXmlAttribute* doors = room->FirstAttribute();
assert( doors );