| 11 | namespace generator_integration_tests |
| 12 | { |
| 13 | void DecompressZipArchive(std::string const & src, std::string const & dst) |
| 14 | { |
| 15 | auto & plaftorm = GetPlatform(); |
| 16 | if (!plaftorm.MkDirRecursively(dst)) |
| 17 | MYTHROW(MkDirFailure, (dst)); |
| 18 | |
| 19 | ZipFileReader::FileList files; |
| 20 | ZipFileReader::FilesList(src, files); |
| 21 | for (auto const & p : files) |
| 22 | { |
| 23 | auto const output = base::JoinPath(dst, p.first); |
| 24 | if (output.ends_with(base::GetNativeSeparator())) |
| 25 | { |
| 26 | if (!plaftorm.MkDirRecursively(output)) |
| 27 | MYTHROW(MkDirFailure, (output)); |
| 28 | } |
| 29 | else |
| 30 | { |
| 31 | ZipFileReader::UnzipFile(src, p.first, output); |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | } // namespace generator_integration_tests |