MLBookProc 1.1
 
Loading...
Searching...
No Matches
FormatAnnotation.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 FORMATANNOTATION_H
18#define FORMATANNOTATION_H
19
20#include <AuxFunc.h>
21#include <ReplaceTagItem.h>
22#include <XMLParser.h>
23#include <memory>
24#include <string>
25#include <vector>
26
33{
34public:
39 FormatAnnotation(const std::shared_ptr<AuxFunc> &af);
40
51 void
52 remove_escape_sequences(std::string &annotation);
53
62 void
63 replace_tags(std::string &annotation);
64
75 void
76 final_cleaning(std::string &annotation);
77
82 void
83 removeAllTags(std::string &annotation);
84
92 void
93 setTagReplacementTable(const std::vector<ReplaceTagItem> &replacement_table);
94
95private:
96 void
97 replace_html(std::string &annotation, const std::string &sstr,
98 const std::string &replacement);
99
100 void
101 recursiveReplacement(const std::vector<XMLTag> &tgv,
102 std::string &annotation);
103
104 std::vector<ReplaceTagItem> replacement_table;
105};
106
107#endif // FORMATANNOTATION_H
FormatAnnotation(const std::shared_ptr< AuxFunc > &af)
FormatAnnotation constructor.
void removeAllTags(std::string &annotation)
Simply removes all XML tags.
void setTagReplacementTable(const std::vector< ReplaceTagItem > &replacement_table)
Sets tag replacement table.
void remove_escape_sequences(std::string &annotation)
Removes escape sequences from annotation.
void final_cleaning(std::string &annotation)
Cleans some sequences from annotation.
void replace_tags(std::string &annotation)
Replaces XML tags.
XMLParser(const std::shared_ptr< AuxFunc > &af)
XMLParser constructor.