当前位置: 首页>>代码示例>>C++>>正文


C++ TDateTime::CurrentDateTime方法代码示例

本文整理汇总了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;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:54,代码来源:crud_proc.cpp

示例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 );
    }
}
开发者ID:focusenergy,项目名称:oshmi,代码行数:21,代码来源:proc.cpp


注:本文中的TDateTime::CurrentDateTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。