summaryrefslogtreecommitdiff
path: root/src/archive.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-09-29 09:28:28 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-09-29 09:28:28 -0500
commit0e648c7c62944cd81aa57f10ac01cdabe2f2b7e0 (patch)
treea2a0912e33e7a18f6c9e32e5e4b5fb0a4ba622bc /src/archive.hpp
parentfa4b4097d3283e1d6e6376c70910e245f0b1f6ec (diff)
Remember various settings.
Diffstat (limited to 'src/archive.hpp')
-rw-r--r--src/archive.hpp13
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};