32 #ifndef WRAPPER_ZIPSOURCE_HPP_ 33 #define WRAPPER_ZIPSOURCE_HPP_ 67 ZipSource(
const void * data, zip_uint64_t size);
74 [[nodiscard]] zip_source_t *
get() noexcept;
75 [[nodiscard]]
const zip_source_t *
getc()
const noexcept;
76 [[nodiscard]]
bool valid()
const noexcept;
77 [[nodiscard]] zip_error_t
getError()
const;
83 void clear() noexcept;
104 zip_source_t * ptr{
nullptr};
116 this->ptr = zip_source_buffer_create(
nullptr, 0, 0, &(this->error));
130 this->ptr = zip_source_buffer_create(data, size, 0, &(this->error));
166 return this->ptr !=
nullptr;
191 if(this->ptr !=
nullptr) {
192 zip_source_free(this->ptr);
197 zip_error_fini(&(this->error));
241 this->ptr = other.ptr;
ZipSource()
Constructor creating an empty source.
Definition: ZipSource.hpp:115
const zip_source_t * getc() const noexcept
Gets a const pointer to the underlying source.
Definition: ZipSource.hpp:153
ZipSource & operator=(ZipSource &)=delete
Deleted copy assignment operator.
Namespace for RAII wrappers and Wrapper::Database.
Definition: Database.hpp:109
bool valid() const noexcept
Checks whether the underlying source is valid.
Definition: ZipSource.hpp:165
zip_error_t getError() const
Get the last occurred error.
Definition: ZipSource.hpp:176
RAII wrapper for sources used by libzip.
Definition: ZipSource.hpp:61
zip_source_t * get() noexcept
Gets a pointer to the underlying source.
Definition: ZipSource.hpp:143
void clear() noexcept
Clears the underlying source if necessary.
Definition: ZipSource.hpp:190
virtual ~ZipSource()
Destructor clearing the source if necessary.
Definition: ZipSource.hpp:134