当前位置: 首页>>代码示例>>C++>>正文


C++ Path::Extension方法代码示例

本文整理汇总了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;
			}
		}
开发者ID:ipidev,项目名称:RamAi,代码行数:55,代码来源:NstWindowMain.cpp

示例2: GetFile

		const Path TapeRecorder::GetFile(Path imagePath) const
		{
			if (dialog->UseImageNaming())
			{
				imagePath.Extension() = L"tp";
				return imagePath;
			}
			else
			{
				return dialog->GetCustomFile();
			}
		}
开发者ID:JasonGoemaat,项目名称:NestopiaDx9,代码行数:12,代码来源:NstManagerTapeRecorder.cpp

示例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;
		}
开发者ID:ArtVandelae,项目名称:nestopia,代码行数:43,代码来源:NstDialogBrowse.cpp


注:本文中的Path::Extension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。