41 std::expected<void, std::string>
open(
const std::filesystem::path &archive_path);
50 std::span<const std::byte> data);
59 std::string_view content);
67 std::expected<void, std::string>
addFileFromDisk(std::string_view entry_name,
68 const std::filesystem::path &source_path);
74 std::expected<void, std::string>
finalize();
79 [[nodiscard]]
bool isOpen() const noexcept;
std::expected< void, std::string > open(const std::filesystem::path &archive_path)
Opens a new ZIP archive for writing on disk.
Definition ZipArchiveWriter.cpp:49
std::expected< void, std::string > finalize()
Finalizes and closes the archive.
Definition ZipArchiveWriter.cpp:123
std::expected< void, std::string > addFileFromMemory(std::string_view entry_name, std::span< const std::byte > data)
Adds a file to the archive from an in-memory buffer.
Definition ZipArchiveWriter.cpp:71
std::expected< void, std::string > addFileFromString(std::string_view entry_name, std::string_view content)
Adds a text file to the archive from a string or string_view.
Definition ZipArchiveWriter.cpp:90
std::expected< void, std::string > addFileFromDisk(std::string_view entry_name, const std::filesystem::path &source_path)
Adds a file from the local filesystem to the archive.
Definition ZipArchiveWriter.cpp:98
ZipArchiveWriter(ZipArchiveWriter &&other) noexcept
bool isOpen() const noexcept
Checks if an archive is currently open.
Definition ZipArchiveWriter.cpp:47
ZipArchiveWriter & operator=(ZipArchiveWriter &&other) noexcept
ZipArchiveWriter & operator=(const ZipArchiveWriter &)=delete
ZipArchiveWriter()
Definition ZipArchiveWriter.cpp:39
std::unique_ptr< Impl > impl_
Definition ZipArchiveWriter.hpp:83
ZipArchiveWriter(const ZipArchiveWriter &)=delete
Definition ZipArchiveWriter.hpp:19
Definition ZipArchiveWriter.cpp:18