本文整理汇总了C++中Path::Extension方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::Extension方法的具体用法?C++ Path::Extension怎么用?C++ Path::Extension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::Extension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnEmuEvent
void Main::OnEmuEvent(const Managers::Emulator::Event event,const Managers::Emulator::Data data)
{
switch (event)
{
case Managers::Emulator::EVENT_POWER_ON:
case Managers::Emulator::EVENT_POWER_OFF:
if (emulator.NetPlayers())
{
menu.ToggleModeless( event == Managers::Emulator::EVENT_POWER_ON );
}
else if (Fullscreen())
{
const bool show = (event == Managers::Emulator::EVENT_POWER_OFF);
menu.Show( show );
Application::Instance::ShowChildWindows( show );
}
break;
case Managers::Emulator::EVENT_LOAD:
{
Path name;
if (emulator.IsCart())
{
name = Nes::Cartridge(emulator).GetProfile()->game.title.c_str();
}
else if (emulator.IsNsf())
{
name.Import( Nes::Nsf(emulator).GetName() );
}
if (name.Empty())
{
name = emulator.GetImagePath().Target().File();
name.Extension().Clear();
}
if (name.Length())
window.Text() << (name << " - " << MainWindow::name).Ptr();
break;
}
case Managers::Emulator::EVENT_UNLOAD:
window.Text() << MainWindow::name;
break;
case Managers::Emulator::EVENT_NETPLAY_MODE:
menu[IDM_VIEW_SWITCH_SCREEN].Enable( !data );
break;
}
}
示例2: GetFile
const Path TapeRecorder::GetFile(Path imagePath) const
{
if (dialog->UseImageNaming())
{
imagePath.Extension() = L"tp";
return imagePath;
}
else
{
return dialog->GetCustomFile();
}
}
示例3: SaveFile
const Path Browser::SaveFile(wchar_t* const filter,Path initial)
{
Path path;
path.Reserve( MAX_PATH*2 );
const Path extension( initial.Extension() );
if (initial.File().Length() && initial.File()[0] != '.')
path = initial.File();
initial.File().Clear();
Object::Pod<OPENFILENAME> ofn;
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = Application::Instance::GetActiveWindow();
ofn.lpstrFile = path.Ptr();
ofn.nMaxFile = path.Capacity();
ofn.lpstrInitialDir = initial.Length() ? initial.Ptr() : L".";
ofn.Flags = OFN_EXPLORER|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY;
if (filter)
{
for (uint i=0; filter[i]; ++i)
{
if (filter[i] == '\t')
filter[i] = '\0';
}
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
}
if (extension.Length())
ofn.lpstrDefExt = extension.Ptr();
if (::GetSaveFileName( &ofn ))
path.Validate();
else
path.Clear();
return path;
}