16#ifndef CREATECOLLECTION_H
17#define CREATECOLLECTION_H
19#include <ArchiveParser.h>
21#include <MLBookProc.h>
24#include <condition_variable>
45 const int &threads_num =
int(1));
58 const std::filesystem::path &base_path);
68 const std::filesystem::path &base_path);
83 saveBase(
const std::filesystem::path &base_path, UDBase &col_base);
127 std::vector<std::tuple<const std::vector<UDBElement> *,
128 std::vector<UDBElement>::const_iterator>>
137 std::vector<std::tuple<
const std::vector<UDBElement> *,
138 std::vector<UDBElement>::const_iterator>> &files);
170 fb2Parsing(UDBElement *file,
const std::filesystem::path &file_path);
179 epubParsing(UDBElement *file,
const std::filesystem::path &file_path);
188 pdfParsing(UDBElement *file,
const std::filesystem::path &file_path);
197 djvuParsing(UDBElement *file,
const std::filesystem::path &file_path);
206 odtParsing(UDBElement *file,
const std::filesystem::path &file_path);
215 txtParsing(UDBElement *file,
const std::filesystem::path &file_path);
224 docParsing(UDBElement *file,
const std::filesystem::path &file_path);
233 rtfParsing(UDBElement *file,
const std::filesystem::path &file_path);
242 docxParsing(UDBElement *file,
const std::filesystem::path &file_path);
251 mobiParsing(UDBElement *file,
const std::filesystem::path &file_path);
290 bufHash(UDBElement *file,
const std::filesystem::path &file_path,
291 const std::string &buf);
298 std::shared_ptr<MLBookProc>
mlbp;
309 std::shared_ptr<std::vector<std::tuple<unsigned, bool>>>
threads_v;
The BaseID class.
Definition BaseID.h:28
std::shared_ptr< std::vector< std::tuple< unsigned, bool > > > threads_v
Definition CreateCollection.h:309
void docParsing(UDBElement *file, const std::filesystem::path &file_path)
std::mutex arch_proc_mtx
Definition CreateCollection.h:344
std::vector< std::tuple< std::filesystem::path, std::string > > already_hashed
Definition CreateCollection.h:354
std::atomic< bool > cancel
Definition CreateCollection.h:330
CreateCollection(const std::shared_ptr< MLBookProc > &mlbp, const int &threads_num=int(1))
CreateCollection constructor.
void createInpxCollection(const std::filesystem::path &path_to_inpx, const std::filesystem::path &base_path)
size_t countFiles(const std::vector< UDBElement > &el_v)
void rtfParsing(UDBElement *file, const std::filesystem::path &file_path)
void filesCollecting(const std::vector< std::filesystem::path > &files_and_dirs, UDBase &col_base)
void docxParsing(UDBElement *file, const std::filesystem::path &file_path)
BaseID bid
Definition CreateCollection.h:359
void cleanBase(std::vector< UDBElement > &items)
void odtParsing(UDBElement *file, const std::filesystem::path &file_path)
void pdfParsing(UDBElement *file, const std::filesystem::path &file_path)
void archiveParsing(UDBElement *file, const std::filesystem::path &file_path)
static void saveBase(const std::filesystem::path &base_path, UDBase &col_base)
std::atomic< double > processed
Definition CreateCollection.h:366
void fileParsing(UDBElement *file)
double total
Definition CreateCollection.h:373
std::function< void(double processed, double total)> signal_parsing_progress
Definition CreateCollection.h:96
void epubParsing(UDBElement *file, const std::filesystem::path &file_path)
void processFiles(const std::vector< UDBElement > &items)
void bufHash(UDBElement *file, const std::filesystem::path &file_path, const std::string &buf)
void txtParsing(UDBElement *file, const std::filesystem::path &file_path)
void djvuParsing(UDBElement *file, const std::filesystem::path &file_path)
std::shared_ptr< std::mutex > threads_v_mtx
Definition CreateCollection.h:316
void removeDublicates(std::vector< std::tuple< const std::vector< UDBElement > *, std::vector< UDBElement >::const_iterator > > &files)
std::shared_ptr< MLBookProc > mlbp
Definition CreateCollection.h:298
std::string bufferHash(const std::string &buf)
void fb2Parsing(UDBElement *file, const std::filesystem::path &file_path)
std::string fileHash(const std::filesystem::path &file_path)
std::function< void(const size_t &files_found)> signal_files_collecting
Definition CreateCollection.h:89
std::vector< std::tuple< const std::vector< UDBElement > *, std::vector< UDBElement >::const_iterator > > getAllFiles(const std::vector< UDBElement > &el_v)
void createCollection(const std::vector< std::filesystem::path > &files_and_dirs, const std::filesystem::path &base_path)
std::vector< std::shared_ptr< ArchiveParser > > arch_proc
Definition CreateCollection.h:337
std::shared_ptr< std::condition_variable > threads_v_var
Definition CreateCollection.h:323
void mobiParsing(UDBElement *file, const std::filesystem::path &file_path)