| 37 | |
| 38 | template <class ToDo> |
| 39 | void ForEachCountry(std::string const & baseDir, ToDo && toDo) |
| 40 | { |
| 41 | std::string const bordersDir = base::JoinPath(baseDir, BORDERS_DIR); |
| 42 | CHECK(Platform::IsFileExistsByFullPath(bordersDir), ("Cannot read borders directory", bordersDir)); |
| 43 | |
| 44 | Platform::FilesList files; |
| 45 | Platform::GetFilesByExt(bordersDir, BORDERS_EXTENSION, files); |
| 46 | for (std::string file : files) |
| 47 | { |
| 48 | PolygonsList polygons; |
| 49 | if (LoadBorders(bordersDir + file, polygons)) |
| 50 | { |
| 51 | base::GetNameWithoutExt(file); |
| 52 | toDo(std::move(file), std::move(polygons)); |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | class PackedBordersGenerator |
| 58 | { |
no test coverage detected