本文整理汇总了C++中TDateTime::CurrentDateTime方法的典型用法代码示例。如果您正苦于以下问题:C++ TDateTime::CurrentDateTime方法的具体用法?C++ TDateTime::CurrentDateTime怎么用?C++ TDateTime::CurrentDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDateTime
的用法示例。
在下文中一共展示了TDateTime::CurrentDateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessFiles
void CCRUDProcessor::ProcessFiles(TFileList &fileList, const char *pSourceDir, const char *pDestDir, bool bRecursive, CCRUDResults &results)
{
OutputResult("Processing File List..");
TFileList::iterator curFile = fileList.begin();
TDateTime timeBegin;
timeBegin = timeBegin.CurrentDateTime();
results.m_iFilesFound = 0;
results.m_iFilesCopied = 0;
int nTopLevel = fileList.size();
ResetEvent(m_hStopEvent);
while ((WaitForSingleObject(m_hStopEvent, 0) == WAIT_TIMEOUT) &&
(curFile != fileList.end()))
{
// Count this file
++results.m_iFilesFound;
// Get the source file name
string curFileName(pSourceDir);
curFileName += '\\';
curFileName += *curFile;
CleanPath(curFileName.begin());
// Look for new files in this file
bool bSearchInFile = bRecursive || nTopLevel;
if (!bSearchInFile || SearchForNewFiles(fileList, curFileName.begin()))
{
// Get the destination file name
string destFileName(pDestDir);
destFileName += '\\';
destFileName += *curFile;
CleanPath(destFileName.begin());
// Copy it if it needs to be updated
if (MaybeCopyFile(curFileName.begin(), destFileName.begin()))
++results.m_iFilesCopied;
}
if (nTopLevel)
--nTopLevel;
// Go to the next file in the list
++curFile;
// Breathe
Application->ProcessMessages();
}
results.m_ProcessingTime = timeBegin.CurrentDateTime() - timeBegin;
}
示例2: Loga
void Loga(String msg)
{
FILE *fp;
if ( ( fp = fopen(FILE_LOG, "at")) != NULL )
{
TDateTime dt;
dt = dt.CurrentDateTime();
String S = dt.FormatString("dd/mm/yy hh:nn:ss(");
S = S + GetTickCount() % 1000;
S = S + ") - " + msg;
if ( FormMain->lbLog->Items->Count > 150 )
{
FormMain->lbLog->Items->Delete(0);
}
FormMain->lbLog->Items->Add(S);
fprintf( fp, S.c_str() );
fprintf( fp, "\n" );
fclose( fp );
}
}