MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / GetStaticFiles

Method GetStaticFiles

src/storage/storage.cpp:290–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290std::vector<std::pair<bool, std::filesystem::path>> Storage::GetStaticFiles()
291{
292 constexpr bool IS_REQUIRED = true;
293 constexpr bool IS_OPTIONAL = false;
294
295 std::vector<std::pair<bool, std::filesystem::path>> files = {
296 {IS_OPTIONAL, config.GetPath(".osrm.cells")},
297 {IS_OPTIONAL, config.GetPath(".osrm.partition")},
298 {IS_REQUIRED, config.GetPath(".osrm.ebg_nodes")},
299 {IS_REQUIRED, config.GetPath(".osrm.maneuver_overrides")},
300 {IS_REQUIRED, config.GetPath(".osrm.nbg_nodes")},
301 {IS_REQUIRED, config.GetPath(".osrm.ramIndex")},
302 {IS_REQUIRED, config.GetPath(".osrm.properties")},
303 {IS_REQUIRED, config.GetPath(".osrm.timestamp")}};
304
305 for (const auto &file : {".osrm.edges", ".osrm.names", ".osrm.icd", ".osrm.tls", ".osrm.tld"})
306 {
307 if (config.IsRequiredConfiguredInput(file))
308 {
309 files.push_back({IS_REQUIRED, config.GetPath(file)});
310 }
311 }
312
313 for (const auto &file : files)
314 {
315 if (file.first == IS_REQUIRED && !std::filesystem::exists(file.second))
316 {
317 throw util::exception("Could not find required file(s): " + std::get<1>(file).string());
318 }
319 }
320
321 return files;
322}
323
324std::vector<std::pair<bool, std::filesystem::path>> Storage::GetUpdatableFiles()
325{

Callers 2

MMapMemoryAllocatorMethod · 0.80

Calls 4

exceptionClass · 0.85
GetPathMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected