本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}