MLBookProc 1.0
 
Loading...
Searching...
No Matches
FB2Parser.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 FB2PARSER_H
18#define FB2PARSER_H
19
20#include <AuxFunc.h>
21#include <BookInfoEntry.h>
22#include <BookParseEntry.h>
23#include <XMLParser.h>
24#include <XMLTag.h>
25#include <memory>
26#include <string>
27#include <vector>
28
36class FB2Parser : public XMLParser
37{
38public:
43 FB2Parser(const std::shared_ptr<AuxFunc> &af);
44
53 fb2_parser(const std::string &book);
54
60 std::shared_ptr<BookInfoEntry>
61 fb2_book_info(const std::string &book);
62
63private:
65 fb2_description(const std::string &book);
66
67 std::string
68 fb2_author(const std::string &book, const std::vector<XMLTag> &author);
69
70 std::string
71 fb2_series(const std::vector<XMLTag> &sequence);
72
73 std::string
74 fb2_genres(const std::string &book, const std::vector<XMLTag> &genres);
75
76 void
77 fb2_annotation_decode(const std::string &book, std::string &result);
78
79 void
80 fb2_cover(const std::string &book, std::string &cover);
81
82 void
83 fb2_extra_info(const std::string &book, BookInfoEntry &result);
84
85 void
86 fb2_publisher_info(const std::string &book, BookInfoEntry &result);
87
88 void
89 fb2_electro_doc_info(const std::string &book, BookInfoEntry &result);
90
91 void
92 fb2_elctor_publisher(const std::string &book, const std::vector<XMLTag> &tgv,
93 BookInfoEntry &result);
94
95 void
96 recursiveGetTags(const std::string &book, const std::vector<XMLTag> &tgv,
97 std::string &result);
98
99 std::shared_ptr<AuxFunc> af;
100};
101
102#endif // FB2PARSER_H
The BookInfoEntry class.
Definition BookInfoEntry.h:31
The BookParseEntry class.
Definition BookParseEntry.h:30
FB2Parser(const std::shared_ptr< AuxFunc > &af)
FB2Parser constructor.
std::shared_ptr< BookInfoEntry > fb2_book_info(const std::string &book)
Returns fb2 book info and cover.
BookParseEntry fb2_parser(const std::string &book)
Parses fb2 book.
XMLParser(const std::shared_ptr< AuxFunc > &af)
XMLParser constructor.