21#include <GenreGroup.h>
22#include <MLException.h>
25#include <libdjvu/ddjvuapi.h>
90 to_utf_8(
const std::string &input,
const char *conv_name);
110 utf_8_to(
const std::string &input,
const char *conv_name);
135 std::filesystem::path
142 std::filesystem::path
149 std::filesystem::path
160 std::filesystem::path
171 std::vector<GenreGroup>
262 const std::filesystem::path &out);
269 std::vector<std::string>
277 std::vector<std::string>
285 std::vector<std::string>
331 template <
class InputIt,
332 class T =
typename std::iterator_traits<InputIt>::value_type>
340 for(InputIt i = start; i != end; i++)
351#pragma omp cancel for
372 template <
class InputIt,
class UnaryPred>
380 for(InputIt i = start; i != end; i++)
391#pragma omp cancel for
414 template <
class InputIt,
415 class T =
typename std::iterator_traits<InputIt>::value_type>
422 for(InputIt i = start + 1; i != end; i++)
426 std::swap(*start, *i);
449 template <
class InputIt,
class UnaryPred>
456 for(InputIt i = start + 1; i != end; i++)
460 std::swap(*start, *i);
477 static std::shared_ptr<AuxFunc>
486 std::shared_ptr<ddjvu_context_t>
492 std::vector<std::tuple<std::string, Genre>>
493 read_genres(
const bool &wrong_loc,
const std::string &locname);
495 std::vector<GenreGroup>
496 read_genre_groups(
const bool &wrong_loc,
const std::string &locname);
499 handleDJVUmsgs(
const std::shared_ptr<ddjvu_context_t> &ctx);
501 bool activated =
true;
503 std::mt19937_64 *rng;
504 std::uniform_int_distribution<uint64_t> *dist;
506 std::shared_ptr<ddjvu_context_t> djvu_context;
std::vector< std::string > get_supported_archive_types_unpacking()
Same as get_supported_types(), but returns only archives types, available for unpacking.
std::filesystem::path get_selfpath()
Returns absolute path to program executable file.
std::string time_t_to_date(const time_t &tt)
Converts time_t value to calendar date.
static InputIt parallelRemove(InputIt start, InputIt end, const T &val)
"Remove" method for C++ containers.
Definition AuxFunc.h:417
std::filesystem::path homePath()
Returns user home directory path.
std::vector< std::string > get_supported_archive_types_packing()
Same as get_supported_types(), but returns only archives types, available for packing.
std::string detect_encoding(const std::string &buf)
Tries to detect string encoding.
std::string utf8_to_system(const std::string &input)
Converts UTF-8 string to string in system default encoding.
bool get_activated()
Checks if depencies have been successfully activated.
std::string to_utf_8(const std::string &input, const char *conv_name)
Converts string to UTF-8 string.
static InputIt parallelFind(InputIt start, InputIt end, const T &val)
'Find' method for C++ standard containers.
Definition AuxFunc.h:334
std::string randomFileName()
Returns random string.
std::vector< std::string > get_supported_types()
Returns supported file types.
void open_book_callback(const std::filesystem::path &path)
Opens given file in default system application.
static std::shared_ptr< AuxFunc > create()
Creats AuxFunc object.
void html_to_utf8(std::string &input)
Converst 'html' symbols to UTF-8 characters.
std::string utf_8_to(const std::string &input, const char *conv_name)
Converts UTF-8 string to string in chosen encoding.
static InputIt parallelFindIf(InputIt start, InputIt end, UnaryPred predicate)
'Find' method for C++ standard containers.
Definition AuxFunc.h:374
virtual ~AuxFunc()
AuxFunc destructor.
const char * get_converter_by_number(const int32_t &num)
Returns converter name.
std::string get_extension(const std::filesystem::path &p)
Returns file extesion.
void copy_book_callback(const std::filesystem::path &source, const std::filesystem::path &out)
Replaces out file by source file.
std::string to_hex(const std::string &source)
Converts given string to hex format.
bool if_supported_type(const std::filesystem::path &ch_p)
Checks if given file is supported by MLBookProc.
static InputIt parallelRemoveIf(InputIt start, InputIt end, UnaryPred predicate)
'Remove' method for C++ containers.
Definition AuxFunc.h:451
std::filesystem::path temp_path()
Returns absolute path to system temporary directory.
std::vector< GenreGroup > get_genre_list()
Returns translated genre groups and genres names.
std::filesystem::path share_path()
Returns absolute path to share directory, used by MLBookProc.
std::string libgcrypt_error_handling(const gcry_error_t &err)
Auxiliary method to reinterpret libgcrypt errors as strings.
int32_t get_charset_conv_quantity()
Returns number of available converters.
std::shared_ptr< ddjvu_context_t > getDJVUContext()
Returns smart pointer to djvu context object.
std::string stringToLower(const std::string &line)
Converts all letters of the string to lowercase letters.