本文整理汇总了C++中addon::AddonVersion类的典型用法代码示例。如果您正苦于以下问题:C++ AddonVersion类的具体用法?C++ AddonVersion怎么用?C++ AddonVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AddonVersion类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SetLastChecked
int CAddonDatabase::SetLastChecked(const std::string& id,
const ADDON::AddonVersion& version, const std::string& time)
{
try
{
if (NULL == m_pDB.get()) return false;
if (NULL == m_pDS.get()) return false;
int retId = -1;
std::string sql = PrepareSQL("SELECT * FROM repo WHERE addonID='%s'", id.c_str());
m_pDS->query(sql);
if (m_pDS->eof())
{
sql = PrepareSQL("INSERT INTO repo (id, addonID, lastcheck, version) "
"VALUES (NULL, '%s', '%s', '%s')", id.c_str(), time.c_str(), version.asString().c_str());
m_pDS->exec(sql);
retId = static_cast<int>(m_pDS->lastinsertid());
}
else
{
retId = m_pDS->fv(0).get_asInt();
sql = PrepareSQL("UPDATE repo SET lastcheck='%s', version='%s' WHERE addonID='%s'",
time.c_str(), version.asString().c_str(), id.c_str());
m_pDS->exec(sql);
}
return retId;
}
catch (...)
{
CLog::Log(LOGERROR, "%s failed on repo '%s'", __FUNCTION__, id.c_str());
}
return -1;
}
开发者ID:Montellese,项目名称:xbmc,代码行数:35,代码来源:AddonDatabase.cpp
示例2: onPythonModuleInitialization
void CPythonInvoker::onPythonModuleInitialization(void* moduleDict)
{
if (m_addon.get() == NULL || moduleDict == NULL)
return;
PyObject *moduleDictionary = (PyObject *)moduleDict;
PyObject *pyaddonid = PyString_FromString(m_addon->ID().c_str());
PyDict_SetItemString(moduleDictionary, "__xbmcaddonid__", pyaddonid);
ADDON::AddonVersion version = m_addon->GetDependencyVersion("xbmc.python");
PyObject *pyxbmcapiversion = PyString_FromString(version.asString().c_str());
PyDict_SetItemString(moduleDictionary, "__xbmcapiversion__", pyxbmcapiversion);
CLog::Log(LOGDEBUG, "CPythonInvoker(%d, %s): instantiating addon using automatically obtained id of \"%s\" dependent on version %s of the xbmc.python api",
GetId(), m_sourceFile.c_str(), m_addon->ID().c_str(), version.asString().c_str());
}
开发者ID:Jmend25,项目名称:boxeebox-xbmc,代码行数:17,代码来源:PythonInvoker.cpp
示例3: CheckAPIVersion
bool CPeripheralAddon::CheckAPIVersion(void)
{
// Check the API version
ADDON::AddonVersion minVersion = ADDON::AddonVersion(PERIPHERAL_MIN_API_VERSION);
m_apiVersion = ADDON::AddonVersion(m_pStruct->GetPeripheralAPIVersion());
if (!IsCompatibleAPIVersion(minVersion, m_apiVersion))
{
CLog::Log(LOGERROR, "PERIPHERAL - Add-on '%s' is using an incompatible API version. XBMC minimum API version = '%s', add-on API version '%s'", Name().c_str(), minVersion.asString().c_str(), m_apiVersion.asString().c_str());
return false;
}
return true;
}
开发者ID:aerickson,项目名称:xbmc,代码行数:14,代码来源:PeripheralAddon.cpp
示例4: SetRepoTimestamp
bool CAddonDatabase::SetRepoTimestamp(const std::string& id, const std::string& time, const ADDON::AddonVersion& version)
{
try
{
if (NULL == m_pDB.get()) return false;
if (NULL == m_pDS.get()) return false;
std::string sql = PrepareSQL("UPDATE repo SET lastcheck='%s', version='%s' WHERE addonID='%s'",
time.c_str(), version.asString().c_str(), id.c_str());
m_pDS->exec(sql.c_str());
return true;
}
catch (...)
{
CLog::Log(LOGERROR, "%s failed on repo '%s'", __FUNCTION__, id.c_str());
}
return false;
}
开发者ID:Distrotech,项目名称:xbmc,代码行数:19,代码来源:AddonDatabase.cpp
注:本文中的addon::AddonVersion类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论