Esempio n. 1
0
XmlString operator + (const XmlString & a, const XmlString & b)
{
	XmlString tmp;
	tmp.reserve(a.length() + b.length());
	tmp += a;
	tmp += b;
	return tmp;
}
Esempio n. 2
0
XmlString operator + (const XmlString & a, const char* b)
{
	XmlString tmp;
	XmlString::size_type b_len = static_cast<XmlString::size_type>( strlen(b) );
	tmp.reserve(a.length() + b_len);
	tmp += a;
	tmp.append(b, b_len);
	return tmp;
}
Esempio n. 3
0
XmlString operator + (const char* a, const XmlString & b)
{
	XmlString tmp;
	XmlString::size_type a_len = static_cast<XmlString::size_type>( strlen(a) );
	tmp.reserve(a_len + b.length());
	tmp.append(a, a_len);
	tmp += b;
	return tmp;
}
Esempio n. 4
0
/*static*/ bool CAutoTester::SaveToValidXmlFile( const XmlNodeRef &xmlToSave, const char *fileName)
{
#ifdef WIN32
	CrySetFileAttributes( fileName,0x00000080 ); // FILE_ATTRIBUTE_NORMAL
#endif //WIN32
	XmlString xmlStr = xmlToSave->getXML();
	CDebugAllowFileAccess allowFileAccess;
	FILE *file = gEnv->pCryPak->FOpen( fileName,"wt" );
	allowFileAccess.End();
	if (file)
	{
		const char *sxml = (const char*)xmlStr;
		char xmlHeader[] = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
		gEnv->pCryPak->FWrite(xmlHeader, strlen(xmlHeader), file);
		gEnv->pCryPak->FWrite( sxml,xmlStr.length(),file );
		gEnv->pCryPak->FClose(file);
		return true;
	}
	return false;
}