Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
ArchiveWriter.h
1#pragma once
2
3#include <vector>
4
5#include "ArchiveIO.h"
6#include "FileInBuffer.h"
7
9{
10private:
11 void* pmz_zip_writer_instance_ = nullptr;
12 void* pzip_handle_ = nullptr;
13 void Create() override;
14 mz_zip_file fileInfo_ = {};
15
16 int32_t CloseInternal();
17 void DeleteInternal();
18
19public:
20 explicit ArchiveWriter(const std::filesystem::path& archivePath);
22 ~ArchiveWriter() override;
23
24 int32_t Close() override;
25 void Delete() override;
26 int32_t CloseUnsafe();
27 void DeleteUnsafe();
28
29 int Open() override;
30 void InitFileInfo();
31 int32_t AddFileInArchive(const FileBuffer& FileBufferToAdd);
32 int32_t AddFileInArchive(const std::filesystem::path& FileToAdd);
33 int32_t AddPathInArchive(const std::filesystem::path& path_to_add,
34 const std::filesystem::path& root_path);
35
36 void* InternalPointer() const override
37 {
38 return pmz_zip_writer_instance_;
39 }
40};
Definition ArchiveIO.h:50
Definition ArchiveWriter.h:9
int32_t CloseUnsafe()
Close the archive Not thread safe Meant to be used with DeleteUnsafe and both of them guarded by a si...
Definition ArchiveWriter.cpp:172
void DeleteUnsafe()
Delete the archive Not thread safe Meant to be used with CloseUnsafe and both of them guarded by a si...
Definition ArchiveWriter.cpp:189
Definition FileInBuffer.h:7