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


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

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


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

示例1: CURL

TEST(TestFileItem, GetLocalArt)
{
  typedef struct
  {
    const char *file;
    bool use_folder;
    const char *base;
  } testfiles;

  const testfiles test_files[] = {{ "c:\\dir\\filename.avi", false, "c:\\dir\\filename-art.jpg" },
                                  { "c:\\dir\\filename.avi", true,  "c:\\dir\\art.jpg" },
                                  { "/dir/filename.avi", false, "/dir/filename-art.jpg" },
                                  { "/dir/filename.avi", true,  "/dir/art.jpg" },
                                  { "smb://somepath/file.avi", false, "smb://somepath/file-art.jpg" },
                                  { "smb://somepath/file.avi", true, "smb://somepath/art.jpg" },
                                  { "stack:///path/to/movie-cd1.avi , /path/to/movie-cd2.avi", false,  "/path/to/movie-art.jpg" },
                                  { "stack:///path/to/movie-cd1.avi , /path/to/movie-cd2.avi", true,  "/path/to/art.jpg" },
                                  { "stack:///path/to/movie_name/cd1/some_file1.avi , /path/to/movie_name/cd2/some_file2.avi", true,  "/path/to/movie_name/art.jpg" },
                                  { "/home/user/TV Shows/Dexter/S1/1x01.avi", false, "/home/user/TV Shows/Dexter/S1/1x01-art.jpg" },
                                  { "/home/user/TV Shows/Dexter/S1/1x01.avi", true, "/home/user/TV Shows/Dexter/S1/art.jpg" },
                                  { "rar://g%3a%5cmultimedia%5cmovies%5cSphere%2erar/Sphere.avi", false, "g:\\multimedia\\movies\\Sphere-art.jpg" },
                                  { "rar://g%3a%5cmultimedia%5cmovies%5cSphere%2erar/Sphere.avi", true, "g:\\multimedia\\movies\\art.jpg" },
                                  { "/home/user/movies/movie_name/video_ts/VIDEO_TS.IFO", false, "/home/user/movies/movie_name/art.jpg" },
                                  { "/home/user/movies/movie_name/video_ts/VIDEO_TS.IFO", true, "/home/user/movies/movie_name/art.jpg" },
                                  { "/home/user/movies/movie_name/BDMV/index.bdmv", false, "/home/user/movies/movie_name/art.jpg" },
                                  { "/home/user/movies/movie_name/BDMV/index.bdmv", true, "/home/user/movies/movie_name/art.jpg" }};

  const testfiles test_file2[] = {{ "c:\\dir\\filename.avi", false, "c:\\dir\\filename.tbn" },
                                  { "/dir/filename.avi", false, "/dir/filename.tbn" },
                                  { "smb://somepath/file.avi", false, "smb://somepath/file.tbn" },
                                  { "/home/user/TV Shows/Dexter/S1/1x01.avi", false, "/home/user/TV Shows/Dexter/S1/1x01.tbn" },
                                  { "rar://g%3a%5cmultimedia%5cmovies%5cSphere%2erar/Sphere.avi", false, "g:\\multimedia\\movies\\Sphere.tbn" }};

  g_advancedSettings.Initialize();

  for (unsigned int i = 0; i < sizeof(test_files) / sizeof(testfiles); i++)
  {
    CFileItem item;
    item.SetPath(test_files[i].file);
    std::string path = CURL(item.GetLocalArt("art.jpg", test_files[i].use_folder)).Get();
    std::string compare = CURL(test_files[i].base).Get();
    EXPECT_EQ(path, compare);
  }

  for (unsigned int i = 0; i < sizeof(test_file2) / sizeof(testfiles); i++)
  {
    CFileItem item;
    item.SetPath(test_file2[i].file);
    std::string path = CURL(item.GetLocalArt("", test_file2[i].use_folder)).Get();
    std::string compare = CURL(test_file2[i].base).Get();
    EXPECT_EQ(path, compare);
  }
}
开发者ID:AFFLUENTSOCIETY,项目名称:SPMC,代码行数:53,代码来源:TestFileItem.cpp

示例2: CURL

TEST_P(TestFileItemFallbackArt, GetLocalArt)
{
  CFileItem item;
  item.SetPath(GetParam().file);
  std::string path = CURL(item.GetLocalArt("", GetParam().use_folder)).Get();
  std::string compare = CURL(GetParam().base).Get();
  EXPECT_EQ(compare, path);
}
开发者ID:ckarrie,项目名称:xbmc,代码行数:8,代码来源:TestFileItem.cpp


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