MLBookProc 1.0
 
Loading...
Searching...
No Matches
DJVUParser.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 DJVUPARSER_H
18#define DJVUPARSER_H
19
20#include <AuxFunc.h>
21#include <BookInfoEntry.h>
22#include <BookParseEntry.h>
23#include <filesystem>
24#include <libdjvu/ddjvuapi.h>
25#include <memory>
26
35{
36public:
41 DJVUParser(const std::shared_ptr<AuxFunc> &af);
42
49 djvu_parser(const std::filesystem::path &filepath);
50
56 std::shared_ptr<BookInfoEntry>
57 djvu_book_info(const std::filesystem::path &filepath);
58
59private:
60 bool
61 handleDJVUmsgs(const std::shared_ptr<ddjvu_context_t> &ctx,
62 const std::shared_ptr<ddjvu_document_t> &doc,
63 const bool &wait = bool(true));
64
65 void
66 getTag(const std::string &exp, const std::string &tag, std::string &line);
67
68 std::shared_ptr<AuxFunc> af;
69};
70
71#endif // DJVUPARSER_H
The BookParseEntry class.
Definition BookParseEntry.h:30
std::shared_ptr< BookInfoEntry > djvu_book_info(const std::filesystem::path &filepath)
Returns book info and book cover.
BookParseEntry djvu_parser(const std::filesystem::path &filepath)
Parses djvu book.
DJVUParser(const std::shared_ptr< AuxFunc > &af)
DJVUParser constructor.