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


C++ TiXmlFOpen函数代码示例

本文整理汇总了C++中TiXmlFOpen函数的典型用法代码示例。如果您正苦于以下问题:C++ TiXmlFOpen函数的具体用法?C++ TiXmlFOpen怎么用?C++ TiXmlFOpen使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: filename

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.
	// Add an extra string to avoid the crash.
	TIXML_STRING filename( _filename );
	value = filename;

	// reading in binary mode so that tinyxml can normalize the EOL
	FILE* file = TiXmlFOpen( 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;
	}
}
开发者ID:ls-cwi,项目名称:lana,代码行数:27,代码来源:tinyxml.cpp

示例2: filename

bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding )
{
	TIXML_STRING filename( _filename );
	value = filename;

	zp::IReadFile* pZFile = NULL;
	FILE* file = NULL;
	if (PxcUtil::zPackFOpen(_filename, &pZFile) == PxcUtil::EzPOpen_SimplePath)
	{
		// reading in binary mode so that tinyxml can normalize the EOL
		file = TiXmlFOpen( value.c_str (), "rb" );
	}

	if ( pZFile || file )
	{
		bool result = LoadFile( file, encoding, pZFile );
		if (pZFile)
			zPackFClose(pZFile);
		else
			fclose( file );
		return result;
	}
	else
	{
		SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}
}
开发者ID:Dawnlord,项目名称:Pxc-Game-Frame,代码行数:28,代码来源:tinyxml.cpp

示例3: TiXmlFOpen

bool TiXmlDocument::SaveFile(const char * filename) const {
	// The old c stuff lives on...
	FILE* fp = TiXmlFOpen(filename, "w");
	if (fp) {
		bool result = SaveFile(fp);
		fclose(fp);
		return result;
	}
	return false;
}
开发者ID:9aa5,项目名称:crtmpserver,代码行数:10,代码来源:tinyxml.cpp

示例4: filename

bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding )
{
	TIXML_STRING filename( _filename );
	value = filename;
	
	// reading in binary mode so that tinyxml can normalize the EOL
	FILE* file = TiXmlFOpen( 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;
	}
}
开发者ID:Greyh0und,项目名称:TestProjects,代码行数:17,代码来源:tinyxml.cpp

示例5: TiXmlFOpen

bool TiXmlDocument::SaveFile( const char * filename , bool bom )
{
	bool temp = useMicrosoftBOM;
	useMicrosoftBOM = bom;

	// The old c stuff lives on...
	FILE* fp = TiXmlFOpen( filename, "w" );
	if ( fp )
	{
		bool result = SaveFile( fp );
		fclose( fp );
		return result;
	}

	useMicrosoftBOM = temp;

	return false;
}
开发者ID:refox1,项目名称:saExport,代码行数:18,代码来源:tinyxml.cpp


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