Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
htmlconverter.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
23 #ifndef HTMLCONVERTER_H
24 #define HTMLCONVERTER_H
25 
26 #include <vector>
27 #include <QChar>
28 #include <QString>
29 
30 
32 
33 public:
34  HTMLConverter() = delete;
35 
36  static QString fromLatex(QString const& init);
37 
38 private:
39 
40  static bool isSeparator(QChar c);
41  static QString readToSeparator(QString::const_iterator& iter,
42  QString::const_iterator end);
43  static QString readTo(QChar c,
44  QString::const_iterator& iter,
45  QString::const_iterator end);
46  static QString readSingle(QString::const_iterator& iter,
47  QString::const_iterator end);
48 private:
49 
50  inline static std::vector<QChar> separators
51  = {'\\', '(', ')', '_', '^', '{', '}', ' ', '<', '>'};
52 };
53 
54 #endif // HTMLCONVERTER_H
Definition: htmlconverter.h:31