5#include "SqlBackup.hpp"
16typedef struct zip zip_t;
18namespace Lightweight::SqlBackup::detail
31class LIGHTWEIGHT_API WorkerChunkArchive
41 WorkerChunkArchive(std::filesystem::path directory,
43 std::size_t rotationBytes,
44 CompressionMethod method,
48 ~WorkerChunkArchive() noexcept;
50 WorkerChunkArchive(WorkerChunkArchive const&) = delete;
51 WorkerChunkArchive& operator=(WorkerChunkArchive const&) = delete;
52 WorkerChunkArchive(WorkerChunkArchive&&) = delete;
53 WorkerChunkArchive& operator=(WorkerChunkArchive&&) = delete;
59 void Add(std::
string const& entryName, std::string_view data);
64 void Remove(std::
string const& entryName);
71 [[nodiscard]] std::vector<std::filesystem::path> const& SealedArchives() const noexcept
77 [[nodiscard]] std::set<std::string>
const& Tombstones() const noexcept
83 void OpenNextArchive();
85 std::filesystem::path m_directory;
87 std::size_t m_rotationBytes;
88 CompressionMethod m_method;
89 std::uint32_t m_level;
91 zip_t* m_current =
nullptr;
92 std::filesystem::path m_currentPath;
93 std::size_t m_currentInputBytes = 0;
94 std::set<std::string> m_currentNames;
104 std::deque<std::string> m_currentBuffers;
105 unsigned m_rotationIndex = 0;
107 std::vector<std::filesystem::path> m_sealed;
108 std::set<std::string> m_tombstones;