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


C++ TimeStamp::getTime方法代码示例

本文整理汇总了C++中TimeStamp::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeStamp::getTime方法的具体用法?C++ TimeStamp::getTime怎么用?C++ TimeStamp::getTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeStamp的用法示例。


在下文中一共展示了TimeStamp::getTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TimeToFileTime

bool TimeToFileTime(TimeStamp& time, LPFILETIME pFileTime)
{
	SYSTEMTIME sysTime;
	time.getTime(sysTime);

	// convert system time to local file time
	FILETIME localTime;
	if (!SystemTimeToFileTime((LPSYSTEMTIME)&sysTime, &localTime))
		return false;

	// convert local file time to UTC file time
	if (!LocalFileTimeToFileTime(&localTime, pFileTime))
		return false;

	return true;
}
开发者ID:princetoad,项目名称:acdx,代码行数:16,代码来源:TextFile.cpp

示例2: on_buttonBox_accepted

void DialogEditTime::on_buttonBox_accepted()
{
    // workaround for missing leading zero bug: prepend a "0", if it is missing
    QString tStr = ui->lineEdit->text();
    QStringList helper = tStr.split(":");
    if(helper.first().length() == 1){
        tStr.prepend("0");
    }
    // end of workaround

    QTime t = QTime::fromString(tStr);
    qDebug() << "zeit: " << t.toString();

	TimeStamp* ts =0;

	if(myRun){// ignore runns with Nullpointer
		if(myTimeType == TT_START){
			if(myRun->getStartTimeID() == 0){ // if no TS exists, create a new one
				ts = new TimeStamp(0, t, TimeStamp::E);
				MainWindow::competition()->addTimeStamp(ts);
				ts->setRunID(myRun->getID());
				myRun->setStartTimeID(ts->getID());
			}else{
				ts = MainWindow::competition()->getTimeStamp(myRun->getStartTimeID());
			}
        }else{ // goal
			if(myRun->getGoalTimeID() == 0){ // if no TS exists, create a new one
				ts = new TimeStamp(0, t, TimeStamp::E);
				MainWindow::competition()->addTimeStamp(ts);
				ts->setRunID(myRun->getID());
				myRun->setGoalTimeID(ts->getID());
			}else{
				ts = MainWindow::competition()->getTimeStamp(myRun->getGoalTimeID());
			}
		}

		// if new time != old time
		// compare strings, because of sub-0.01s differences, which should be ignored
		if(MainWindow::convertTimeToString(ts->getTime()) != MainWindow::convertTimeToString(t)){
			ts->setTime(t);
			ts->setSource(TimeStamp::E);
			emit timeEdited(myRun);
		}
	}
	hide();
}
开发者ID:GerZan,项目名称:kiboko-manager,代码行数:46,代码来源:dialogedittime.cpp


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