亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? xmltest.cpp

?? xml 簡(jiǎn)單解析器
?? CPP
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
   Test program for TinyXML.
*/


#include "tinyxml.h"

#ifdef TIXML_USE_STL
	#include <iostream>
	#include <sstream>
	using namespace std;
#else
	#include <stdio.h>
#endif

#if defined( WIN32 ) && defined( TUNE )
	#include <crtdbg.h>
	_CrtMemState startMemState;
	_CrtMemState endMemState;
#endif

static int gPass = 0;
static int gFail = 0;


bool XmlTest (const char* testString, const char* expected, const char* found, bool noEcho = false)
{
	bool pass = !strcmp( expected, found );
	if ( pass )
		printf ("[pass]");
	else
		printf ("[fail]");

	if ( noEcho )
		printf (" %s\n", testString);
	else
		printf (" %s [%s][%s]\n", testString, expected, found);

	if ( pass )
		++gPass;
	else
		++gFail;
	return pass;
}


bool XmlTest( const char* testString, int expected, int found, bool noEcho = false )
{
	bool pass = ( expected == found );
	if ( pass )
		printf ("[pass]");
	else
		printf ("[fail]");

	if ( noEcho )
		printf (" %s\n", testString);
	else
		printf (" %s [%d][%d]\n", testString, expected, found);

	if ( pass )
		++gPass;
	else
		++gFail;
	return pass;
}


//
// This file demonstrates some basic functionality of TinyXml.
// Note that the example is very contrived. It presumes you know
// what is in the XML file. But it does test the basic operations,
// and show how to add and remove nodes.
//

int main()
{
	//
	// We start with the 'demoStart' todo list. Process it. And
	// should hopefully end up with the todo list as illustrated.
	//
	const char* demoStart =
		/*"<?xml version=\"1.0\"  standalone='no' >\n"
		"<!-- Our to do list data -->"
		"<ToDo>\n"
		"<!-- Do I need a secure PDA? -->\n"
		"<Item priority=\"1\" distance='close'> Go to the <bold>Toy store!</bold></Item>"
		"<Item priority=\"2\" distance='none'> Do bills   </Item>"
		"<Item priority=\"2\" distance='far &amp; back'> Look for Evil Dinosaurs! </Item>"
		"</ToDo>";*/
"<root>"
	"<commands>"
		"<commanditem command=\"hexun_home_page\" commandtype=\"action\">"
			"<action owner=\"ie\" entry=\"http://www.hexun.com\" />"
		"</commanditem>"
		"<commanditem command=\"hexun_person_page\" commandtype=\"action\">"
			"<action owner=\"ie_inner\" entry=\"http://home.hexun.com/\" />"
		"</commanditem>"
		"<commanditem command=\"hexun_channels\" commandtype=\"menu\">"
			"<action owner=\"ie_inner\" caption=\"和訊股票\" entry=\"http://stock.hexun.com/\" />"
		"</commanditem>"
	"</commands>"
"</root>";


#ifdef TIXML_USE_STL
	/*	What the todo list should look like after processing.
		In stream (no formatting) representation. */
	const char* demoEnd =
		"<?xml version=\"1.0\" standalone=\"no\" ?>"
		"<!-- Our to do list data -->"
		"<ToDo>"
		"<!-- Do I need a secure PDA? -->"
		"<Item priority=\"2\" distance=\"close\">Go to the"
		"<bold>Toy store!"
		"</bold>"
		"</Item>"
		"<Item priority=\"1\" distance=\"far\">Talk to:"
		"<Meeting where=\"School\">"
		"<Attendee name=\"Marple\" position=\"teacher\" />"
		"<Attendee name=\"Voel\" position=\"counselor\" />"
		"</Meeting>"
		"<Meeting where=\"Lunch\" />"
		"</Item>"
		"<Item priority=\"2\" distance=\"here\">Do bills"
		"</Item>"
		"</ToDo>";
#endif

	// The example parses from the character string (above):
	#if defined( WIN32 ) && defined( TUNE )
	_CrtMemCheckpoint( &startMemState );
	#endif	

	{
		// Write to a file and read it back, to check file I/O.

		TiXmlDocument doc( "demotest.xml" );
		doc.Parse( demoStart );

		if ( doc.Error() )
		{
			printf( "Error in %s: %s\n", doc.Value(), doc.ErrorDesc() );
			getchar();
			exit( 1 );
		}
		doc.SaveFile();
	}

	TiXmlDocument doc( "demotest.xml" );
	bool loadOkay = doc.LoadFile();

	if ( !loadOkay )
	{
		printf( "Could not load test file 'demotest.xml'. Error='%s'. Exiting.\n", doc.ErrorDesc() );
		exit( 1 );
	}

	printf( "** Demo doc read from disk: ** \n\n" );
	doc.Print( stdout );

	TiXmlNode* node = 0;
	TiXmlElement* todoElement = 0;
	TiXmlElement* itemElement = 0;


	// --------------------------------------------------------
	// An example of changing existing attributes, and removing
	// an element from the document.
	// --------------------------------------------------------

	// Get the "ToDo" element.
	// It is a child of the document, and can be selected by name.
	node = doc.FirstChild( "ToDo" );
	assert( node );
	todoElement = node->ToElement();
	assert( todoElement  );

	// Going to the toy store is now our second priority...
	// So set the "priority" attribute of the first item in the list.
	node = todoElement->FirstChildElement();	// This skips the "PDA" comment.
	assert( node );
	itemElement = node->ToElement();
	assert( itemElement  );
	itemElement->SetAttribute( "priority", 2 );

	// Change the distance to "doing bills" from
	// "none" to "here". It's the next sibling element.
	itemElement = itemElement->NextSiblingElement();
	assert( itemElement );
	itemElement->SetAttribute( "distance", "here" );

	// Remove the "Look for Evil Dinosaurs!" item.
	// It is 1 more sibling away. We ask the parent to remove
	// a particular child.
	itemElement = itemElement->NextSiblingElement();
	todoElement->RemoveChild( itemElement );

	itemElement = 0;

	// --------------------------------------------------------
	// What follows is an example of created elements and text
	// nodes and adding them to the document.
	// --------------------------------------------------------

	// Add some meetings.
	TiXmlElement item( "Item" );
	item.SetAttribute( "priority", "1" );
	item.SetAttribute( "distance", "far" );

	TiXmlText text( "Talk to:" );

	TiXmlElement meeting1( "Meeting" );
	meeting1.SetAttribute( "where", "School" );

	TiXmlElement meeting2( "Meeting" );
	meeting2.SetAttribute( "where", "Lunch" );

	TiXmlElement attendee1( "Attendee" );
	attendee1.SetAttribute( "name", "Marple" );
	attendee1.SetAttribute( "position", "teacher" );

	TiXmlElement attendee2( "Attendee" );
	attendee2.SetAttribute( "name", "Voel" );
	attendee2.SetAttribute( "position", "counselor" );

	// Assemble the nodes we've created:
	meeting1.InsertEndChild( attendee1 );
	meeting1.InsertEndChild( attendee2 );

	item.InsertEndChild( text );
	item.InsertEndChild( meeting1 );
	item.InsertEndChild( meeting2 );

	// And add the node to the existing list after the first child.
	node = todoElement->FirstChild( "Item" );
	assert( node );
	itemElement = node->ToElement();
	assert( itemElement );

	todoElement->InsertAfterChild( itemElement, item );

	printf( "\n** Demo doc processed: ** \n\n" );
	doc.Print( stdout );


#ifdef TIXML_USE_STL
	printf( "** Demo doc processed to stream: ** \n\n" );
	cout << doc << endl << endl;
#endif

	// --------------------------------------------------------
	// Different tests...do we have what we expect?
	// --------------------------------------------------------

	int count = 0;
	TiXmlElement*	element;

	//////////////////////////////////////////////////////

#ifdef TIXML_USE_STL
	cout << "** Basic structure. **\n";
	ostringstream outputStream( ostringstream::out );
	outputStream << doc;
	XmlTest( "Output stream correct.",	string( demoEnd ).c_str(),
										outputStream.str().c_str(), true );
#endif

	node = doc.RootElement();
	XmlTest( "Root element exists.", true, ( node != 0 && node->ToElement() ) );
	XmlTest ( "Root element value is 'ToDo'.", "ToDo",  node->Value());

	node = node->FirstChild();
	XmlTest( "First child exists & is a comment.", true, ( node != 0 && node->ToComment() ) );
	node = node->NextSibling();
	XmlTest( "Sibling element exists & is an element.", true, ( node != 0 && node->ToElement() ) );
	XmlTest ( "Value is 'Item'.", "Item", node->Value() );

	node = node->FirstChild();
	XmlTest ( "First child exists.", true, ( node != 0 && node->ToText() ) );
	XmlTest ( "Value is 'Go to the'.", "Go to the", node->Value() );


	//////////////////////////////////////////////////////
	printf ("\n** Iterators. **\n");

	// Walk all the top level nodes of the document.
	count = 0;
	for( node = doc.FirstChild();
		 node;
		 node = node->NextSibling() )
	{
		count++;
	}
	XmlTest( "Top level nodes, using First / Next.", 3, count );

	count = 0;
	for( node = doc.LastChild();
		 node;
		 node = node->PreviousSibling() )
	{
		count++;
	}
	XmlTest( "Top level nodes, using Last / Previous.", 3, count );

	// Walk all the top level nodes of the document,
	// using a different syntax.
	count = 0;
	for( node = doc.IterateChildren( 0 );
		 node;
		 node = doc.IterateChildren( node ) )
	{
		count++;
	}
	XmlTest( "Top level nodes, using IterateChildren.", 3, count );

	// Walk all the elements in a node.
	count = 0;
	for( element = todoElement->FirstChildElement();
		 element;
		 element = element->NextSiblingElement() )
	{
		count++;
	}
	XmlTest( "Children of the 'ToDo' element, using First / Next.",
		3, count );

	// Walk all the elements in a node by value.
	count = 0;
	for( node = todoElement->FirstChild( "Item" );
		 node;
		 node = node->NextSibling( "Item" ) )
	{

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美在线观看一区二区三区| 久久精品理论片| 亚洲国产精品久久艾草纯爱| 天天综合天天综合色| 精品一区二区国语对白| hitomi一区二区三区精品| 91久久国产最好的精华液| 欧美精品一二三| 国产午夜亚洲精品午夜鲁丝片 | 国产69精品久久久久毛片| 9i在线看片成人免费| 欧美精品 国产精品| 久久久www成人免费毛片麻豆| 亚洲美女精品一区| 麻豆成人91精品二区三区| 成人av免费在线| 在线不卡a资源高清| 国产日韩欧美精品在线| 亚洲永久免费av| 国产一二精品视频| 欧美亚洲图片小说| 欧美精品一区二区三区在线播放| 亚洲欧美精品午睡沙发| 久久不见久久见免费视频7 | 亚洲国产你懂的| 国产精品资源网| 欧美日韩不卡一区| 国产精品网站在线观看| 日韩av电影天堂| 波多野洁衣一区| 欧美日韩精品欧美日韩精品一| 成人小视频在线| 久久久久久久久久久黄色| 久久品道一品道久久精品| 国产一区 二区 三区一级| 欧美成人r级一区二区三区| 日韩国产一区二| 91精品国产美女浴室洗澡无遮挡| 久久日韩精品一区二区五区| 日韩激情av在线| 欧美视频一区二区在线观看| 一区二区高清视频在线观看| 91女厕偷拍女厕偷拍高清| 亚洲欧洲国产日本综合| 成人av在线一区二区三区| 国产精品网站在线| 成人午夜免费av| 国产精品久久久久久久久免费丝袜| 成人午夜视频网站| 自拍av一区二区三区| 色综合中文字幕国产 | 日日夜夜免费精品| 欧美日高清视频| 首页国产丝袜综合| 日韩欧美国产一二三区| 九一久久久久久| 欧美国产日韩亚洲一区| 91丝袜美腿高跟国产极品老师 | 欧美电影免费观看高清完整版在线观看 | 亚洲福利电影网| 正在播放亚洲一区| 九色综合狠狠综合久久| 久久久久亚洲蜜桃| 成人午夜av电影| 亚洲欧美另类图片小说| 欧美日韩国产中文| 久久99精品久久久| 欧美日韩在线播放| 午夜精品一区二区三区免费视频 | 韩国一区二区在线观看| 日韩精品中文字幕在线不卡尤物 | 欧美一级专区免费大片| 美国av一区二区| 日韩欧美国产高清| 国产一区激情在线| 欧美激情在线免费观看| 99久久伊人久久99| 亚洲精品第1页| 欧美日本乱大交xxxxx| 免费精品视频在线| 久久久精品tv| 97久久精品人人澡人人爽| 亚洲男人天堂一区| 欧美日韩不卡一区| 美女mm1313爽爽久久久蜜臀| 亚洲精品一区在线观看| 国产精品一区免费视频| 国产精品美女久久久久久久网站| 99在线精品观看| 五月婷婷激情综合| 精品剧情在线观看| 不卡大黄网站免费看| 樱花影视一区二区| 精品国产乱码久久久久久免费| 国产91丝袜在线播放| 一区二区三区美女| 日韩一区和二区| 成人午夜在线免费| 亚洲成人av资源| 久久麻豆一区二区| 99精品视频在线播放观看| 日韩成人av影视| 亚洲国产精品精华液2区45| 色狠狠色噜噜噜综合网| 欧美aaaaa成人免费观看视频| 国产欧美一区二区三区在线看蜜臀 | 日本一区二区三区在线不卡| 成人短视频下载| 青青草成人在线观看| 国产精品卡一卡二卡三| 欧美日韩国产天堂| 国产一区激情在线| 亚洲国产欧美日韩另类综合| 精品国产一区二区三区四区四| 99视频国产精品| 激情六月婷婷久久| 一区二区三区四区视频精品免费 | 色悠悠亚洲一区二区| 久久精品国产亚洲5555| 亚洲国产精品自拍| 国产精品国产三级国产| 欧美成人vps| 欧美日韩在线播| 波多野结衣中文一区| 日本不卡不码高清免费观看| 成人免费小视频| 欧美日韩极品在线观看一区| 国产乱人伦偷精品视频不卡| 亚洲成a人片综合在线| 国产亚洲污的网站| 欧美一级午夜免费电影| 91蜜桃在线观看| 国产在线精品国自产拍免费| 五月天亚洲婷婷| 国产农村妇女毛片精品久久麻豆| 精品国产在天天线2019| 欧美日韩一级片网站| 成人动漫av在线| 激情欧美日韩一区二区| 性感美女久久精品| 亚洲精品国产第一综合99久久 | 91在线视频免费91| 国产一区二区在线观看免费| 亚洲成人777| 亚洲欧美电影一区二区| 久久久久久久综合日本| 欧美一区二区播放| 欧美精品丝袜中出| 精品视频一区二区不卡| av亚洲精华国产精华| 国产电影一区在线| 日精品一区二区| 秋霞国产午夜精品免费视频| 亚洲精品乱码久久久久久黑人| 亚洲欧美在线aaa| 欧美激情一区二区三区蜜桃视频| 久久久av毛片精品| 久久先锋影音av鲁色资源网| 日韩午夜激情视频| 91精品国产综合久久精品麻豆| 91成人国产精品| 不卡的av网站| 91老师国产黑色丝袜在线| 成人免费看视频| 高清av一区二区| 国产精品白丝av| 国产美女av一区二区三区| 国内欧美视频一区二区| 国产九九视频一区二区三区| 久久99精品网久久| 激情六月婷婷久久| 国产综合色视频| 国产老女人精品毛片久久| 国产麻豆午夜三级精品| 成人av午夜影院| 99久久国产综合精品女不卡| 波多野结衣精品在线| 91老师片黄在线观看| 在线亚洲一区二区| 欧美日韩国产在线观看| 精品免费视频.| 久久一二三国产| 久久―日本道色综合久久| 国产欧美一区二区在线| 国产精品美女久久久久高潮| 国产精品白丝在线| 亚洲主播在线播放| 香港成人在线视频| 蜜臀av在线播放一区二区三区| 麻豆成人av在线| 国产传媒日韩欧美成人| 波多野结衣亚洲| 在线91免费看| 日韩精品一区在线| 国产日韩亚洲欧美综合| 亚洲精品国产a久久久久久| 免费成人在线视频观看| 成人午夜激情片| 欧美亚一区二区| 日韩一级二级三级|