本文整理汇总了C++中CDateTime::GetSec方法的典型用法代码示例。如果您正苦于以下问题:C++ CDateTime::GetSec方法的具体用法?C++ CDateTime::GetSec怎么用?C++ CDateTime::GetSec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDateTime
的用法示例。
在下文中一共展示了CDateTime::GetSec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exist
/*
Exist()
*/
BOOL CUrlDatabaseService::Exist(LPCSTR lpcszUrl,LPSTR lpszDate,UINT nDateSize,CUrlStatus::URL_STATUS& nStat,UINT& nID)
{
BOOL bExist = FALSE;
nStat = CUrlStatus::URL_STATUS_UNKNOWN;
nID = 0;
if(m_bIsValid)
{
// sincronizza gli accessi
if(m_pUrlDatabaseTable->Lock(SYNC_5_SECS_TIMEOUT))
{
strcpyn(m_szUrl,lpcszUrl,sizeof(m_szUrl));
m_Url.DecodeUrl(m_szUrl);
// controlla se il valore specificato esiste
if(m_pUrlDatabaseTable->Seek(m_szUrl,URLDATABASE_IDX_URL))
{
m_pUrlDatabaseTable->ScatterMemvars();
CDateTime* pDate = m_pUrlDatabaseTable->GetField_Date();
CDateTime* pTime = m_pUrlDatabaseTable->GetField_StartTime();
m_DateTime.SetYear(pDate->GetYear());
m_DateTime.SetMonth(pDate->GetMonth());
m_DateTime.SetDay(pDate->GetDay());
m_DateTime.SetHour(pTime->GetHour());
m_DateTime.SetMin(pTime->GetMin());
m_DateTime.SetSec(pTime->GetSec());
m_DateTime.SetDateFormat(GMT);
strcpyn(lpszDate,m_DateTime.GetFormattedDate(FALSE),nDateSize);
nStat = (CUrlStatus::URL_STATUS)m_pUrlDatabaseTable->GetField_Status();
nID = m_pUrlDatabaseTable->GetField_Id();
bExist = TRUE;
}
else
{
memset(lpszDate,'\0',nDateSize);
}
m_pUrlDatabaseTable->Unlock();
}
}
return(bExist);
}
示例2: Update
/*
Update()
*/
BOOL CUrlDatabaseService::Update( LPCSTR lpcszUrl,
LPCSTR lpcszEndTime,
double dlTotalTime,
double dlDownloadTime,
CUrlStatus::URL_STATUS nStat,
UINT nID,
LPCSTR lpcszReportName,
CUrlTable* pHttptable
)
{
BOOL bInserted = FALSE;
if(m_bIsValid)
{
// sincronizza gli accessi
if(m_pUrlDatabaseTable->Lock(SYNC_5_SECS_TIMEOUT))
{
strcpyn(m_szUrl,lpcszUrl,sizeof(m_szUrl));
// scorre il database per ricavare i totali
double dlTotBytes = 0.0f;
UINT nUrls = 0;
UINT nDownloadedUrls = 0;
UINT nDownloadedItems = 0;
UINT nTotalPict = 0;
if(pHttptable)
{
pHttptable->SetIndex(URL_IDX_ID);
if(pHttptable->GoTop())
{
do
{
pHttptable->ScatterMemvars();
nUrls++;
if((CUrlStatus::URL_STATUS)pHttptable->GetField_Stat()==CUrlStatus::URL_STATUS_DOWNLOADED)
{
nDownloadedUrls++;
dlTotBytes += pHttptable->GetField_Size();
}
m_Url.SplitUrl(pHttptable->GetField_Url(),&m_stUrl);
if(CImage::IsImageFile(m_stUrl.file) || CImage::IsImageFile(m_stUrl.cgi))
{
nTotalPict++;
if((CUrlStatus::URL_STATUS)pHttptable->GetField_Stat()==CUrlStatus::URL_STATUS_DOWNLOADED)
nDownloadedItems++;
}
pHttptable->GetNext();
} while(!pHttptable->Eof());
}
}
CDateTime* pDate = NULL;
CDateTime* pTime = NULL;
CDateTime Date;
CDateTime Time;
CString cData = "";
BOOL bFound = FALSE;
if(m_pUrlDatabaseTable->Seek(m_szUrl,URLDATABASE_IDX_URL))
{
m_pUrlDatabaseTable->ScatterMemvars();
pDate = m_pUrlDatabaseTable->GetField_Date();
pTime = m_pUrlDatabaseTable->GetField_StartTime();
Date.SetYear(pDate->GetYear());
Date.SetMonth(pDate->GetMonth());
Date.SetDay(pDate->GetDay());
Time.SetHour(pTime->GetHour());
Time.SetMin(pTime->GetMin());
Time.SetSec(pTime->GetSec());
cData = m_pUrlDatabaseTable->GetField_DataTable();
m_pUrlDatabaseTable->Delete();
bFound = TRUE;
}
if(bFound)
{
m_pUrlDatabaseTable->ResetMemvars();
m_pUrlDatabaseTable->PutField_Url ( m_szUrl );
m_pUrlDatabaseTable->PutField_Date ( &Date );
m_pUrlDatabaseTable->PutField_StartTime ( &Time );
m_DateTime.ConvertTime(HHMMSS_GMT,HHMMSS,lpcszEndTime,NULL);
m_pUrlDatabaseTable->PutField_EndTime ( &m_DateTime );
m_pUrlDatabaseTable->PutField_TotalTime ( dlTotalTime );
m_pUrlDatabaseTable->PutField_DownloadTime ( dlDownloadTime );
m_pUrlDatabaseTable->PutField_Downloaded ( dlTotBytes );
m_pUrlDatabaseTable->PutField_TotalUrls ( nUrls );
//.........这里部分代码省略.........