summaryrefslogtreecommitdiff
path: root/src/archive.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-09-23 00:33:33 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-09-23 00:33:33 -0500
commit500e1f9892dd41419663e9f72cf47bab5b2aca0b (patch)
treea0709693d5317a6b89cdda7ac3143886b93552f4 /src/archive.hpp
parentfa4b4097d3283e1d6e6376c70910e245f0b1f6ec (diff)
Saving work.
Diffstat (limited to 'src/archive.hpp')
-rw-r--r--src/archive.hpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/archive.hpp b/src/archive.hpp
index d8464e5..257f204 100644
--- a/src/archive.hpp
+++ b/src/archive.hpp
@@ -3,13 +3,14 @@
#include "result.hpp"
-#include <QtWidgets>
#include <cstdlib>
+#include <memory>
+#include <optional>
#include <string>
#include <vector>
#include <zip.h>
-namespace getsuyomi {
+namespace bookmouse {
enum class ArchiveError
{
@@ -19,7 +20,7 @@ enum class ArchiveError
Unimplemented
};
-using ArchiveResult = Result<std::reference_wrapper<const QImage>, ArchiveError>;
+using ArchiveResult = Result<std::reference_wrapper<const std::vector<char>>, ArchiveError>;
class Archive {
public:
@@ -30,8 +31,13 @@ class Archive {
class ZipArchive : public Archive {
public:
- explicit ZipArchive(const QString& filename);
+ explicit ZipArchive(const std::string& filename);
virtual ~ZipArchive() override;
+ ZipArchive(const ZipArchive& rhs) = delete;
+ ZipArchive(ZipArchive&& rhs);
+ ZipArchive& operator=(const ZipArchive& rhs) = delete;
+ ZipArchive& operator=(ZipArchive&& rhs);
+
virtual ArchiveResult getPage(size_t page) override;
virtual size_t numPages() const override;
@@ -44,9 +50,9 @@ class ZipArchive : public Archive {
std::vector<std::string> m_filenames{};
std::vector<size_t> m_fileSizes{};
- std::vector<std::optional<QImage>> m_pages{};
+ std::vector<std::optional<std::vector<char>>> m_pages{};
};
-} // namespace getsuyomi
+} // namespace bookmouse
#endif