Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue