本文整理汇总了C++中vfs::Path::changeExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::changeExtension方法的具体用法?C++ Path::changeExtension怎么用?C++ Path::changeExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vfs::Path
的用法示例。
在下文中一共展示了Path::changeExtension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
void Saver::save(const vfs::Path& filename, const Game& game )
{
VariantMap vm;
vm[ SaverOptions::version ] = 1;
vm[ "timemultiplier" ] = game.timeMultiplier();
VariantMap vm_scenario;
vm_scenario[ "date" ] = game::Date::current();
vm_scenario[ "events" ] = events::Dispatcher::instance().save();
vm_scenario[ "translation" ] = SETTINGS_VALUE( lastTranslation );
vm_scenario[ "climate" ] = (int)game.city()->climate();
vm[ "scenario" ] = vm_scenario;
vm[ SaverOptions::restartFile ] = Variant( _restartFile );
VariantMap vm_empire;
game.empire()->save( vm_empire );
vm[ "empire" ] = vm_empire;
VariantMap plm;
game.player()->save( plm );
vm[ "player" ] = plm;
VariantMap vm_city;
game.city()->save( vm_city );
vm[ "city" ] = vm_city;
VariantMap vm_pantheon;
religion::rome::Pantheon::instance().save( vm_pantheon );
vm[ "pantheon" ] = vm_pantheon;
gui::Minimap* minimap = gui::findChildA<gui::Minimap*>( true, game.gui()->rootWidget() );
if( minimap )
{
vfs::Path imgPath = filename.changeExtension( "png" );
minimap->saveImage( imgPath.toString() );
}
config::save( vm, filename );
}