1 |
|
|
/*************************************** |
2 |
|
|
Auteur : Pierre Aubert |
3 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
4 |
|
|
Licence : CeCILL-C |
5 |
|
|
****************************************/ |
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
//You should not modify this file |
10 |
|
|
|
11 |
|
|
#include "PParseSeq.h" |
12 |
|
|
|
13 |
|
|
|
14 |
|
|
/*********************************************************************** |
15 |
|
|
* * |
16 |
|
|
* Public functions of class PParseCmd * |
17 |
|
|
* * |
18 |
|
|
************************************************************************/ |
19 |
|
|
|
20 |
|
|
|
21 |
|
|
///Constructor of the class PParseCmd |
22 |
|
64 |
PParseCmd::PParseCmd(){ |
23 |
✓ |
64 |
initialisationPParseCmd(); |
24 |
|
64 |
} |
25 |
|
|
|
26 |
|
|
///Copy constructor of the class PParseCmd |
27 |
|
|
/** @param other : other variable |
28 |
|
|
*/ |
29 |
|
86 |
PParseCmd::PParseCmd(const PParseCmd & other){ |
30 |
✓ |
86 |
initialisationPParseCmd(); |
31 |
✓ |
86 |
copyPParseCmd(other); |
32 |
|
86 |
} |
33 |
|
|
|
34 |
|
|
///Destructor of the class PParseCmd |
35 |
|
300 |
PParseCmd::~PParseCmd(){ |
36 |
|
|
|
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
///Equal operator of the class PParseCmd |
40 |
|
|
/** @param other : other variable |
41 |
|
|
* @return copied @brief Parser command |
42 |
|
|
*/ |
43 |
|
1 |
PParseCmd & PParseCmd::operator =(const PParseCmd & other){ |
44 |
|
1 |
copyPParseCmd(other); |
45 |
|
1 |
return *this; |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
///Set the variable p_isMatch, of type 'bool' |
49 |
|
|
/** @param isMatch : True to use isMatch function instead of strComposedOf |
50 |
|
|
*/ |
51 |
|
62 |
void PParseCmd::setIsMatch(bool isMatch){ |
52 |
|
62 |
p_isMatch = isMatch; |
53 |
|
62 |
} |
54 |
|
|
|
55 |
|
|
///Set the variable p_str, of type 'std ::string' |
56 |
|
|
/** @param str : String to be used for the parsing |
57 |
|
|
*/ |
58 |
|
62 |
void PParseCmd::setStr(const std ::string & str){ |
59 |
|
62 |
p_str = str; |
60 |
|
62 |
} |
61 |
|
|
|
62 |
|
|
///Get the variable p_isMatch |
63 |
|
|
/** @return True to use isMatch function instead of strComposedOf |
64 |
|
|
*/ |
65 |
|
20 |
bool PParseCmd::getIsMatch() const{ |
66 |
|
20 |
return p_isMatch; |
67 |
|
|
} |
68 |
|
|
|
69 |
|
|
///Get the variable p_isMatch |
70 |
|
|
/** @return True to use isMatch function instead of strComposedOf |
71 |
|
|
*/ |
72 |
|
1 |
bool & PParseCmd::getIsMatch(){ |
73 |
|
1 |
return p_isMatch; |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
///Get the variable p_str |
77 |
|
|
/** @return String to be used for the parsing |
78 |
|
|
*/ |
79 |
|
20 |
const std ::string & PParseCmd::getStr() const{ |
80 |
|
20 |
return p_str; |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
///Get the variable p_str |
84 |
|
|
/** @return String to be used for the parsing |
85 |
|
|
*/ |
86 |
|
1 |
std ::string & PParseCmd::getStr(){ |
87 |
|
1 |
return p_str; |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
/*********************************************************************** |
91 |
|
|
* * |
92 |
|
|
* Private functions of class PParseCmd * |
93 |
|
|
* * |
94 |
|
|
************************************************************************/ |
95 |
|
|
|
96 |
|
|
|
97 |
|
|
///Initialisation function of the class PParseCmd |
98 |
|
150 |
void PParseCmd::initialisationPParseCmd(){ |
99 |
|
|
///True to use isMatch function instead of strComposedOf |
100 |
|
150 |
p_isMatch = 0; |
101 |
|
|
|
102 |
|
150 |
} |
103 |
|
|
|
104 |
|
|
///Copy function of the class PParseCmd |
105 |
|
|
/** @param other : other variable |
106 |
|
|
*/ |
107 |
|
87 |
void PParseCmd::copyPParseCmd(const PParseCmd & other){ |
108 |
|
87 |
p_isMatch = other.p_isMatch; |
109 |
|
87 |
p_str = other.p_str; |
110 |
|
|
|
111 |
|
87 |
} |
112 |
|
|
|
113 |
|
|
/*********************************************************************** |
114 |
|
|
* * |
115 |
|
|
* Public functions of class PParseStep * |
116 |
|
|
* * |
117 |
|
|
************************************************************************/ |
118 |
|
|
|
119 |
|
|
|
120 |
|
|
///Constructor of the class PParseStep |
121 |
|
27 |
PParseStep::PParseStep(){ |
122 |
✓ |
27 |
initialisationPParseStep(); |
123 |
|
27 |
} |
124 |
|
|
|
125 |
|
|
///Copy constructor of the class PParseStep |
126 |
|
|
/** @param other : other variable |
127 |
|
|
*/ |
128 |
|
53 |
PParseStep::PParseStep(const PParseStep & other){ |
129 |
✓ |
53 |
initialisationPParseStep(); |
130 |
✓ |
53 |
copyPParseStep(other); |
131 |
|
53 |
} |
132 |
|
|
|
133 |
|
|
///Destructor of the class PParseStep |
134 |
|
160 |
PParseStep::~PParseStep(){ |
135 |
|
|
|
136 |
|
|
} |
137 |
|
|
|
138 |
|
|
///Equal operator of the class PParseStep |
139 |
|
|
/** @param other : other variable |
140 |
|
|
* @return copied @brief Describes a parsing step |
141 |
|
|
*/ |
142 |
|
|
PParseStep & PParseStep::operator =(const PParseStep & other){ |
143 |
|
|
copyPParseStep(other); |
144 |
|
|
return *this; |
145 |
|
|
} |
146 |
|
|
|
147 |
|
|
///Set the variable p_isOptional, of type 'bool' |
148 |
|
|
/** @param isOptional : True if the step is optional (as soon as the previous one or the next one is Ok) |
149 |
|
|
*/ |
150 |
|
14 |
void PParseStep::setIsOptional(bool isOptional){ |
151 |
|
14 |
p_isOptional = isOptional; |
152 |
|
14 |
} |
153 |
|
|
|
154 |
|
|
///Set the variable p_vecCmd, of type 'std ::vector<PParseCmd>' |
155 |
|
|
/** @param vecCmd : Vector of command to be used for parsing |
156 |
|
|
*/ |
157 |
|
1 |
void PParseStep::setVecCmd(const std ::vector<PParseCmd> & vecCmd){ |
158 |
|
1 |
p_vecCmd = vecCmd; |
159 |
|
1 |
} |
160 |
|
|
|
161 |
|
|
///Get the variable p_isOptional |
162 |
|
|
/** @return True if the step is optional (as soon as the previous one or the next one is Ok) |
163 |
|
|
*/ |
164 |
|
20 |
bool PParseStep::getIsOptional() const{ |
165 |
|
20 |
return p_isOptional; |
166 |
|
|
} |
167 |
|
|
|
168 |
|
|
///Get the variable p_isOptional |
169 |
|
|
/** @return True if the step is optional (as soon as the previous one or the next one is Ok) |
170 |
|
|
*/ |
171 |
|
1 |
bool & PParseStep::getIsOptional(){ |
172 |
|
1 |
return p_isOptional; |
173 |
|
|
} |
174 |
|
|
|
175 |
|
|
///Get the variable p_vecCmd |
176 |
|
|
/** @return Vector of command to be used for parsing |
177 |
|
|
*/ |
178 |
|
20 |
const std ::vector<PParseCmd> & PParseStep::getVecCmd() const{ |
179 |
|
20 |
return p_vecCmd; |
180 |
|
|
} |
181 |
|
|
|
182 |
|
|
///Get the variable p_vecCmd |
183 |
|
|
/** @return Vector of command to be used for parsing |
184 |
|
|
*/ |
185 |
|
28 |
std ::vector<PParseCmd> & PParseStep::getVecCmd(){ |
186 |
|
28 |
return p_vecCmd; |
187 |
|
|
} |
188 |
|
|
|
189 |
|
|
/*********************************************************************** |
190 |
|
|
* * |
191 |
|
|
* Private functions of class PParseStep * |
192 |
|
|
* * |
193 |
|
|
************************************************************************/ |
194 |
|
|
|
195 |
|
|
|
196 |
|
|
///Initialisation function of the class PParseStep |
197 |
|
80 |
void PParseStep::initialisationPParseStep(){ |
198 |
|
|
///True if the step is optional (as soon as the previous one or the next one is Ok) |
199 |
|
80 |
p_isOptional = 0; |
200 |
|
|
|
201 |
|
80 |
} |
202 |
|
|
|
203 |
|
|
///Copy function of the class PParseStep |
204 |
|
|
/** @param other : other variable |
205 |
|
|
*/ |
206 |
|
53 |
void PParseStep::copyPParseStep(const PParseStep & other){ |
207 |
|
53 |
p_isOptional = other.p_isOptional; |
208 |
|
53 |
p_vecCmd = other.p_vecCmd; |
209 |
|
|
|
210 |
|
53 |
} |
211 |
|
|
|
212 |
|
|
/*********************************************************************** |
213 |
|
|
* * |
214 |
|
|
* Public functions of class PParseSeq * |
215 |
|
|
* * |
216 |
|
|
************************************************************************/ |
217 |
|
|
|
218 |
|
|
|
219 |
|
|
///Constructor of the class PParseSeq |
220 |
|
12 |
PParseSeq::PParseSeq(){ |
221 |
✓ |
12 |
initialisationPParseSeq(); |
222 |
|
12 |
} |
223 |
|
|
|
224 |
|
|
///Copy constructor of the class PParseSeq |
225 |
|
|
/** @param other : other variable |
226 |
|
|
*/ |
227 |
|
1 |
PParseSeq::PParseSeq(const PParseSeq & other){ |
228 |
✓ |
1 |
initialisationPParseSeq(); |
229 |
✓ |
1 |
copyPParseSeq(other); |
230 |
|
1 |
} |
231 |
|
|
|
232 |
|
|
///Destructor of the class PParseSeq |
233 |
|
26 |
PParseSeq::~PParseSeq(){ |
234 |
|
|
|
235 |
|
|
} |
236 |
|
|
|
237 |
|
|
///Equal operator of the class PParseSeq |
238 |
|
|
/** @param other : other variable |
239 |
|
|
* @return copied @brief Parsing sequence |
240 |
|
|
*/ |
241 |
|
1 |
PParseSeq & PParseSeq::operator =(const PParseSeq & other){ |
242 |
|
1 |
copyPParseSeq(other); |
243 |
|
1 |
return *this; |
244 |
|
|
} |
245 |
|
|
|
246 |
|
|
///Set the variable p_vecStep, of type 'std ::vector<PParseStep>' |
247 |
|
|
/** @param vecStep : Vector of all the steps of the parsing sequence |
248 |
|
|
*/ |
249 |
|
1 |
void PParseSeq::setVecStep(const std ::vector<PParseStep> & vecStep){ |
250 |
|
1 |
p_vecStep = vecStep; |
251 |
|
1 |
} |
252 |
|
|
|
253 |
|
|
///Get the variable p_vecStep |
254 |
|
|
/** @return Vector of all the steps of the parsing sequence |
255 |
|
|
*/ |
256 |
|
9 |
const std ::vector<PParseStep> & PParseSeq::getVecStep() const{ |
257 |
|
9 |
return p_vecStep; |
258 |
|
|
} |
259 |
|
|
|
260 |
|
|
///Get the variable p_vecStep |
261 |
|
|
/** @return Vector of all the steps of the parsing sequence |
262 |
|
|
*/ |
263 |
|
26 |
std ::vector<PParseStep> & PParseSeq::getVecStep(){ |
264 |
|
26 |
return p_vecStep; |
265 |
|
|
} |
266 |
|
|
|
267 |
|
|
/*********************************************************************** |
268 |
|
|
* * |
269 |
|
|
* Private functions of class PParseSeq * |
270 |
|
|
* * |
271 |
|
|
************************************************************************/ |
272 |
|
|
|
273 |
|
|
|
274 |
|
|
///Initialisation function of the class PParseSeq |
275 |
|
13 |
void PParseSeq::initialisationPParseSeq(){ |
276 |
|
|
|
277 |
|
13 |
} |
278 |
|
|
|
279 |
|
|
///Copy function of the class PParseSeq |
280 |
|
|
/** @param other : other variable |
281 |
|
|
*/ |
282 |
|
2 |
void PParseSeq::copyPParseSeq(const PParseSeq & other){ |
283 |
|
2 |
p_vecStep = other.p_vecStep; |
284 |
|
|
|
285 |
|
2 |
} |
286 |
|
|
|
287 |
|
|
|
288 |
|
|
|