本文整理汇总了C++中CAddonDatabase::Search方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDatabase::Search方法的具体用法?C++ CAddonDatabase::Search怎么用?C++ CAddonDatabase::Search使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddonDatabase
的用法示例。
在下文中一共展示了CAddonDatabase::Search方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
bool CAddonsDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
{
CStdString path1(strPath);
URIUtils::RemoveSlashAtEnd(path1);
CURL path(path1);
items.ClearProperties();
items.SetContent("addons");
VECADDONS addons;
// get info from repository
bool reposAsFolders = true;
if (path.GetHostName().Equals("enabled"))
{
CAddonMgr::Get().GetAllAddons(addons, true);
items.SetProperty("reponame",g_localizeStrings.Get(24062));
items.SetLabel(g_localizeStrings.Get(24062));
}
else if (path.GetHostName().Equals("disabled"))
{ // grab all disabled addons, including disabled repositories
reposAsFolders = false;
CAddonMgr::Get().GetAllAddons(addons, false, true);
items.SetProperty("reponame",g_localizeStrings.Get(24039));
items.SetLabel(g_localizeStrings.Get(24039));
}
else if (path.GetHostName().Equals("outdated"))
{
reposAsFolders = false;
CAddonMgr::Get().GetAllOutdatedAddons(addons);
items.SetProperty("reponame",g_localizeStrings.Get(24043));
items.SetLabel(g_localizeStrings.Get(24043));
}
else if (path.GetHostName().Equals("repos"))
{
CAddonMgr::Get().GetAddons(ADDON_REPOSITORY,addons,true);
items.SetLabel(g_localizeStrings.Get(24033)); // Get Add-ons
}
else if (path.GetHostName().Equals("sources"))
{
return GetScriptsAndPlugins(path.GetFileName(), items);
}
else if (path.GetHostName().Equals("all"))
{
CAddonDatabase database;
database.Open();
database.GetAddons(addons);
items.SetProperty("reponame",g_localizeStrings.Get(24032));
items.SetLabel(g_localizeStrings.Get(24032));
}
else if (path.GetHostName().Equals("search"))
{
CStdString search(path.GetFileName());
if (search.IsEmpty() && !GetKeyboardInput(16017, search))
return false;
items.SetProperty("reponame",g_localizeStrings.Get(283));
items.SetLabel(g_localizeStrings.Get(283));
CAddonDatabase database;
database.Open();
database.Search(search, addons);
GenerateListing(path, addons, items, true);
path.SetFileName(search);
items.SetPath(path.Get());
return true;
}
else
{
reposAsFolders = false;
AddonPtr addon;
CAddonMgr::Get().GetAddon(path.GetHostName(),addon);
if (!addon)
return false;
// ensure our repos are up to date
CAddonInstaller::Get().UpdateRepos(false, true);
CAddonDatabase database;
database.Open();
database.GetRepository(addon->ID(),addons);
items.SetProperty("reponame",addon->Name());
items.SetLabel(addon->Name());
}
if (path.GetFileName().IsEmpty())
{
if (!path.GetHostName().Equals("repos"))
{
for (int i=ADDON_UNKNOWN+1;i<ADDON_VIZ_LIBRARY;++i)
{
for (unsigned int j=0;j<addons.size();++j)
{
if (addons[j]->IsType((TYPE)i))
{
CFileItemPtr item(new CFileItem(TranslateType((TYPE)i,true)));
item->SetPath(URIUtils::AddFileToFolder(strPath,TranslateType((TYPE)i,false)));
item->m_bIsFolder = true;
CStdString thumb = GetIcon((TYPE)i);
if (!thumb.IsEmpty() && g_TextureManager.HasTexture(thumb))
item->SetArt("thumb", thumb);
//.........这里部分代码省略.........