MLBookProc
2.1
Toggle main menu visibility
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
64
class
MLBookProc
65
{
66
public
:
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>
85
create
();
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>
118
getSupportedFileTypes
();
119
125
std::vector<std::string>
126
getSupportedArchivesTypesUnpacking
();
127
133
std::vector<std::string>
134
getSupportedArchivesTypesPacking
();
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
172
randomNumber
();
173
179
std::filesystem::path
180
tempDirPath
();
181
187
std::filesystem::path
188
randomFileName
();
189
197
std::string
198
timeToDate
(
const
time_t &tt);
199
205
std::shared_ptr<DJVUContext>
206
getDJVUContext
();
207
208
private
:
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
MLBookProc::getSupportedArchivesTypesPacking
std::vector< std::string > getSupportedArchivesTypesPacking()
MLBookProc::randomNumber
T randomNumber()
MLBookProc::getDJVUContext
std::shared_ptr< DJVUContext > getDJVUContext()
MLBookProc::getExtension
std::string getExtension(const std::string &file_name)
MLBookProc::ifSupportedFile
bool ifSupportedFile(const std::string &filename)
MLBookProc::stringToLower
std::string stringToLower(const std::string &str)
MLBookProc::getSupportedArchivesTypesUnpacking
std::vector< std::string > getSupportedArchivesTypesUnpacking()
MLBookProc::tempDirPath
std::filesystem::path tempDirPath()
MLBookProc::getExtension
std::string getExtension(const std::filesystem::path &p)
MLBookProc::create
static std::shared_ptr< MLBookProc > create()
MLBookProc::getSupportedFileTypes
std::vector< std::string > getSupportedFileTypes()
MLBookProc::randomFileName
std::filesystem::path randomFileName()
MLBookProc::libgcryptErrorHandling
void libgcryptErrorHandling(const gcry_error_t &err)
MLBookProc::ifSupportedFile
bool ifSupportedFile(const std::filesystem::path &p)
MLBookProc::timeToDate
std::string timeToDate(const time_t &tt)
MLBookProc.h
Generated by
1.17.0