MCPcopy Create free account
hub / github.com/comaps/comaps / DecompressZipArchive

Function DecompressZipArchive

generator/generator_integration_tests/helpers.cpp:13–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace generator_integration_tests
12{
13void 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

Callers 1

InitMethod · 0.85

Calls 3

JoinPathFunction · 0.85
GetNativeSeparatorFunction · 0.85
MkDirRecursivelyMethod · 0.80

Tested by 1

InitMethod · 0.68