/
TexParser.h
133 lines (114 loc) · 3.34 KB
/
TexParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef TEXPARSER_H
#define TEXPARSER_H
#include <string>
#include "TexDocElement.h"
class TexParser
{
public:
TexParser(void);
~TexParser(void);
/**
* pars the imput file.
*/
void pars(void);
/**
* set the name of imput file.
* @param fileName an integer argument.
*/
void setInputFileName(std::string);
/**
* Get back the rootElement.
* @return The root elemet.
*/
TexDocElement& getRootElement(void);
private:
// Properties ------------------------------------------------------------
/**
* The name of imput file.
*/
std::string inputFileName;
/**
* Content of imput file..
*/
std::string completeDoc;
/**
* This ist the root element.
*/
TexDocElement rootElement;
// Methods ---------------------------------------------------------------
/**
* search and convert elements of texElementValue in a list
* of TexDocElement objekts. With this form:
* \begin{keyword}text part \end{keyword}
* @param parentElement parent element.
* @param keyWord parents element.
* @param typ a enum ElementType from TexDocElement class.
* @return Return a Stnin without comments.
*/
void cutOutBeginEnd
(
TexDocElement& parentElement,
std::string keyWord,
const int& typ
);
/**
* search and convert elements of texElementValue in a list
* of TexDocElement objekts. With this form:
* \kexword{text part}
* @param parentElement parent element.
* @param keyWord parents element.
* @param typ a enum ElementType from TexDocElement class.
* @return Return a Stnin without comments.
*/
void cutOutShortElements
(
TexDocElement& parentElement,
std::string keyWord,
const int& typ
);
/**
* search and remove Tex-comments in String.
* It's a wraper class.
* @param line Sting with coment (or not).
* @return Return a Stnin without comments.
*/
std::string findAndRemoveComments(const std::string &read_line);
/**
* search and remove Tex-comments in String.
* This function us boost-lib.
* @warning this way is to complex and controllable.
* @param line Sting with coment (or not).
* @return Return a Stnin without comments.
*/
std::string findAndRemoveCommentsBoost(const std::string &read_line);
/**
* search and remove Tex-comments in String.
* This function us std::string-lib.
* @param line Sting with coment (or not).
* @return Return a Stnin without comments.
*/
std::string findAndRemoveCommentsSTD(const std::string &read_line);
/**
* @throw string If the the Function not fount TexParser::DOCUMENT.
* @return Get back a TexDocElement with typ "TexParser::DOCUMENT".
*/
TexDocElement& getDocumentElement(void);
/**
* It's pars the Tex document of the part "document".
*/
void parsDocument(void);
/**
* It's pars the Tex document of the part "\input{}" and
* include the file values.
*/
void parsInput(void);
/**
* It's pars the Tex document of verbatim elements.
*/
void parsVerbatim(void);
/**
* Tread the imput file and copy to propertie completeDoc.
*/
void readImputFile(void);
};
#endif