|
Lightweight 0.20251202.0
|
#include <ZipEntry.hpp>
Public Member Functions | |
| ZipEntry (ZipEntry const &)=delete | |
| ZipEntry & | operator= (ZipEntry const &)=delete |
| ZipEntry (ZipEntry &&other) noexcept | |
| Move constructor. Transfers ownership of the file handle. | |
| ZipEntry & | operator= (ZipEntry &&other) noexcept |
| Move assignment operator. Transfers ownership of the file handle. | |
| ~ZipEntry () noexcept | |
| Destructor. Closes the entry if open. | |
| bool | IsOpen () const noexcept |
| std::expected< size_t, ZipError > | Read (std::span< uint8_t > buffer) |
| std::expected< std::vector< uint8_t >, ZipError > | ReadAll (size_t expectedSize) |
| void | Close () noexcept |
| Closes the entry. | |
RAII wrapper for a ZIP entry file handle (zip_file_t*).
This class provides safe, scoped access to a single entry within a ZIP archive. The entry is automatically closed when the ZipEntry object is destroyed.
ZipEntry objects are non-copyable but movable.
Definition at line 34 of file ZipEntry.hpp.
|
noexcept |
Checks if the entry is currently open.
| std::expected< size_t, ZipError > Lightweight::Zip::ZipEntry::Read | ( | std::span< uint8_t > | buffer | ) |
Reads data from the entry into a buffer.
| buffer | The buffer to read into. |
| std::expected< std::vector< uint8_t >, ZipError > Lightweight::Zip::ZipEntry::ReadAll | ( | size_t | expectedSize | ) |
Reads all data from the entry.
| expectedSize | The expected size of the entry in bytes. |