本文整理汇总了C++中CEpgDatabase::Persist方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgDatabase::Persist方法的具体用法?C++ CEpgDatabase::Persist怎么用?C++ CEpgDatabase::Persist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgDatabase
的用法示例。
在下文中一共展示了CEpgDatabase::Persist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Persist
bool CEpgInfoTag::Persist(bool bSingleUpdate /* = true */, bool bLastUpdate /* = false */)
{
bool bReturn = false;
if (!m_bChanged)
return true;
CEpgDatabase *database = g_EpgContainer.GetDatabase();
if (!database || !database->Open())
{
CLog::Log(LOGERROR, "%s - could not open the database", __FUNCTION__);
return bReturn;
}
int iId = database->Persist(*this, bSingleUpdate, bLastUpdate);
if (iId >= 0)
{
bReturn = true;
if (iId > 0)
{
m_iBroadcastId = iId;
m_bChanged = false;
}
}
database->Close();
return bReturn;
}
示例2: Persist
bool CEpgInfoTag::Persist(bool bSingleUpdate /* = true */)
{
bool bReturn = false;
#if EPG_DEBUGGING
CLog::Log(LOGDEBUG, "Epg - %s - Infotag '%s' %s, persisting...", __FUNCTION__, m_strTitle.c_str(), m_iBroadcastId > 0 ? "has changes" : "is new");
#endif
CEpgDatabase *database = g_EpgContainer.GetDatabase();
if (!database || (bSingleUpdate && !database->IsOpen()))
{
CLog::Log(LOGERROR, "%s - could not open the database", __FUNCTION__);
return bReturn;
}
int iId = database->Persist(*this, bSingleUpdate);
if (iId >= 0)
{
bReturn = true;
if (iId > 0)
m_iBroadcastId = iId;
}
return bReturn;
}
示例3: Persist
bool CEpg::Persist(void)
{
if (CSettings::GetInstance().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT) || !NeedsSave())
return true;
#if EPG_DEBUGGING
CLog::Log(LOGDEBUG, "persist table '%s' (#%d) changed=%d deleted=%d", Name().c_str(), m_iEpgID, m_changedTags.size(), m_deletedTags.size());
#endif
CEpgDatabase *database = g_EpgContainer.GetDatabase();
if (!database || !database->IsOpen())
{
CLog::Log(LOGERROR, "EPG - %s - could not open the database", __FUNCTION__);
return false;
}
{
CSingleLock lock(m_critSection);
if (m_iEpgID <= 0 || m_bChanged)
{
int iId = database->Persist(*this, m_iEpgID > 0);
if (iId > 0)
m_iEpgID = iId;
}
for (std::map<int, CEpgInfoTagPtr>::iterator it = m_deletedTags.begin(); it != m_deletedTags.end(); ++it)
database->Delete(*it->second);
for (std::map<int, CEpgInfoTagPtr>::iterator it = m_changedTags.begin(); it != m_changedTags.end(); ++it)
it->second->Persist(false);
if (m_bUpdateLastScanTime)
database->PersistLastEpgScanTime(m_iEpgID, true);
m_deletedTags.clear();
m_changedTags.clear();
m_bChanged = false;
m_bTagsChanged = false;
m_bUpdateLastScanTime = false;
}
return database->CommitInsertQueries();
}