MCPcopy Create free account
hub / github.com/comaps/comaps / ReadTimestamp

Method ReadTimestamp

libs/tracking/archival_manager.cpp:151–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151std::chrono::seconds ArchivalManager::ReadTimestamp(std::string const & filePath)
152{
153 if (!Platform::IsFileExistsByFullPath(filePath))
154 return std::chrono::seconds(0);
155
156 try
157 {
158 FileReader reader(filePath);
159 ReaderSource<FileReader> src(reader);
160 uint64_t ts = 0;
161 ReadPrimitiveFromSource(src, ts);
162 return std::chrono::seconds(ts);
163 }
164 catch (std::exception const & e)
165 {
166 LOG(LWARNING, ("Error reading timestamp from file", e.what()));
167 }
168 return std::chrono::seconds(0);
169}
170
171size_t ArchivalManager::GetMaxSavedFilesCount(std::string const & extension) const
172{

Callers

nothing calls this directly

Calls 2

ReadPrimitiveFromSourceFunction · 0.85
whatMethod · 0.45

Tested by

no test coverage detected