Antares Xpansion
Investment simulations for Antares studies
All Classes Namespaces Files Functions Variables Typedefs Pages
ArchiveReader.h
1#ifndef _ARCHIVEREADER_H
2#define _ARCHIVEREADER_H
3#include <istream>
4#include <sstream>
5#include <string>
6#include <vector>
7
8#include "ArchiveIO.h"
9
11{
12private:
13 void* pmz_zip_reader_instance_ = NULL;
14 void* pzip_handle_ = NULL;
15 std::vector<std::filesystem::path> entries_path_;
16 void Create() override;
17 std::filesystem::path CurrentEntryPath();
18 bool entries_path_are_loaded_ = false;
19
20public:
21 explicit ArchiveReader(const std::filesystem::path& archivePath);
23 ~ArchiveReader() override;
24
25 int32_t Close() override;
26 void Delete() override;
27
28 int Open() override;
29 int32_t ExtractFile(const std::filesystem::path& FileToExtractPath);
30 int32_t ExtractFile(const std::filesystem::path& FileToExtractPath,
31 const std::filesystem::path& destination);
32 std::vector<std::filesystem::path> ExtractPattern(const std::string& pattern,
33 const std::string& exclude);
34 std::vector<std::filesystem::path> ExtractPattern(const std::string& pattern,
35 const std::string& exclude,
36 const std::filesystem::path& destination);
37 void LocateEntry(const std::filesystem::path& fileToExtractPath);
38 void OpenEntry(const std::filesystem::path& fileToExtractPath);
39 std::istringstream ExtractFileInStringStream(const std::filesystem::path& FileToExtractPath);
40 uint64_t GetNumberOfEntries();
41
42 std::vector<std::filesystem::path> EntriesPath() const
43 {
44 return entries_path_;
45 }
46
47 void LoadEntriesPath();
48 std::vector<std::filesystem::path> GetEntriesPathWithExtension(const std::string& ext);
49
50 void* InternalPointer() const
51 {
52 return pmz_zip_reader_instance_;
53 }
54};
55
56#endif // _ARCHIVEREADER_H
Definition ArchiveIO.h:50
Definition ArchiveReader.h:11