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

Function ReadRegionData

generator/region_meta.cpp:146–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146bool ReadRegionData(std::string const & countryName, RegionData & data)
147{
148 // When there is a match for a complete countryName, simply relay the call.
149 if (ReadRegionDataImpl(countryName, data))
150 return true;
151
152 // If not, cut parts of a country name from the tail. E.g. "Russia_Moscow" -> "Russia".
153 auto p = countryName.find_last_of('_');
154 while (p != std::string::npos)
155 {
156 if (ReadRegionDataImpl(countryName.substr(0, p), data))
157 return true;
158 p = p > 0 ? countryName.find_last_of('_', p - 1) : std::string::npos;
159 }
160 return false;
161}
162} // namespace feature

Callers 2

GenerateFinalFeaturesFunction · 0.85
ProcessRoundaboutsMethod · 0.85

Calls 1

ReadRegionDataImplFunction · 0.85

Tested by

no test coverage detected