| 238 | } |
| 239 | |
| 240 | void UnpackBorders(std::string const & baseDir, std::string const & targetDir) |
| 241 | { |
| 242 | if (!Platform::IsFileExistsByFullPath(targetDir) && !Platform::MkDirChecked(targetDir)) |
| 243 | MYTHROW(FileSystemException, ("Unable to find or create directory", targetDir)); |
| 244 | |
| 245 | std::vector<storage::CountryDef> countries; |
| 246 | FilesContainerR reader(base::JoinPath(baseDir, PACKED_POLYGONS_FILE)); |
| 247 | ReaderSource<ModelReaderPtr> src(reader.GetReader(PACKED_POLYGONS_INFO_TAG)); |
| 248 | rw::Read(src, countries); |
| 249 | |
| 250 | for (size_t id = 0; id < countries.size(); id++) |
| 251 | { |
| 252 | storage::CountryId const mwmName = countries[id].m_countryId; |
| 253 | |
| 254 | src = reader.GetReader(strings::to_string(id)); |
| 255 | |
| 256 | auto const polygons = ReadPolygonsOfOneBorder(src); |
| 257 | DumpBorderToPolyFile(targetDir, mwmName, polygons); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | CountryPolygonsCollection const & GetOrCreateCountryPolygonsTree(std::string const & baseDir) |
| 262 | { |
no test coverage detected