|
crawlserv++
[under development]
Application for crawling and analyzing textual content of websites.
|
RAII wrapper for sources used by libzip. More...
#include <ZipSource.hpp>
Construction and Destruction | |
| ZipSource () | |
| Constructor creating an empty source. More... | |
| ZipSource (const void *data, zip_uint64_t size) | |
| Constructor creating a source from the given data. More... | |
| virtual | ~ZipSource () |
| Destructor clearing the source if necessary. More... | |
Getters | |
| zip_source_t * | get () noexcept |
| Gets a pointer to the underlying source. More... | |
| const zip_source_t * | getc () const noexcept |
| Gets a const pointer to the underlying source. More... | |
| bool | valid () const noexcept |
| Checks whether the underlying source is valid. More... | |
| zip_error_t | getError () const |
| Get the last occurred error. More... | |
Cleanup | |
| void | clear () noexcept |
| Clears the underlying source if necessary. More... | |
Copy and Move | |
| ZipSource (ZipSource &)=delete | |
| Deleted copy constructor. More... | |
| ZipSource & | operator= (ZipSource &)=delete |
| Deleted copy assignment operator. More... | |
| ZipSource (ZipSource &&other) noexcept | |
| Move constructor. More... | |
| ZipSource & | operator= (ZipSource &&other) noexcept |
| Move assignment operator. More... | |
RAII wrapper for sources used by libzip.
Creates the source on construction and clears it on destruction, avoiding memory leaks.
This class is used exclusively by functions in the Data::Compression::Zip namespace.
For more information about the libzip library used, visit its website.
|
inline |
Constructor creating an empty source.
|
inline |
Constructor creating a source from the given data.
| data | Pointer to the data from which to create the source. |
| size | Size of the data in bytes. |
|
inlinevirtual |
Destructor clearing the source if necessary.
References clear().
|
delete |
Deleted copy constructor.
|
inlinenoexcept |
Move constructor.
Moves the source from the specified location into this instance of the class.
| other | The source to move from. |
|
inlinenoexcept |
Clears the underlying source if necessary.
The source will be invalid and valid() will return false afterwards.
Referenced by operator=(), and ~ZipSource().
|
inlinenoexcept |
Gets a pointer to the underlying source.
nullptr if none is set. Referenced by crawlservpp::Wrapper::ZipArchive::close(), and crawlservpp::Wrapper::ZipArchive::ZipArchive().
|
inlinenoexcept |
Gets a const pointer to the underlying source.
nullptr if none is set.
|
inline |
Get the last occurred error.
Referenced by crawlservpp::Wrapper::ZipArchive::ZipArchive().
Deleted copy assignment operator.
Move assignment operator.
Moves the source from the specified location into this instance of the class.
| other | The source to move from. |
*this).References clear().
|
inlinenoexcept |
Checks whether the underlying source is valid.
Referenced by crawlservpp::Wrapper::ZipArchive::close(), and crawlservpp::Wrapper::ZipArchive::ZipArchive().