Lluvia
ZipArchive.h
Go to the documentation of this file.
1 
8 #ifndef LLUVIA_CORE_IMPL_ZIP_ARCHIVE_H_
9 #define LLUVIA_CORE_IMPL_ZIP_ARCHIVE_H_
10 
11 #if defined(__GNUC__)
12 // Ensure we get the 64-bit variants of the CRT's file I/O calls
13 #ifndef _FILE_OFFSET_BITS
14 #define _FILE_OFFSET_BITS 64
15 #endif
16 #ifndef _LARGEFILE64_SOURCE
17 #define _LARGEFILE64_SOURCE 1
18 #endif
19 #endif
20 
21 #include "miniz.h"
22 
23 #include <string>
24 #include <vector>
25 
26 namespace ll {
27 namespace impl {
28 
29  class ZipArchive {
30 
31  public:
32  ZipArchive() = delete;
33  ZipArchive(const ZipArchive&) = delete;
34  ZipArchive(ZipArchive&&) = delete;
35  ZipArchive(const std::string& filename);
36 
38 
39  ZipArchive& operator=(const ZipArchive&) = delete;
41 
42  size_t numberFiles();
43 
44  mz_zip_archive_file_stat getFileStat(const size_t i);
45 
46  std::string uncompressTextFile(mz_zip_archive_file_stat& stat);
47 
48  std::vector<uint8_t> uncompressBinaryFile(mz_zip_archive_file_stat& stat);
49 
50  private:
51  mz_zip_archive mArchive {};
52  };
53 
54 } // namespace impl
55 } // namespace ll
56 
57 #endif // LLUVIA_CORE_IMPL_ZIP_ARCHIVE_H_
Definition: ZipArchive.h:29
mz_zip_archive_file_stat getFileStat(const size_t i)
ZipArchive & operator=(ZipArchive &&)=delete
ZipArchive & operator=(const ZipArchive &)=delete
std::vector< uint8_t > uncompressBinaryFile(mz_zip_archive_file_stat &stat)
ZipArchive(const ZipArchive &)=delete
ZipArchive(const std::string &filename)
ZipArchive(ZipArchive &&)=delete
std::string uncompressTextFile(mz_zip_archive_file_stat &stat)
Definition: Buffer.h:28