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 
34  mz_zip_archivet(const mz_zip_archivet &)=delete;
35  mz_zip_archivet &operator=(const mz_zip_archivet &)=delete;
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
mz_zip_archivet::~mz_zip_archivet
~mz_zip_archivet()
mz_zip_archive_statet
Definition: mz_zip_archive.cpp:18
mz_zip_archivet::mz_zip_archivet
mz_zip_archivet(const std::string &filename)
Open a zip archive.
Definition: mz_zip_archive.cpp:48
mz_zip_archivet::extract
std::string extract(size_t index)
Get contents of nth file in the archive.
Definition: mz_zip_archive.cpp:88
mz_zip_archivet::operator=
mz_zip_archivet & operator=(const mz_zip_archivet &)=delete
mz_zip_archivet::get_num_files
size_t get_num_files()
Get number of files in the archive.
Definition: mz_zip_archive.cpp:68
mz_zip_archivet::get_filename
std::string get_filename(size_t index)
Get file name of nth file in the archive.
Definition: mz_zip_archive.cpp:73
mz_zip_archivet
Thin object-oriented wrapper around the MZ Zip library Zip file reader and extractor.
Definition: mz_zip_archive.h:20
mz_zip_archivet::extract_to_file
void extract_to_file(size_t index, const std::string &path)
Write contents of nth file in the archive to a file.
Definition: mz_zip_archive.cpp:106
mz_zip_archivet::m_state
std::unique_ptr< mz_zip_archive_statet > m_state
Definition: mz_zip_archive.h:61