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
8class ArchiveWriter : public ArchiveIO {
9 private:
10 void* pmz_zip_writer_instance_ = nullptr;
11 void* pzip_handle_ = nullptr;
12 void Create() override;
13 mz_zip_file fileInfo_ = {};
14
15 int32_t CloseInternal();
16 void DeleteInternal();
17
18 public:
19 explicit ArchiveWriter(const std::filesystem::path& archivePath);
21 ~ArchiveWriter() override;
22
23 int32_t Close() override;
24 void Delete() override;
25 int32_t CloseUnsafe();
26 void DeleteUnsafe();
27
28 int Open() override;
29 void InitFileInfo();
30 int32_t AddFileInArchive(const FileBuffer& FileBufferToAdd);
31 int32_t AddFileInArchive(const std::filesystem::path& FileToAdd);
32 int32_t AddPathInArchive(const std::filesystem::path& path_to_add,
33 const std::filesystem::path& root_path);
34 void* InternalPointer() const override { return pmz_zip_writer_instance_; }
35};
Definition ArchiveIO.h:36
Definition ArchiveWriter.h:8
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:139
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:154
Definition FileInBuffer.h:6