21#include <GenreGroup.h>
22#include <MLException.h>
25#include <libdjvu/ddjvuapi.h>
89 to_utf_8(
const std::string &input,
const char *conv_name);
109 utf_8_to(
const std::string &input,
const char *conv_name);
134 std::filesystem::path
141 std::filesystem::path
148 std::filesystem::path
159 std::filesystem::path
170 std::vector<GenreGroup>
261 const std::filesystem::path &out);
268 std::vector<std::string>
276 std::vector<std::string>
284 std::vector<std::string>
330 template <
class InputIt,
331 class T =
typename std::iterator_traits<InputIt>::value_type>
339 for(InputIt i = start; i != end; i++)
350#pragma omp cancel for
371 template <
class InputIt,
class UnaryPred>
379 for(InputIt i = start; i != end; i++)
390#pragma omp cancel for
413 template <
class InputIt,
414 class T =
typename std::iterator_traits<InputIt>::value_type>
421 for(InputIt i = start + 1; i != end; i++)
425 std::swap(*start, *i);
448 template <
class InputIt,
class UnaryPred>
455 for(InputIt i = start + 1; i != end; i++)
459 std::swap(*start, *i);
476 static std::shared_ptr<AuxFunc>
485 std::shared_ptr<ddjvu_context_t>
491 std::vector<std::tuple<std::string, Genre>>
492 read_genres(
const bool &wrong_loc,
const std::string &locname);
494 std::vector<GenreGroup>
495 read_genre_groups(
const bool &wrong_loc,
const std::string &locname);
498 handleDJVUmsgs(
const std::shared_ptr<ddjvu_context_t> &ctx);
500 bool activated =
true;
502 std::mt19937_64 *rng;
503 std::uniform_int_distribution<uint64_t> *dist;
505 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:416
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:333
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:373
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:450
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.