MCPcopy Create free account
hub / github.com/Kitware/CMake / GetFileByTimestamp

Method GetFileByTimestamp

Source/cmInstrumentation.cxx:271–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271std::string cmInstrumentation::GetFileByTimestamp(
272 cmInstrumentation::LatestOrOldest order, std::string const& dataSubdir,
273 std::string const& exclude)
274{
275 std::string fullDir = cmStrCat(this->dataDir, '/', dataSubdir);
276 std::string result;
277 if (cmSystemTools::FileExists(fullDir)) {
278 cmsys::Directory d;
279 if (d.Load(fullDir)) {
280 for (unsigned int i = 0; i < d.GetNumberOfFiles(); i++) {
281 std::string fname = d.GetFileName(i);
282 if (fname != "." && fname != ".." && fname != exclude &&
283 (result.empty() ||
284 (order == LatestOrOldest::Latest && fname > result) ||
285 (order == LatestOrOldest::Oldest && fname < result))) {
286 result = fname;
287 }
288 }
289 }
290 }
291 return result;
292}
293
294void cmInstrumentation::RemoveOldFiles(std::string const& dataSubdir)
295{

Callers 4

RemoveOldFilesMethod · 0.95
CollectTimingDataMethod · 0.95
InstrumentCommandMethod · 0.95

Calls 5

cmStrCatFunction · 0.70
FileExistsFunction · 0.50
LoadMethod · 0.45
GetFileNameMethod · 0.45
emptyMethod · 0.45

Tested by 1