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

Method IsAllowedToEditFile

libs/storage/storage.cpp:1584–1591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1582}
1583
1584bool Storage::IsAllowedToEditFile(LocalFilePtr const & localFile) const
1585{
1586 ASSERT(localFile, ("Local file shouldn't be nullptr."));
1587 auto const currentVersionTime = base::YYMMDDToSecondsSinceEpoch(static_cast<uint32_t>(m_currentVersion));
1588 auto const localVersionTime = base::YYMMDDToSecondsSinceEpoch(static_cast<uint32_t>(localFile->GetVersion()));
1589 return currentVersionTime - localVersionTime < kMaxSecondsTillLastVersionUpdate &&
1590 base::SecondsSinceEpoch() - localVersionTime < kMaxSecondsTillNoEdits;
1591}
1592
1593int64_t Storage::GetVersion(CountryId const & countryId) const
1594{

Callers

nothing calls this directly

Calls 4

ASSERTFunction · 0.85
SecondsSinceEpochFunction · 0.85
GetVersionMethod · 0.45

Tested by

no test coverage detected