本文整理汇总了C++中TextWriter::Serialize_String方法的典型用法代码示例。如果您正苦于以下问题:C++ TextWriter::Serialize_String方法的具体用法?C++ TextWriter::Serialize_String怎么用?C++ TextWriter::Serialize_String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextWriter
的用法示例。
在下文中一共展示了TextWriter::Serialize_String方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Save
//-----------------------------------------------------------------------------
bool EdProject::Save()
{
mxPutf("Saving project '%s'\n",m_name.ToChars());
// serialize engine environment
{
ANSICHAR levelFilePath[FS_MAX_PATH];
F_Compose_File_Path( m_fullFilePath, PROJ_LEVEL_FILE_EXTENSION, levelFilePath );
FileWriter fileStream( levelFilePath );
if( !fileStream.IsOpen() ) {
return false;
}
TextObjectWriter serializer;
SEngineSaveArgs saveArgs;
saveArgs.serializer = &serializer;
gEngine.SaveState( saveArgs );
// write comment
// @todo: project build options, engine version, etc.
{
const UINT numWorlds = Global_Level_Editor::Get().Num();
String comment;
comment.Format("// Level file for \"%s\" (%u world(s))\n//",
m_name.ToChars(), numWorlds );
serializer.SetRootComment( comment );
}
serializer.WriteAllToStream( fileStream );
}
// Serialize project data
{
FileWriter fileStream( m_fullFilePath );
if( !fileStream.IsOpen() ) {
return false;
}
TextWriter serializer;
{
{
serializer.Serialize_String( "Path_To_Asset_Database", m_assetDbFilePath );
if( !m_assetDbFilePath.IsEmpty() )
{
m_assetMgr.SaveToFile( m_assetDbFilePath );
}
}
EdSystem::Get().Event_SerializeProjectData( serializer );
}
serializer.WriteAllToStream( fileStream );
}
return true;
}