本文整理汇总了C++中CFileItem::IsScript方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::IsScript方法的具体用法?C++ CFileItem::IsScript怎么用?C++ CFileItem::IsScript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::IsScript方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetExecutePath
std::string CFavouritesDirectory::GetExecutePath(const CFileItem &item, const std::string &contextWindow)
{
std::string execute;
if (item.m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item.IsSmartPlayList() || item.IsPlayList())))
{
if (!contextWindow.empty())
execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str());
}
//! @todo STRING_CLEANUP
else if (item.IsScript() && item.GetPath().size() > 9) // plugin://<foo>
execute = StringUtils::Format("RunScript(%s)", StringUtils::Paramify(item.GetPath().substr(9)).c_str());
else if (item.IsAndroidApp() && item.GetPath().size() > 26) // androidapp://sources/apps/<foo>
execute = StringUtils::Format("StartAndroidActivity(%s)", StringUtils::Paramify(item.GetPath().substr(26)).c_str());
else // assume a media file
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else if (item.IsMusicDb() && item.HasMusicInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetMusicInfoTag()->GetURL()).c_str());
else if (item.IsPicture())
execute = StringUtils::Format("ShowPicture(%s)", StringUtils::Paramify(item.GetPath()).c_str());
else
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetPath()).c_str());
}
return execute;
}
示例2: TestPath
void WatchDog::TestPath(const CStdString &strPath)
{
#ifdef WATCHDOG_DONT_TEST_PATH
return;
#else
CFileItem item;
item.m_strPath = strPath;
bool bAvailable = false;
bool bHasInfo = false;
if (item.IsInternetStream() || item.IsPlugin() || item.IsScript() || item.IsApp())
{
bAvailable = IsConnectedToInternet();
bHasInfo = true;
}
else if (!CUtil::IsSmb(strPath) || !g_application.IsPlaying())
{
DIRECTORY::IDirectory* pDir = DIRECTORY::CFactoryDirectory::Create(strPath);
if (pDir)
{
bAvailable = pDir->Exists(strPath);
bHasInfo = true;
delete pDir;
}
}
// if (item.IsSmb() || item.IsHD())
// {
// CLog::Log(LOGDEBUG,"WatchDog::TestPath - [share=%s][available=%d][hasInfo=%d] (testpath)",strPath.c_str(), bAvailable, bHasInfo);
// }
if (bHasInfo)
{
CSingleLock lock(m_lock);
// If there was a change in a status, notify listeners
if ( (bAvailable && m_mapPaths[strPath] != WD_AVAILABLE) || (!bAvailable && m_mapPaths[strPath] != WD_UNAVAILABLE) )
NotifyListeners(strPath, bAvailable);
m_mapPaths[strPath] = bAvailable?WD_AVAILABLE:WD_UNAVAILABLE;
//CLog::Log(LOGDEBUG,"WatchDog::TestPath - For [share=%s] set [available=%d] (testpath)",strPath.c_str(), m_mapPaths[strPath]);
}
#endif
}
示例3: GetExecutePath
CStdString CFavouritesDirectory::GetExecutePath(const CFileItem &item, const std::string &contextWindow)
{
CStdString execute;
if (item.m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item.IsSmartPlayList() || item.IsPlayList())))
{
if (!contextWindow.empty())
execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str());
}
else if (item.IsScript())
execute = StringUtils::Format("RunScript(%s)", StringUtils::Paramify(item.GetPath().substr(9)).c_str());
else if (item.IsAndroidApp())
execute = StringUtils::Format("StartAndroidActivity(%s)", StringUtils::Paramify(item.GetPath().substr(26)).c_str());
else // assume a media file
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetPath()).c_str());
}
return execute;
}