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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tinyxml.cpp

?? xml 簡單解析器
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
	return 0;
}

TiXmlDocument* TiXmlNode::GetDocument()
{
	TiXmlNode* node;

	for( node = this; node; node = node->parent )
	{
		if ( node->ToDocument() )
			return node->ToDocument();
	}
	return 0;
}

TiXmlElement::TiXmlElement (const char * _value)
	: TiXmlNode( TiXmlNode::ELEMENT )
{
	firstChild = lastChild = 0;
	value = _value;
}


#ifdef TIXML_USE_STL
TiXmlElement::TiXmlElement( const std::string& _value ) 
	: TiXmlNode( TiXmlNode::ELEMENT )
{
	firstChild = lastChild = 0;
	value = _value;
}
#endif


TiXmlElement::TiXmlElement( const TiXmlElement& copy)
	: TiXmlNode( TiXmlNode::ELEMENT )
{
	firstChild = lastChild = 0;
	copy.CopyTo( this );	
}


void TiXmlElement::operator=( const TiXmlElement& base )
{
	ClearThis();
	base.CopyTo( this );
}


TiXmlElement::~TiXmlElement()
{
	ClearThis();
}


void TiXmlElement::ClearThis()
{
	Clear();
	while( attributeSet.First() )
	{
		TiXmlAttribute* node = attributeSet.First();
		attributeSet.Remove( node );
		delete node;
	}
}


const char * TiXmlElement::Attribute( const char * name ) const
{
	TIXML_STRING str( name );
	const TiXmlAttribute* node = attributeSet.Find( str );

	if ( node )
		return node->Value();

	return 0;
}


const char * TiXmlElement::Attribute( const char * name, int* i ) const
{
	const char * s = Attribute( name );
	if ( i )
	{
		if ( s )
			*i = atoi( s );
		else
			*i = 0;
	}
	return s;
}


const char * TiXmlElement::Attribute( const char * name, double* d ) const
{
	const char * s = Attribute( name );
	if ( d )
	{
		if ( s )
			*d = atof( s );
		else
			*d = 0;
	}
	return s;
}


int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const
{
	TIXML_STRING str( name );
	const TiXmlAttribute* node = attributeSet.Find( str );
	if ( !node )
		return TIXML_NO_ATTRIBUTE;

	return node->QueryIntValue( ival );
}


int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const
{
	TIXML_STRING str( name );
	const TiXmlAttribute* node = attributeSet.Find( str );
	if ( !node )
		return TIXML_NO_ATTRIBUTE;

	return node->QueryDoubleValue( dval );
}


void TiXmlElement::SetAttribute( const char * name, int val )
{	
	char buf[64];
	#if defined(TIXML_SNPRINTF)		
		TIXML_SNPRINTF( buf, sizeof(buf), "%d", val );
	#else
		sprintf( buf, "%d", val );
	#endif
	SetAttribute( name, buf );
}


#ifdef TIXML_USE_STL
void TiXmlElement::SetAttribute( const std::string& name, int val )
{	
   std::ostringstream oss;
   oss << val;
   SetAttribute( name, oss.str() );
}
#endif


void TiXmlElement::SetDoubleAttribute( const char * name, double val )
{	
	char buf[256];
	#if defined(TIXML_SNPRINTF)		
		TIXML_SNPRINTF( buf, sizeof(buf), "%f", val );
	#else
		sprintf( buf, "%f", val );
	#endif
	SetAttribute( name, buf );
}


void TiXmlElement::SetAttribute( const char * cname, const char * cvalue )
{
	TIXML_STRING _name( cname );
	TIXML_STRING _value( cvalue );

	TiXmlAttribute* node = attributeSet.Find( _name );
	if ( node )
	{
		node->SetValue( cvalue );
		return;
	}

	TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue );
	if ( attrib )
	{
		attributeSet.Add( attrib );
	}
	else
	{
		TiXmlDocument* document = GetDocument();
		if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
	}
}


#ifdef TIXML_USE_STL
void TiXmlElement::SetAttribute( const std::string& name, const std::string& _value )
{
	TiXmlAttribute* node = attributeSet.Find( name );
	if ( node )
	{
		node->SetValue( _value );
		return;
	}

	TiXmlAttribute* attrib = new TiXmlAttribute( name, _value );
	if ( attrib )
	{
		attributeSet.Add( attrib );
	}
	else
	{
		TiXmlDocument* document = GetDocument();
		if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
	}
}
#endif


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

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

	const TiXmlAttribute* 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.
	TiXmlNode* 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() );
	}
}

void TiXmlElement::StreamOut( TIXML_OSTREAM * stream ) 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) << "</" << value << ">";
	}
	else
	{
		(*stream) << " />";
	}
}


void TiXmlElement::CopyTo( TiXmlElement* target ) const
{
	// superclass:
	TiXmlNode::CopyTo( target );

	// Element class: 
	// Clone the attributes, then clone the children.
	const TiXmlAttribute* attribute = 0;
	for(	attribute = attributeSet.First();
	attribute;
	attribute = attribute->Next() )
	{
		target->SetAttribute( attribute->Name(), attribute->Value() );
	}

	TiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}
}


TiXmlNode* TiXmlElement::Clone() const
{
	TiXmlElement* clone = new TiXmlElement( Value() );
	if ( !clone )
		return 0;

	CopyTo( clone );
	return clone;
}


const char* TiXmlElement::GetText() const
{
	const TiXmlNode* child = this->FirstChild();
	if ( child ) {
		const TiXmlText* childText = child->ToText();
		if ( childText ) {
			return childText->Value();
		}
	}
	return 0;
}


TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT )
{
	tabsize = 4;
	useMicrosoftBOM = false;
	ClearError();
}

TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::DOCUMENT )
{
	tabsize = 4;
	useMicrosoftBOM = false;
	value = documentName;
	ClearError();
}


#ifdef TIXML_USE_STL
TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::DOCUMENT )
{
	tabsize = 4;
	useMicrosoftBOM = false;
    value = documentName;
	ClearError();
}
#endif


TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::DOCUMENT )
{
	copy.CopyTo( this );
}


void TiXmlDocument::operator=( const TiXmlDocument& copy )
{
	Clear();
	copy.CopyTo( this );
}


bool TiXmlDocument::LoadFile( TiXmlEncoding encoding )
{
	// See STL_STRING_BUG below.
	StringToBuffer buf( value );

	if ( buf.buffer && LoadFile( buf.buffer, encoding ) )
		return true;

	return false;
}


bool TiXmlDocument::SaveFile() const
{
	// See STL_STRING_BUG below.
	StringToBuffer buf( value );

	if ( buf.buffer && SaveFile( buf.buffer ) )
		return true;

	return false;
}

bool TiXmlDocument::LoadFile( const char* filename, TiXmlEncoding encoding )
{
	// There was a really terrifying little bug here. The code:
	//		value = filename
	// in the STL case, cause the assignment method of the std::string to
	// be called. What is strange, is that the std::string had the same
	// address as it's c_str() method, and so bad things happen. Looks
	// like a bug in the Microsoft STL implementation.
	// See STL_STRING_BUG above.
	// Fixed with the StringToBuffer class.
	value = filename;

	// reading in binary mode so that tinyxml can normalize the EOL
	FILE* file = fopen( value.c_str (), "rb" );	

	if ( file )
	{
		bool result = LoadFile( file, encoding );
		fclose( file );
		return result;
	}
	else
	{
		SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}
}

bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
{
	if ( !file ) 
	{
		SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}

	// Delete the existing data:
	Clear();
	location.Clear();

	// Get the file size, so we can pre-allocate the string. HUGE speed impact.
	long length = 0;
	fseek( file, 0, SEEK_END );
	length = ftell( file );
	fseek( file, 0, SEEK_SET );

	// Strange case, but good to handle up front.
	if ( length == 0 )
	{
		SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}

	// If we have a file, assume it is all one big XML file, and read it in.
	// The document parser may decide the document ends sooner than the entire file, however.
	TIXML_STRING data;
	data.reserve( length );

	// Subtle bug here. TinyXml did use fgets. But from the XML spec:
	// 2.11 End-of-Line Handling
	// <snip>
	// <quote>
	// ...the XML processor MUST behave as if it normalized all line breaks in external 
	// parsed entities (including the document entity) on input, before parsing, by translating 
	// both the two-character sequence #xD #xA and any #xD that is not followed by #xA to 
	// a single #xA character.
	// </quote>
	//
	// It is not clear fgets does that, and certainly isn't clear it works cross platform. 
	// Generally, you expect fgets to translate from the convention of the OS to the c/unix
	// convention, and not work generally.

	/*
	while( fgets( buf, sizeof(buf), file ) )
	{
		data += buf;
	}
	*/

	char* buf = new char[ length+1 ];
	buf[0] = 0;

	if ( fread( buf, length, 1, file ) != 1 ) {
		SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}

	const char* lastPos = buf;
	const char* p = buf;

	buf[length] = 0;
	while( *p ) {
		assert( p < (buf+length) );
		if ( *p == 0xa ) {
			// Newline character. No special rules for this. Append all the characters
			// since the last string, and include the newline.
			data.append( lastPos, (p-lastPos+1) );	// append, include the newline
			++p;									// move past the newline
			lastPos = p;							// and point to the new buffer (may be 0)
			assert( p <= (buf+length) );
		}
		else if ( *p == 0xd ) {
			// Carriage return. Append what we have so far, then
			// handle moving forward in the buffer.
			if ( (p-lastPos) > 0 ) {
				data.append( lastPos, p-lastPos );	// do not add the CR
			}
			data += (char)0xa;						// a proper newline

			if ( *(p+1) == 0xa ) {
				// Carriage return - new line sequence
				p += 2;
				lastPos = p;
				assert( p <= (buf+length) );
			}
			else {
				// it was followed by something else...that is presumably characters again.
				++p;
				lastPos = p;
				assert( p <= (buf+length) );
			}
		}
		else {
			++p;
		}
	}
	// Handle any left over characters.
	if ( p-lastPos ) {
		data.append( lastPos, p-lastPos );
	}		
	delete [] buf;
	buf = 0;

	Parse( data.c_str(), 0, encoding );

	if (  Error() )
        return false;
    else
		return true;
}


bool TiXmlDocument::SaveFile( const char * filename ) const
{
	// The old c stuff lives on...
	FILE* fp = fopen( filename, "w" );
	if ( fp )
	{
		bool result = SaveFile( fp );
		fclose( fp );
		return result;
	}
	return false;
}


bool TiXmlDocument::SaveFile( FILE* fp ) const
{
	if ( useMicrosoftBOM ) 
	{
		const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
		const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
		const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;

		fputc( TIXML_UTF_LEAD_0, fp );
		fputc( TIXML_UTF_LEAD_1, fp );
		fputc( TIXML_UTF_LEAD_2, fp );
	}
	Print( fp, 0 );
	return true;
}


void TiXmlDocument::CopyTo( TiXmlDocument* target ) const
{
	TiXmlNode::CopyTo( target );

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

	TiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}	
}


TiXmlNode* TiXmlDocument::Clone() const
{
	TiXmlDocument* clone = new TiXmlDocument();
	if ( !clone )
		return 0;

	CopyTo( clone );
	return clone;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区三区网站| 欧美四级电影网| 日韩va欧美va亚洲va久久| 国产精品视频免费看| 91精品国产综合久久婷婷香蕉| 成人aaaa免费全部观看| 蜜臀久久久99精品久久久久久| 亚洲日本韩国一区| 国产亚洲成aⅴ人片在线观看| 欧美人妇做爰xxxⅹ性高电影 | 亚洲.国产.中文慕字在线| 欧美电影免费观看完整版| 色老汉一区二区三区| 国产一区二区剧情av在线| 石原莉奈在线亚洲二区| 国产精品久久久久久久久图文区| www国产精品av| 日韩三级在线观看| 91精品国产综合久久婷婷香蕉| 日本福利一区二区| av亚洲产国偷v产偷v自拍| 国产福利视频一区二区三区| 七七婷婷婷婷精品国产| 性久久久久久久久久久久| 亚洲精品国产品国语在线app| 国产日韩一级二级三级| 欧美v国产在线一区二区三区| 538在线一区二区精品国产| 欧美日韩一级二级| 精品视频免费看| 欧美日韩精品一区二区三区| 欧美视频自拍偷拍| 欧美福利视频一区| 6080亚洲精品一区二区| 欧美精品粉嫩高潮一区二区| 欧美蜜桃一区二区三区| 欧美色图12p| 欧美日韩不卡一区| 日韩一区二区免费在线电影| 日韩西西人体444www| 日韩视频不卡中文| 久久综合网色—综合色88| 久久精品一区四区| 国产精品福利在线播放| 国产精品国产精品国产专区不蜜 | **网站欧美大片在线观看| 欧美极品另类videosde| 国产精品美女久久久久久 | 亚洲欧洲日韩综合一区二区| 一色桃子久久精品亚洲| 亚洲男同1069视频| 亚洲成人免费看| 欧美aa在线视频| 国产成人精品亚洲午夜麻豆| 粗大黑人巨茎大战欧美成人| eeuss影院一区二区三区| 91麻豆文化传媒在线观看| 欧美色图在线观看| 欧美电视剧免费全集观看| 久久嫩草精品久久久精品| 欧美激情一区在线观看| 一区二区三区四区不卡在线 | 精品国产自在久精品国产| 久久综合久色欧美综合狠狠| 中文字幕一区二区5566日韩| 亚洲一区二区精品视频| 裸体一区二区三区| eeuss鲁片一区二区三区| 欧美性猛交xxxx乱大交退制版| 日韩一级精品视频在线观看| 欧美国产一区二区在线观看| 夜夜操天天操亚洲| 久久精品免费看| www.66久久| 这里只有精品99re| 国产日韩三级在线| 亚洲高清免费观看高清完整版在线观看| 首页国产欧美日韩丝袜| 国产另类ts人妖一区二区| 91麻豆国产自产在线观看| 337p亚洲精品色噜噜| 国产精品福利在线播放| 日韩av网站在线观看| 99久久综合色| 日韩三级视频中文字幕| 亚洲欧美一区二区久久| 久久国产精品72免费观看| 色一区在线观看| 久久只精品国产| 性欧美疯狂xxxxbbbb| 高清在线成人网| 91精品中文字幕一区二区三区| 日本一区二区三区四区| 老司机精品视频导航| 91色.com| 国产日韩欧美综合在线| 美女www一区二区| 99国产精品久久| 久久久国产精品不卡| 日欧美一区二区| 欧美性猛交一区二区三区精品| 国产日本亚洲高清| 久久精品国产免费看久久精品| 欧美在线观看视频在线| 国产精品剧情在线亚洲| 日韩成人午夜电影| 欧美亚洲尤物久久| 日韩理论片中文av| 国产ts人妖一区二区| 精品日产卡一卡二卡麻豆| 日韩va欧美va亚洲va久久| 欧美性猛交xxxxxx富婆| 自拍av一区二区三区| 成人免费毛片片v| 久久综合九色综合97_久久久| 日韩激情一二三区| 欧美三级三级三级| 亚洲国产另类av| 在线亚洲+欧美+日本专区| 综合久久综合久久| 97se亚洲国产综合自在线不卡| 久久精品免视看| 国产一区二区三区最好精华液| 日韩一区二区电影| 久久精品国产一区二区三区免费看| 欧美久久久久中文字幕| 亚洲成人av电影在线| 欧美三级一区二区| 天天av天天翘天天综合网 | 欧美性生活大片视频| 一区二区三区中文免费| 91视频www| 亚洲午夜影视影院在线观看| 欧美性一区二区| 亚洲不卡av一区二区三区| 欧美日韩综合在线免费观看| 亚洲五码中文字幕| 欧美欧美午夜aⅴ在线观看| 丝袜亚洲另类欧美综合| 91精品国产综合久久香蕉麻豆| 日本大胆欧美人术艺术动态| 日韩你懂的在线播放| 国产一本一道久久香蕉| 国产亚洲人成网站| 成人短视频下载| 亚洲激情在线激情| 欧美日本一区二区| 久久99精品国产91久久来源| 国产日韩综合av| 99re在线视频这里只有精品| 亚洲国产综合91精品麻豆| 欧美片在线播放| 精品在线你懂的| 日本一区二区免费在线观看视频| 成人黄色777网| 亚洲一区二区三区四区在线免费观看 | 日韩精品中文字幕一区| 国产suv一区二区三区88区| 中文字幕在线不卡视频| 欧美日韩中文国产| 国内精品国产三级国产a久久| 国产视频一区在线播放| 日本国产一区二区| 全国精品久久少妇| 欧美激情在线免费观看| 在线影院国内精品| 麻豆成人免费电影| 国产精品成人网| 欧美久久婷婷综合色| 国产成人日日夜夜| 亚洲精品欧美综合四区| 欧美一级免费观看| 成人性生交大片免费看中文 | 久久丝袜美腿综合| 99久精品国产| 久久精品国产亚洲a| 自拍视频在线观看一区二区| 91精品国产入口在线| 国产91在线|亚洲| 首页国产丝袜综合| 日韩一区中文字幕| 精品91自产拍在线观看一区| 色哟哟亚洲精品| 国产成人综合自拍| 视频一区视频二区在线观看| 国产拍欧美日韩视频二区| 91 com成人网| 97久久精品人人澡人人爽| 麻豆免费看一区二区三区| 伊人性伊人情综合网| 精品久久久久一区二区国产| 色欲综合视频天天天| 国产麻豆午夜三级精品| 亚洲自拍偷拍麻豆| 国产欧美综合在线观看第十页| 欧美一级片在线看| 欧洲精品一区二区三区在线观看| 国产jizzjizz一区二区| 奇米影视在线99精品| 亚洲国产精品影院|