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

Function ParseVersion

libs/platform/local_country_file_utils.cpp:283–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283bool ParseVersion(string const & s, int64_t & version)
284{
285 // Folder version format is 211122. Unit tests use simple "1", "2" versions.
286 if (s.empty() || s.size() > 6)
287 return false;
288
289 int64_t v = 0;
290 for (char const c : s)
291 {
292 if (!isdigit(c))
293 return false;
294 v = v * 10 + c - '0';
295 }
296 version = v;
297 return true;
298}
299
300std::shared_ptr<LocalCountryFile> PreparePlaceForCountryFiles(int64_t version, CountryFile const & countryFile)
301{

Callers 2

UNIT_TESTFunction · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.68