Move-only RAII wrapper around miniz for creating ZIP archives.
More...
#include <ZipArchiveWriter.hpp>
|
| | ZipArchiveWriter () |
| | ~ZipArchiveWriter () |
| | ZipArchiveWriter (const ZipArchiveWriter &)=delete |
| ZipArchiveWriter & | operator= (const ZipArchiveWriter &)=delete |
| | ZipArchiveWriter (ZipArchiveWriter &&other) noexcept |
| ZipArchiveWriter & | operator= (ZipArchiveWriter &&other) noexcept |
| std::expected< void, std::string > | open (const std::filesystem::path &archive_path) |
| | Opens a new ZIP archive for writing on disk.
|
| 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.
|
| 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.
|
| 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.
|
| std::expected< void, std::string > | finalize () |
| | Finalizes and closes the archive.
|
| bool | isOpen () const noexcept |
| | Checks if an archive is currently open.
|
Move-only RAII wrapper around miniz for creating ZIP archives.
◆ ZipArchiveWriter() [1/3]
| correlation::utils::ZipArchiveWriter::ZipArchiveWriter |
( |
| ) |
|
◆ ~ZipArchiveWriter()
| correlation::utils::ZipArchiveWriter::~ZipArchiveWriter |
( |
| ) |
|
|
default |
◆ ZipArchiveWriter() [2/3]
| correlation::utils::ZipArchiveWriter::ZipArchiveWriter |
( |
const ZipArchiveWriter & | | ) |
|
|
delete |
◆ ZipArchiveWriter() [3/3]
| correlation::utils::ZipArchiveWriter::ZipArchiveWriter |
( |
ZipArchiveWriter && | other | ) |
|
|
defaultnoexcept |
◆ addFileFromDisk()
| std::expected< void, std::string > correlation::utils::ZipArchiveWriter::addFileFromDisk |
( |
std::string_view | entry_name, |
|
|
const std::filesystem::path & | source_path ) |
Adds a file from the local filesystem to the archive.
- Parameters
-
| entry_name | Path inside the ZIP archive. |
| source_path | Path on disk to read from. |
- Returns
- std::expected<void, std::string> Success or error message.
◆ addFileFromMemory()
| std::expected< void, std::string > correlation::utils::ZipArchiveWriter::addFileFromMemory |
( |
std::string_view | entry_name, |
|
|
std::span< const std::byte > | data ) |
Adds a file to the archive from an in-memory buffer.
- Parameters
-
| entry_name | Path inside the ZIP archive (e.g. "plots/rdf.svg"). |
| data | Binary data buffer. |
- Returns
- std::expected<void, std::string> Success or error message.
◆ addFileFromString()
| std::expected< void, std::string > correlation::utils::ZipArchiveWriter::addFileFromString |
( |
std::string_view | entry_name, |
|
|
std::string_view | content ) |
Adds a text file to the archive from a string or string_view.
- Parameters
-
| entry_name | Path inside the ZIP archive (e.g. "summary.txt"). |
| content | Text or data string. |
- Returns
- std::expected<void, std::string> Success or error message.
◆ finalize()
| std::expected< void, std::string > correlation::utils::ZipArchiveWriter::finalize |
( |
| ) |
|
Finalizes and closes the archive.
- Returns
- std::expected<void, std::string> Success or error message.
◆ isOpen()
| bool correlation::utils::ZipArchiveWriter::isOpen |
( |
| ) |
const |
|
nodiscardnoexcept |
Checks if an archive is currently open.
◆ open()
| std::expected< void, std::string > correlation::utils::ZipArchiveWriter::open |
( |
const std::filesystem::path & | archive_path | ) |
|
Opens a new ZIP archive for writing on disk.
- Parameters
-
| archive_path | The destination path for the ZIP file. |
- Returns
- std::expected<void, std::string> Success or error message.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ impl_
| std::unique_ptr<Impl> correlation::utils::ZipArchiveWriter::impl_ |
|
private |
The documentation for this class was generated from the following files: