MLBookProc 1.0.1
 
Loading...
Searching...
No Matches
OpenBook.h
1/*
2 * Copyright (C) 2024-2025 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
17#ifndef OPENBOOK_H
18#define OPENBOOK_H
19
20#include <ArchEntry.h>
21#include <AuxFunc.h>
22#include <BookBaseEntry.h>
23#include <SelfRemovingPath.h>
24#include <filesystem>
25#include <functional>
26#include <memory>
27#include <string>
28#include <vector>
29
36{
37public:
42 OpenBook(const std::shared_ptr<AuxFunc> &af);
43
68 std::filesystem::path
70 const BookBaseEntry &bbe, const bool &copy,
71 const std::filesystem::path &copy_path, const bool &find_fbd,
72 std::function<void(const std::filesystem::path &path)> open_callback);
73
74private:
75 std::filesystem::path
76 open_archive(const BookBaseEntry &bbe, const std::string &ext,
77 const std::filesystem::path &copy_path, const bool &find_fbd);
78
79 void
80 correct_separators(std::vector<ArchEntry> &files);
81
82 bool
83 compare_func(const ArchEntry &ent, const bool &encoding,
84 const std::string &conv_nm,
85 const std::filesystem::path &ch_fbd);
86
87 std::shared_ptr<AuxFunc> af;
88
89 SelfRemovingPath reading;
90};
91
92#endif // OPENBOOK_H
The ArchEntry class.
Definition ArchEntry.h:31
The BookBaseEntry class.
Definition BookBaseEntry.h:30
std::filesystem::path open_book(const BookBaseEntry &bbe, const bool &copy, const std::filesystem::path &copy_path, const bool &find_fbd, std::function< void(const std::filesystem::path &path)> open_callback)
Opens book.
OpenBook(const std::shared_ptr< AuxFunc > &af)
OpenBook constructor.
The SelfRemovingPath class.
Definition SelfRemovingPath.h:35