本文整理汇总了C++中Time::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Time::Clear方法的具体用法?C++ Time::Clear怎么用?C++ Time::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFileTime
std::string Maker::GetFileTime(const std::string &goal, const std::string &preferredPath, Time &timeval)
{
std::string rv;
if (goal.find_first_of(CmdFiles::DIR_SEP) != std::string::npos)
{
std::fstream fil(goal.c_str(), std::ios::in);
if (fil != NULL)
{
fil.close();
timeval = OS::GetFileTime(goal);
}
}
else
{
std::string vpath = preferredPath + std::string(" .\\ ") + Eval::GetVPATH(goal);
std::string sep = std::string(" ") + CmdFiles::PATH_SEP;
while (vpath.size())
{
std::string cur = Eval::ExtractFirst(vpath, sep);
if (cur[cur.size() -1] != CmdFiles::DIR_SEP[0])
cur += CmdFiles::DIR_SEP;
std::string name ;
if (goal[0] != CmdFiles::DIR_SEP[0] && goal[1] != ':')
name = cur + goal;
else
name = goal;
if (cur != ".\\")
filePaths[goal] = cur; // tentatively enter this as the goal path
// this will collide if there are multiple paths and no file exists
// and choose the last one
std::fstream fil(name.c_str(), std::ios::in);
if (fil != NULL)
{
fil.close();
rv = cur; // return value is the path, with a slash on the end
timeval = OS::GetFileTime(name);
filePaths[goal] = cur;
break;
}
}
}
if (ScanList(newFiles, goal) || ScanList(newFiles, rv + goal))
{
timeval = OS::GetCurrentTime();
}
else if (ScanList(oldFiles, goal) || ScanList(oldFiles, rv + goal))
{
timeval.Clear();
}
return rv;
}