diff options
Diffstat (limited to 'src/archive.hpp')
-rw-r--r-- | src/archive.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/archive.hpp b/src/archive.hpp index d8464e5..e803bd2 100644 --- a/src/archive.hpp +++ b/src/archive.hpp @@ -9,6 +9,8 @@ #include <vector> #include <zip.h> +#include <fud_status.hpp> + namespace getsuyomi { enum class ArchiveError @@ -26,17 +28,26 @@ class Archive { virtual ~Archive() = default; virtual ArchiveResult getPage(size_t page) = 0; virtual size_t numPages() const = 0; + virtual bool valid() const = 0; }; class ZipArchive : public Archive { public: explicit ZipArchive(const QString& filename); + ZipArchive(const ZipArchive&) = delete; + ZipArchive(ZipArchive&&); virtual ~ZipArchive() override; + ZipArchive& operator=(const ZipArchive&) = delete; + ZipArchive& operator=(ZipArchive&& rhs); + virtual ArchiveResult getPage(size_t page) override; virtual size_t numPages() const override; + bool valid() const override; + private: - void populate(); + void cleanup(); + fud::FudStatus populate(); zip_t* m_archive{nullptr}; |