21#include <GenreGroup.h>
25#include <libdjvu/ddjvuapi.h>
97 __attribute__((deprecated)) std::string
98 to_utf_8(
const std::string &input,
const char *conv_name);
109 __attribute__((deprecated)) std::string
125 __attribute__((deprecated)) std::string
126 utf_8_to(
const std::string &input,
const char *conv_name);
147 __attribute__((deprecated)) std::string
154 std::filesystem::path
165 __attribute__((deprecated)) std::filesystem::path
172 std::filesystem::path
183 __attribute__((deprecated)) std::filesystem::path
190 std::filesystem::path
204 __attribute__((deprecated)) std::filesystem::path
215 std::filesystem::path
226 std::vector<GenreGroup>
322 __attribute__((deprecated))
void
354 const std::filesystem::path &out);
361 std::vector<std::string>
369 std::vector<std::string>
377 std::vector<std::string>
431 template <
class InputIt,
432 class T =
typename std::iterator_traits<InputIt>::value_type>
434 parallelFind(InputIt start, InputIt end,
const T &val)
437 const T *val_ptr = &val;
441 for(InputIt i = start; i != end; i++)
452#pragma omp cancel for
473 template <
class InputIt,
class UnaryPred>
475 parallelFindIf(InputIt start, InputIt end, UnaryPred predicate)
481 for(InputIt i = start; i != end; i++)
492#pragma omp cancel for
515 template <
class InputIt,
516 class T =
typename std::iterator_traits<InputIt>::value_type>
518 parallelRemove(InputIt start, InputIt end,
const T &val)
520 start = parallelFind(start, end, val);
526#pragma omp for ordered
527 for(T *i = s + 1; i != e; i++)
533 *s = std::move((*i));
558 template <
class InputIt,
class UnaryPred,
559 class T =
typename std::iterator_traits<InputIt>::value_type>
561 parallelRemoveIf(InputIt start, InputIt end, UnaryPred predicate)
563 start = parallelFindIf(start, end, predicate);
569#pragma omp for ordered
570 for(T *i = s + 1; i != e; i++)
595 static std::shared_ptr<AuxFunc>
632 std::tuple<std::shared_ptr<ddjvu_context_t>, std::shared_ptr<int>>
638 std::vector<std::tuple<std::string, Genre>>
639 read_genres(
const bool &wrong_loc,
const std::string &locname);
641 std::vector<GenreGroup>
642 read_genre_groups(
const bool &wrong_loc,
const std::string &locname);
645 djvuMessageCallback(ddjvu_context_t *context,
void *closure);
647 bool activated =
true;
649 std::mt19937_64 *rng;
650 std::uniform_int_distribution<uint64_t> *dist;
652 std::weak_ptr<ddjvu_context_t> djvu_context;
654 omp_lock_t djvu_context_mtx;
656 std::mutex djvu_context_mtx;
658 std::vector<std::weak_ptr<int>> djvu_pipes;
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.
std::string getExtension(const std::string &fnm)
Returns file extesion.
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.
std::string randomFileName()
Returns random string.
std::vector< std::string > get_supported_types()
Returns supported file types.
std::filesystem::path tempPath()
Returns absolute path to system temporary directory.
bool ifSupportedArchivePackingType(const std::filesystem::path &ch_p)
Checks if given archive is supported by MLBookProc for packing.
std::filesystem::path sharePath()
Returns absolute path to share directory, used by MLBookProc.
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.
std::tuple< std::shared_ptr< ddjvu_context_t >, std::shared_ptr< int > > getDJVUContext()
Returns tuple with smart pointer to djvu context object and smart pointer to djvu context signal pipe...
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 htmlToUtf8(std::string &result)
Converst 'html' symbols to UTF-8 characters.
std::filesystem::path getSelfpath()
Returns absolute path to program executable file.
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.
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::string stringToLower(const std::string &line)
Converts all letters of the string to lowercase letters.
bool ifSupportedArchiveUnpackaingType(const std::filesystem::path &ch_p)
Checks if given archive is supported by MLBookProc.