MLBookProc 2.1
Loading...
Searching...
No Matches
RTFParser.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 RTFPARSER_H
17#define RTFPARSER_H
18
19#include <BaseID.h>
20#include <MLBookProc.h>
21#include <UDBase.h>
22
30{
31public:
37 RTFParser(const std::shared_ptr<MLBookProc> &mlbp);
38
47 UDBElement
48 parseBook(const std::string &book_content);
49
58 UDBase
59 getBookInfo(const std::string &book_content);
60
61private:
62 std::string
63 getCodePage(const std::string &book_content);
64
65 UDBElement
66 getBookTitle(const std::string &decoded);
67
68 std::vector<UDBElement>
69 getAuthors(const std::string &decoded);
70
71 UDBElement
72 getSubject(const std::string &decoded);
73
74 UDBElement
75 getCover(const std::string &decoded);
76
77 std::string
78 fromHex(const std::string &hex);
79
80 void
81 normilizeString(std::string &str);
82
83 std::string
84 decodeStr(std::string str);
85
86 std::shared_ptr<MLBookProc> mlbp;
87
88 std::string code_page;
89
90 BaseID bid;
91};
92
93#endif // RTFPARSER_H
The BaseID class.
Definition BaseID.h:28
UDBase getBookInfo(const std::string &book_content)
RTFParser(const std::shared_ptr< MLBookProc > &mlbp)
RTFParser constructor.
UDBElement parseBook(const std::string &book_content)