| 462 | } |
| 463 | |
| 464 | std::vector<std::string> GetFilePathsToLoadFromKmz(std::string const & filePath) |
| 465 | { // Extract KML files from KMZ archive and save to temp KMLs with unique name. |
| 466 | std::vector<std::string> kmlFilePaths; |
| 467 | try |
| 468 | { |
| 469 | ZipFileReader::FileList files; |
| 470 | ZipFileReader::FilesList(filePath, files); |
| 471 | files.erase(std::remove_if(files.begin(), files.end(), |
| 472 | [](auto const & file) { return GetLowercaseFileExt(file.first) != kKmlExtension; }), |
| 473 | files.end()); |
| 474 | for (auto const & [kmlFileInZip, size] : files) |
| 475 | { |
| 476 | auto const name = base::FileNameFromFullPath(kmlFileInZip); |
| 477 | auto fileSavePath = GenerateValidAndUniqueFilePathForKML(name); |
| 478 | ZipFileReader::UnzipFile(filePath, kmlFileInZip, fileSavePath); |
| 479 | kmlFilePaths.push_back(std::move(fileSavePath)); |
| 480 | } |
| 481 | } |
| 482 | catch (RootException const & e) |
| 483 | { |
| 484 | LOG(LWARNING, ("Error unzipping file", filePath, e.Msg())); |
| 485 | } |
| 486 | return kmlFilePaths; |
| 487 | } |
| 488 | |
| 489 | std::vector<std::string> GetFilePathsToLoadFromKmb(std::string const & filePath) |
| 490 | { // Convert input file and save to temp KML with unique name. |
no test coverage detected