MLBookProc 2.1
Loading...
Searching...
No Matches
MLBookProc.h
1/*
2 * Copyright (C) 2026 Yury Bobylev <bobilev_yury@mail.ru>
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation, version 3.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16#ifndef MLBOOKPROC_H
17#define MLBOOKPROC_H
18
19#include <DJVUContext.h>
20#include <filesystem>
21#include <gcrypt.h>
22#include <gpg-error.h>
23#include <memory>
24#include <mutex>
25#include <string>
26#include <vector>
27
54
64class MLBookProc
65{
66public:
67 MLBookProc(const MLBookProc &) = delete;
68 MLBookProc(MLBookProc &&) = delete;
69
70 MLBookProc &
71 operator=(const MLBookProc &)
72 = delete;
73
74 MLBookProc &
75 operator=(MLBookProc &&)
76 = delete;
77
78 virtual ~MLBookProc();
79
84 static std::shared_ptr<MLBookProc>
86
93 std::string
94 stringToLower(const std::string &str);
95
101 std::string
102 getExtension(const std::filesystem::path &p);
103
109 std::string
110 getExtension(const std::string &file_name);
111
117 std::vector<std::string>
119
125 std::vector<std::string>
127
133 std::vector<std::string>
135
142 bool
143 ifSupportedFile(const std::string &filename);
144
151 bool
152 ifSupportedFile(const std::filesystem::path &p);
153
162 void
163 libgcryptErrorHandling(const gcry_error_t &err);
164
170 template <typename T>
171 T
173
179 std::filesystem::path
181
187 std::filesystem::path
189
197 std::string
198 timeToDate(const time_t &tt);
199
205 std::shared_ptr<DJVUContext>
207
208private:
209 MLBookProc();
210
211 void
212 activation();
213
214 static void
215 djvuMessageCallback(ddjvu_context_t *context, void *closure);
216
217 std::vector<std::string> supported_types;
218
219 std::weak_ptr<DJVUContext> djvu_contex;
220 std::mutex djvu_context_mtx;
221};
222
223#endif // MLBOOKPROC_H
std::vector< std::string > getSupportedArchivesTypesPacking()
T randomNumber()
std::shared_ptr< DJVUContext > getDJVUContext()
std::string getExtension(const std::string &file_name)
bool ifSupportedFile(const std::string &filename)
std::string stringToLower(const std::string &str)
std::vector< std::string > getSupportedArchivesTypesUnpacking()
std::filesystem::path tempDirPath()
std::string getExtension(const std::filesystem::path &p)
static std::shared_ptr< MLBookProc > create()
std::vector< std::string > getSupportedFileTypes()
std::filesystem::path randomFileName()
void libgcryptErrorHandling(const gcry_error_t &err)
bool ifSupportedFile(const std::filesystem::path &p)
std::string timeToDate(const time_t &tt)