mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
36 lines
895 B
C++
36 lines
895 B
C++
#include "generator/generator_integration_tests/helpers.hpp"
|
|
|
|
#include "platform/platform.hpp"
|
|
|
|
#include "coding/file_writer.hpp"
|
|
#include "coding/zip_reader.hpp"
|
|
|
|
#include "base/assert.hpp"
|
|
#include "base/file_name_utils.hpp"
|
|
|
|
namespace generator_integration_tests
|
|
{
|
|
void DecompressZipArchive(std::string const & src, std::string const & dst)
|
|
{
|
|
auto & plaftorm = GetPlatform();
|
|
if (!plaftorm.MkDirRecursively(dst))
|
|
MYTHROW(MkDirFailure, (dst));
|
|
|
|
ZipFileReader::FileList files;
|
|
ZipFileReader::FilesList(src, files);
|
|
for (auto const & p : files)
|
|
{
|
|
auto const output = base::JoinPath(dst, p.first);
|
|
if (output.ends_with(base::GetNativeSeparator()))
|
|
{
|
|
if (!plaftorm.MkDirRecursively(output))
|
|
MYTHROW(MkDirFailure, (output));
|
|
}
|
|
else
|
|
{
|
|
ZipFileReader::UnzipFile(src, p.first, output);
|
|
}
|
|
}
|
|
}
|
|
} // namespace generator_integration_tests
|