CBMC
mz_zip_archive.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: mz_zip library wrapper
4 
5 Author: Diffblue Ltd
6 
7 \*******************************************************************/
8 
9 #ifndef CPROVER_JAVA_BYTECODE_MZ_ZIP_ARCHIVE_H
10 #define CPROVER_JAVA_BYTECODE_MZ_ZIP_ARCHIVE_H
11 
12 #include <string>
13 #include <memory>
14 
17 
20 class mz_zip_archivet final
21 {
22 public:
26  explicit mz_zip_archivet(const std::string &filename);
27 
32  mz_zip_archivet(const void *data, size_t size);
33 
42 
44  size_t get_num_files();
48  std::string get_filename(size_t index);
53  std::string extract(size_t index);
58  void extract_to_file(size_t index, const std::string &path);
59 
60 private:
61  std::unique_ptr<mz_zip_archive_statet> m_state;
62 };
63 
64 #endif // CPROVER_JAVA_BYTECODE_MZ_ZIP_ARCHIVE_H
Thin object-oriented wrapper around the MZ Zip library Zip file reader and extractor.
size_t get_num_files()
Get number of files in the archive.
std::string extract(size_t index)
Get contents of nth file in the archive.
void extract_to_file(size_t index, const std::string &path)
Write contents of nth file in the archive to a file.
std::string get_filename(size_t index)
Get file name of nth file in the archive.
mz_zip_archivet & operator=(const mz_zip_archivet &)=delete
std::unique_ptr< mz_zip_archive_statet > m_state
mz_zip_archivet(const std::string &filename)
Open a zip archive.
mz_zip_archivet(const mz_zip_archivet &)=delete