MLBookProc 2.1
Loading...
Searching...
No Matches
OpenBook.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 OPENBOOK_H
17#define OPENBOOK_H
18
19#include <BaseID.h>
20#include <LibArchive.h>
21#include <MLBookProc.h>
22#include <UDBElement.h>
23#include <filesystem>
24#include <functional>
25
32{
33public:
38 OpenBook(const std::shared_ptr<MLBookProc> &mlbp);
39
40 virtual ~OpenBook();
41
55 void
56 openBook(const UDBElement &book_search_result,
57 const std::filesystem::path &unpacking_directory,
58 std::function<void(const std::filesystem::path &)> open_call_back);
59
60private:
61 void
62 openBook(const std::filesystem::path &p,
63 std::function<void(const std::filesystem::path &)> open_call_back,
64 const UDBElement &path);
65
66 std::shared_ptr<MLBookProc> mlbp;
67
68 LibArchive *la = nullptr;
69
70 std::vector<std::string> supported_archives;
71
72 std::filesystem::path unpack_dir;
73
74 int call_count = 0;
75
76 BaseID bid;
77};
78
79#endif // OPENBOOK_H
The BaseID class.
Definition BaseID.h:28
The LibArchive class.
Definition LibArchive.h:34
void openBook(const UDBElement &book_search_result, const std::filesystem::path &unpacking_directory, std::function< void(const std::filesystem::path &)> open_call_back)
OpenBook(const std::shared_ptr< MLBookProc > &mlbp)
OpenBook constructor.