MCPcopy Create free account
hub / github.com/Tracktion/choc / getFileTime

Method getFileTime

choc/containers/choc_ZipFile.h:298–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298inline std::filesystem::file_time_type ZipFile::Item::getFileTime() const
299{
300 std::tm tm {};
301 tm.tm_year = (int) (date >> 9);
302 tm.tm_mon = (int) (((date >> 5) & 15u) - 1u);
303 tm.tm_mday = date & 31u;
304 tm.tm_hour = (int) (time >> 11);
305 tm.tm_min = (time >> 5) & 63u;
306 tm.tm_sec = (int) ((time & 31u) * 2u);
307 tm.tm_isdst = 0;
308
309 auto systemTime = std::chrono::system_clock::from_time_t (std::mktime (&tm));
310 return std::filesystem::file_time_type (systemTime.time_since_epoch());
311}
312
313inline ZipFile::Item::Item (ZipFile& f, const char* entryData, uint32_t filenameLength)
314 : owner (std::addressof (f))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected