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


C++ CFileItem::ClearProperty方法代码示例

本文整理汇总了C++中CFileItem::ClearProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::ClearProperty方法的具体用法?C++ CFileItem::ClearProperty怎么用?C++ CFileItem::ClearProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFileItem的用法示例。


在下文中一共展示了CFileItem::ClearProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gc

TEST(TestGameFileLoader, CanOpen)
{
  // Test CGameFileLoader::CanOpen() with useStrategies = false, because
  // strategies have already already been tested above

  GameClientConfig gc("gameclient.test");
  GameClientConfig gc_nes; gc_nes.extensions.insert(".nes");
  GameClientConfig gc_bin; gc_bin.extensions.insert(".bin");
  CFileItem file;

  EXPECT_TRUE(CGameFileLoader::CanOpen(file, gc));

  file.SetProperty("gameclient", "gameclient.badegg");
  EXPECT_FALSE(CGameFileLoader::CanOpen(file, gc));

  file.ClearProperty("gameclient");
  gc.platforms.push_back(PLATFORM_NINTENDO_64);
  EXPECT_TRUE(CGameFileLoader::CanOpen(file, gc));
  file.GetGameInfoTag()->SetPlatform("Playstation");
  EXPECT_FALSE(CGameFileLoader::CanOpen(file, gc));
  gc.platforms.clear();
  EXPECT_TRUE(CGameFileLoader::CanOpen(file, gc));

  file.SetPath(XBMC_REF_FILE_PATH("xbmc/games/test/LocalFile.nes"));
  EXPECT_TRUE(CGameFileLoader::CanOpen(file, gc));
  EXPECT_TRUE(CGameFileLoader::CanOpen(file, gc_nes));
  EXPECT_FALSE(CGameFileLoader::CanOpen(file, gc_bin));

  // Test entering .zip files
  CFileItem localZipFile(XBMC_REF_FILE_PATH("xbmc/games/test/LocalFile.zip"), false);
  EXPECT_TRUE(CGameFileLoader::CanOpen(localZipFile, gc)); // No extensions specified, will try to load zip directly
  EXPECT_TRUE(CGameFileLoader::CanOpen(localZipFile, gc_nes));
  EXPECT_FALSE(CGameFileLoader::CanOpen(localZipFile, gc_bin));
}
开发者ID:pixl-project,项目名称:xbmc,代码行数:34,代码来源:TestGameFileLoader.cpp

示例2: GameLauchDialog

bool CRetroPlayerDialogs::GameLauchDialog(const CFileItem &file, GameClientPtr &result)
{
  CFileItem fileCopy = file;
  // If an explicit game client was specified, try to download that
  if (fileCopy.HasProperty("gameclient"))
  {
    if (InstallGameClient(fileCopy.GetProperty("gameclient").asString(), fileCopy, result))
      return true;
    fileCopy.ClearProperty("gameclient"); // don't want this to interfere later on
  }

  // First, ask the user if they would like to install a game client or go to
  // the add-on manager
  CContextButtons choices;
  choices.Add(0, 24026); // Install emulator
  choices.Add(1, 24058); // Add-on manager

  int btnid = CGUIDialogContextMenu::ShowAndGetChoice(choices);
  if (btnid == 0) // Install emulator
  {
    return InstallGameClientDialog(fileCopy, result);
  }
  else if (btnid == 1) // Add-on manager
  {
    // Queue the file so that if a compatible game client is installed, the
    // user will be asked to launch the file.
    CGameManager::Get().SetAutoLaunch(fileCopy);
    CLog::Log(LOGDEBUG, "RetroPlayer: User chose to go to the add-on manager");
    CStdStringArray params;
    params.push_back("addons://all/xbmc.gameclient");
    g_windowManager.ActivateWindow(WINDOW_ADDON_BROWSER, params);
  }
  else
  {
    CLog::Log(LOGDEBUG, "RetroPlayer: User canceled game client selection");
  }

  return false;
}
开发者ID:pixl-project,项目名称:xbmc,代码行数:39,代码来源:RetroPlayerDialogs.cpp


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