mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-22 06:03:45 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
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
This commit is contained in:
35
generator/generator_integration_tests/helpers.cpp
Normal file
35
generator/generator_integration_tests/helpers.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user