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

Function InitDataSource

libs/search/search_quality/helpers.cpp:129–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void InitDataSource(FrozenDataSource & dataSource, string const & mwmListPath)
130{
131 vector<platform::LocalCountryFile> mwms;
132 if (!mwmListPath.empty())
133 {
134 vector<string> availableMwms;
135 ReadStringsFromFile(mwmListPath, availableMwms);
136 for (auto const & countryName : availableMwms)
137 mwms.emplace_back(GetPlatform().WritableDir(), platform::CountryFile(countryName), 0);
138 }
139 else
140 {
141 platform::FindAllLocalMapsAndCleanup(numeric_limits<int64_t>::max() /* the latest version */, mwms);
142 }
143
144 LOG(LINFO, ("Initializing the data source with the following mwms:"));
145 for (auto & mwm : mwms)
146 {
147 mwm.SyncWithDisk();
148 LOG(LINFO, (mwm.GetCountryName(), ReadVersionFromHeader(mwm)));
149 dataSource.RegisterMap(mwm);
150 }
151 LOG(LINFO, ());
152}
153
154unique_ptr<search::tests_support::TestSearchEngine> InitSearchEngine(DataSource & dataSource, string const & locale,
155 size_t numThreads)

Callers 4

SearchEngineProxyMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 9

ReadStringsFromFileFunction · 0.85
ReadVersionFromHeaderFunction · 0.85
SyncWithDiskMethod · 0.80
CountryFileClass · 0.50
emptyMethod · 0.45
emplace_backMethod · 0.45
GetCountryNameMethod · 0.45
RegisterMapMethod · 0.45

Tested by

no test coverage detected