PhoenixFileParser  1.5.1
Set of tools to ease file parsing
Loading...
Searching...
No Matches
PFileParser Class Reference

classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres More...

#include <PFileParser.h>

Public Member Functions

void clearPosition ()
 Clear the save position of the parser in ther current file.
 
char getChar (size_t index) const
 Get the char at the given index.
 
size_t getColumn () const
 Fonction qui renvoie le numéro de la colonne du caractère courant.
 
char getCurrentCh () const
 Renvoie le caractère courant.
 
size_t getCurrentCharIdx () const
 Return the index of the current character.
 
PString getCurrentRow () const
 Get the current parsed row.
 
char getEscapeChar () const
 Gets the escape character of the PFileParser.
 
PPath getFileName () const
 Fonction qui renvoie le nom du fichier que l'on a ouvert.
 
size_t getLine () const
 Fonction qui renvoie le numéro de la ligne courante.
 
size_t getLineIndentation ()
 Get the current line indentation.
 
PLocation getLocation () const
 Fonction qui renvoie la PLocation du PFileParser.
 
size_t getNbTotalChar () const
 Return the number of characters in the current opened file.
 
char getNextChar ()
 Fonction qui renvoie le prochain caractère du fichier courant.
 
PString getNextToken ()
 Get the next token.
 
PString getNextToken (PString &skippedStr)
 Get the next token and return also the skipped characters until the next token.
 
char getPrevCh () const
 Renvoie le caractère courant.
 
PString getSeparator () const
 renvoie la liste des caractères séparateurs
 
PString getStrComposedOf (const PString &charset)
 Get string composed of the characters in the string charset.
 
PString getUntilKey (const PString &patern)
 Renvoie la chaine de caractère du caractère courant jusqu'à patern comprise.
 
PString getUntilKeyWithoutPatern (const PString &patern)
 Renvoie la chaine de caractère du caractère courant jusqu'à patern exclu.
 
PString getUntilKeyWithoutPaternExclude (const PString &patern, const PString &strNotBeforeEndPatern)
 Parse a string until the patern is found, only if it has not strNotBeforeEndPatern before it.
 
PString getUntilKeyWithoutPaternRecurse (const PString &patern, const PString &beginPatern)
 Get the string until end sequence and take account recursive patern (embeded strings)
 
PString getUntilKeyWithoutPaternRecurse (const PString &patern, const PString &beginPatern, const PString &allowedCharAfterBegin)
 Get the string until end sequence and take account recursive patern (embeded strings)
 
PString getUntilKeyWithoutPaternRecurseExclude (const PString &patern, const PString &beginPatern, const PString &echapExpr)
 Get the string until end sequence and take account recursive patern (embeded strings)
 
PString getWhiteSpace () const
 renvoie la liste des caractères blancs
 
void incrementCurrentChar (size_t nbChar=1lu)
 Increment the current caracter.
 
bool isChSeparator () const
 Dis si le caractère courant est un séparateur.
 
bool isChSpace () const
 Dis si le caractère courant est un caractère blanc.
 
bool isEndOfFile () const
 Dit si on est à la fin du fichier.
 
PString isMatch (const PParseSeq &seq)
 Check the matching of a sequence in the current file.
 
bool isMatch (const PString &patern)
 Says if the patern match with the current caracters of the PFileParser.
 
bool isMatch (const PString &patern, const PString &forbiddenCharBefore)
 Says if the patern match with the current caracters of the PFileParser.
 
PString isMatch (const PVecString &patern)
 Check the matching between the current caracters and all the string in the vector.
 
PString isMatch (const std::vector< PVecString > &patern)
 Check the matching between the current caracters and all the string in the list of list of string.
 
bool isMatchRewind (const PString &patern)
 Do a isMatch and then go back at the previous position.
 
bool isMatchSeq (const PVecString &patern, bool alwaysPopBack=false)
 Match a sequence of token in a vector.
 
bool isMatchToken (const PString &patern)
 Says if the patern match with the current caracters of the PFileParser but treats the string as a token (cannot be part of a word)
 
PString isMatchToken (const PVecString &patern)
 Check the matching between the current caracters and all the string in the vector but treats the string as a token (cannot be part of a word)
 
template<typename T>
bool isMatchToken (PString &matchKey, T &matchValue, const std::map< PString, T > &patern)
 Check if one key of the map, matches the current token.
 
bool isWhiteSpace ()
 Says if the current char is a white space.
 
bool open (const PPath &fileName)
 Fonction qui ouvre le fichier que l'on va parser.
 
 PFileParser ()
 Constructeur de PFileParser.
 
void popPosition ()
 Get to the last saved position of the PFileParser in the current file.
 
void pushPosition ()
 Remember the current position of the PFileParser in the current file.
 
void setColumn (size_t currentCol)
 Set the current column of the PFileParser.
 
void setCurrentCharIdx (size_t index)
 Set the index of the current char.
 
void setEscapeChar (char escapeChar)
 Sets the escape character of the PFileParser.
 
void setFileContent (const PString &fileContent)
 Set the file content.
 
void setLine (size_t currentLine)
 Set the current line of the PFileParser.
 
void setLocation (const PLocation &location)
 Set the current location of the PFileParser.
 
void setSeparator (const PString &separator)
 Initialise la liste des caractères séparateurs.
 
void setWhiteSpace (const PString &whiteSpace)
 Initialise la liste des caractères blancs.
 
void skipChars (const PString &chToSkip)
 Skip the characters in the given string.
 
void skipWhiteSpace ()
 Skip the white space if there is at the current caracter position.
 
virtual ~PFileParser ()
 Destructeur de PFileParser.
 

Private Member Functions

void incrementCurrentLine ()
 Increment the current line.
 
void initialisationPFileParser ()
 Fonction d'initialisation du PFileParser.
 

Private Attributes

size_t p_currentChar
 Numéro du caractère courant.
 
bool p_currentCharEchaped
 True if the current char is escaped.
 
size_t p_currentLine
 Numéro de la ligne courante.
 
size_t p_currentLineFirstColumn
 Number of the first column caracter of the current line.
 
bool p_dontSkipSpace
 Say if we don't want to skip the spaces.
 
char p_echapChar
 Echap caracter.
 
PString p_fileContent
 Contenu du fichier de configuration.
 
PPath p_fileName
 Nom du fichier que l'on veut parser.
 
PString p_listSeparator
 liste des séparateurs
 
PString p_listWhiteSpace
 liste des espaces blancs
 
size_t p_nbTotalChar
 Nombre de caractères total.
 
std::vector< size_t > p_vecLine
 Vector of all the checkpoint rows in the text file (added with pushPosition() and removed with popPosition() or clear()
 
std::vector< size_t > p_vecPosition
 Vector of all the checkpoint positions in the text file (added with pushPosition() and removed with popPosition() or clear()
 

Friends

std::ostream & operator<< (std::ostream &out, const PFileParser &other)
 Définition de l'opérateur de flux sortant.
 

Detailed Description

classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres

Definition at line 20 of file PFileParser.h.

Constructor & Destructor Documentation

◆ PFileParser()

PFileParser::PFileParser ( )

Constructeur de PFileParser.

Definition at line 11 of file PFileParser.cpp.

11 {
13}
void initialisationPFileParser()
Fonction d'initialisation du PFileParser.

References initialisationPFileParser().

Referenced by operator<<.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~PFileParser()

PFileParser::~PFileParser ( )
virtual

Destructeur de PFileParser.

Definition at line 16 of file PFileParser.cpp.

16 {
17
18}

Member Function Documentation

◆ clearPosition()

void PFileParser::clearPosition ( )

Clear the save position of the parser in ther current file.

Definition at line 117 of file PFileParser.cpp.

117 {
118 p_vecPosition.clear();
119 p_vecLine.clear();
120}
std::vector< size_t > p_vecPosition
Vector of all the checkpoint positions in the text file (added with pushPosition() and removed with p...
std::vector< size_t > p_vecLine
Vector of all the checkpoint rows in the text file (added with pushPosition() and removed with popPos...

References p_vecLine, and p_vecPosition.

Referenced by parser_json_value().

+ Here is the caller graph for this function:

◆ getChar()

char PFileParser::getChar ( size_t index) const

Get the char at the given index.

Parameters
index: index of the char to get
Returns
corresponding char or nullchar if index is out of bound

Definition at line 693 of file PFileParser.cpp.

693 {
694 if(index >= p_nbTotalChar) return '\0';
695 return p_fileContent[index];
696}
size_t p_nbTotalChar
Nombre de caractères total.
PString p_fileContent
Contenu du fichier de configuration.

References p_fileContent, and p_nbTotalChar.

Referenced by PHighlightParser::makeHighlighting().

+ Here is the caller graph for this function:

◆ getColumn()

size_t PFileParser::getColumn ( ) const

Fonction qui renvoie le numéro de la colonne du caractère courant.

Returns
colonne du caractère courant

Definition at line 708 of file PFileParser.cpp.

708 {
711 }else{return 0lu;}
712}
size_t p_currentLineFirstColumn
Number of the first column caracter of the current line.
size_t p_currentChar
Numéro du caractère courant.

References p_currentChar, and p_currentLineFirstColumn.

Referenced by getLocation(), and operator<<.

+ Here is the caller graph for this function:

◆ getCurrentCh()

char PFileParser::getCurrentCh ( ) const

Renvoie le caractère courant.

Returns
caractère courant

Definition at line 676 of file PFileParser.cpp.

676 {
677 if(isEndOfFile()) return '\0';
679}
bool isEndOfFile() const
Dit si on est à la fin du fichier.

References isEndOfFile(), p_currentChar, and p_fileContent.

Referenced by PHighlightParser::makeHighlighting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentCharIdx()

size_t PFileParser::getCurrentCharIdx ( ) const

Return the index of the current character.

Returns
index of the current character

Definition at line 724 of file PFileParser.cpp.

724 {
725 return p_currentChar;
726}

References p_currentChar.

Referenced by PHighlightParser::makeHighlighting().

+ Here is the caller graph for this function:

◆ getCurrentRow()

PString PFileParser::getCurrentRow ( ) const

Get the current parsed row.

Returns
current parsed row

Definition at line 422 of file PFileParser.cpp.

422 {
423 if(p_fileContent.empty()) return "";
424 size_t currentCharIndex(p_currentChar);
425 char ch = p_fileContent[currentCharIndex];
426 size_t indexBeginRow(currentCharIndex);
427 size_t indexEndRow(currentCharIndex);
428 if(ch != '\n'){
429 while(p_fileContent[indexEndRow] != '\n' && !isEndOfFile()){
430 ++indexEndRow;
431 }
432 }
433 if(ch == '\n' && indexBeginRow != 0lu){
434 --indexBeginRow;
435 }
436 while(p_fileContent[indexBeginRow] != '\n' && indexBeginRow != 0lu){
437 --indexBeginRow;
438 }
439 if(p_fileContent[indexBeginRow] == '\n'){indexBeginRow++;}
440 return p_fileContent.substr(indexBeginRow, indexEndRow - indexBeginRow);
441}

References isEndOfFile(), p_currentChar, and p_fileContent.

+ Here is the call graph for this function:

◆ getEscapeChar()

char PFileParser::getEscapeChar ( ) const

Gets the escape character of the PFileParser.

Returns
escape character of the PFileParser

Definition at line 141 of file PFileParser.cpp.

141 {
142 return p_echapChar;
143}
char p_echapChar
Echap caracter.

References p_echapChar.

◆ getFileName()

PPath PFileParser::getFileName ( ) const

Fonction qui renvoie le nom du fichier que l'on a ouvert.

Returns
nom du fichier que l'on a ouvert

Definition at line 148 of file PFileParser.cpp.

148 {
149 return p_fileName;
150}
PPath p_fileName
Nom du fichier que l'on veut parser.
Definition PFileParser.h:99

References p_fileName.

Referenced by operator<<.

+ Here is the caller graph for this function:

◆ getLine()

size_t PFileParser::getLine ( ) const

Fonction qui renvoie le numéro de la ligne courante.

Returns
numéro de la ligne courante

Definition at line 701 of file PFileParser.cpp.

701 {
702 return p_currentLine;
703}
size_t p_currentLine
Numéro de la ligne courante.

References p_currentLine.

Referenced by operator<<.

+ Here is the caller graph for this function:

◆ getLineIndentation()

size_t PFileParser::getLineIndentation ( )

Get the current line indentation.

Returns
current line indentation

Definition at line 731 of file PFileParser.cpp.

731 {
732 //First, let's get the current column
733 size_t indentation(0lu), currentCharIdx(p_currentLineFirstColumn);
734 while(currentCharIdx < p_nbTotalChar && PString(" \t").find(p_fileContent[currentCharIdx])){
735 ++indentation;
736 ++currentCharIdx;
737 }
738 if(currentCharIdx > p_currentChar){
739 p_currentChar = currentCharIdx; //Anyway, it was just white character
740 }
741
742 return indentation;
743}

References p_currentChar, p_currentLineFirstColumn, p_fileContent, and p_nbTotalChar.

◆ getLocation()

PLocation PFileParser::getLocation ( ) const

Fonction qui renvoie la PLocation du PFileParser.

Returns
PLocation du PFileParser

Definition at line 748 of file PFileParser.cpp.

748 {
749 return PLocation(p_fileName, p_currentLine, getColumn());
750}
size_t getColumn() const
Fonction qui renvoie le numéro de la colonne du caractère courant.

References getColumn(), p_currentLine, and p_fileName.

Referenced by DicoValue::errorAt(), parser_json_fileParser(), parser_json_key(), parser_json_list(), parser_json_map(), parser_json_value(), and parser_jsonErrorAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNbTotalChar()

size_t PFileParser::getNbTotalChar ( ) const

Return the number of characters in the current opened file.

Returns
number of characters in the current opened file

Definition at line 717 of file PFileParser.cpp.

717 {
718 return p_nbTotalChar;
719}

References p_nbTotalChar.

Referenced by PHighlightParser::makeHighlighting().

+ Here is the caller graph for this function:

◆ getNextChar()

char PFileParser::getNextChar ( )

Fonction qui renvoie le prochain caractère du fichier courant.

Returns
prochain caractère du fichier courant ou le caractère NULL si on est à la fin

Definition at line 194 of file PFileParser.cpp.

194 {
197 char ch = p_fileContent[p_currentChar];
198 return ch;
199 }else{
201 return '\0';
202 }
203}
void incrementCurrentChar(size_t nbChar=1lu)
Increment the current caracter.

References incrementCurrentChar(), p_currentChar, p_fileContent, and p_nbTotalChar.

+ Here is the call graph for this function:

◆ getNextToken() [1/2]

PString PFileParser::getNextToken ( )

Get the next token.

Returns
next token

Definition at line 155 of file PFileParser.cpp.

155 {
156 PString dummySkipedStr("");
157 return getNextToken(dummySkipedStr);
158}
PString getNextToken()
Get the next token.

References getNextToken().

Referenced by DicoValue::errorAt(), getNextToken(), and parser_jsonErrorAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNextToken() [2/2]

PString PFileParser::getNextToken ( PString & skippedStr)

Get the next token and return also the skipped characters until the next token.

Parameters
[out]skippedStr: string of skipped characters
Returns
next token

Definition at line 164 of file PFileParser.cpp.

164 {
165 if(isEndOfFile()) return "";
166 char ch = p_fileContent[p_currentChar];
167 while(!isEndOfFile() && p_listWhiteSpace.find(ch)){
168 skippedStr += ch;
170 if(isEndOfFile()) return "";
172 }
173 //We are sur ethe current char is not a white character
174 if(p_listSeparator.find(ch) && !isEndOfFile()){ //If is it a separator, we stop
176 PString s("");
177 s += ch;
178 return s;
179 }
180 //If not we get all characters until the next white character or separator character
181 PString buf("");
182 while(!isEndOfFile() && !p_listWhiteSpace.find(ch) && !p_listSeparator.find(ch)){
183 buf += ch;
185 if(isEndOfFile()){return buf;}
187 }
188 return buf;
189}
PString p_listSeparator
liste des séparateurs
PString p_listWhiteSpace
liste des espaces blancs

References incrementCurrentChar(), isEndOfFile(), p_currentChar, p_fileContent, p_listSeparator, and p_listWhiteSpace.

+ Here is the call graph for this function:

◆ getPrevCh()

char PFileParser::getPrevCh ( ) const

Renvoie le caractère courant.

Returns
caractère courant

Definition at line 684 of file PFileParser.cpp.

684 {
685 if(isEndOfFile() && p_currentChar > 0lu) return '\0';
686 return p_fileContent[p_currentChar - 1lu];
687}

References isEndOfFile(), p_currentChar, and p_fileContent.

+ Here is the call graph for this function:

◆ getSeparator()

PString PFileParser::getSeparator ( ) const

renvoie la liste des caractères séparateurs

Returns
liste des caractères séparateurs

Definition at line 669 of file PFileParser.cpp.

669 {
670 return p_listSeparator;
671}

References p_listSeparator.

◆ getStrComposedOf()

PString PFileParser::getStrComposedOf ( const PString & charset)

Get string composed of the characters in the string charset.

Parameters
charset: set of the available characters to get the current string
Returns
corresponding string

Definition at line 401 of file PFileParser.cpp.

401 {
402 PString tmpWhiteSpace(p_listWhiteSpace.eraseChar(charset));
403 if(tmpWhiteSpace != ""){
404 skipChars(tmpWhiteSpace);
405 }
406 std::string out("");
407 bool isInCharSet(true);
408 while(!isEndOfFile() && isInCharSet){
409 char ch = p_fileContent[p_currentChar];
410 isInCharSet = charset.find(ch);
411 if(isInCharSet){
412 out += ch;
414 }
415 }
416 return out;
417}
void skipChars(const PString &chToSkip)
Skip the characters in the given string.

References incrementCurrentChar(), isEndOfFile(), p_currentChar, p_fileContent, p_listWhiteSpace, and skipChars().

Referenced by isMatch(), DicoValue::parseDicoValue(), parser_json_fileParser(), and parser_json_value().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUntilKey()

PString PFileParser::getUntilKey ( const PString & patern)

Renvoie la chaine de caractère du caractère courant jusqu'à patern comprise.

Parameters
patern: séquence d'arrêt
Returns
chaine de caractère du caractère courant jusqu'à patern comprise

Definition at line 209 of file PFileParser.cpp.

209 {
210 if(patern == "" || p_nbTotalChar == 0lu || isEndOfFile()) return "";
211 return getUntilKeyWithoutPatern(patern) + patern;
212}
PString getUntilKeyWithoutPatern(const PString &patern)
Renvoie la chaine de caractère du caractère courant jusqu'à patern exclu.

References getUntilKeyWithoutPatern(), isEndOfFile(), and p_nbTotalChar.

Referenced by parse_generic_string(), and parser_jsonString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUntilKeyWithoutPatern()

PString PFileParser::getUntilKeyWithoutPatern ( const PString & patern)

Renvoie la chaine de caractère du caractère courant jusqu'à patern exclu.

Parameters
patern: séquence d'arrêt
Returns
chaine de caractère du caractère courant jusqu'à patern exclu

Definition at line 218 of file PFileParser.cpp.

218 {
219 if(patern == "" || p_nbTotalChar == 0lu || isEndOfFile()) return "";
220 size_t sizePatern(patern.size());
221 std::string out(""); //on évite les petits désagréments
222 size_t sizeSrc(p_nbTotalChar - p_currentChar);
223 size_t beginTest(0lu), beginLine(0lu), beginI(0lu), nbMatch(0lu);
224 for(size_t i(0lu); i < sizeSrc; ++i){
225 if(p_fileContent[p_currentChar] == patern[nbMatch] && !p_currentCharEchaped){ //si le caractère i est le même que le caractère nbMatch
226 if(nbMatch == 0lu){ //c'est le premier qu'on teste
227 beginTest = p_currentChar; //il faut donc se rappeler où on a commencer à faire le test
228 beginLine = p_currentLine;
229 beginI = i;
230 }
231 ++nbMatch; //la prochaîne fois on testera le caractère suivant
232 if(nbMatch == sizePatern){ //dans ce cas, on a tout testé et tout les caractères correspondent, donc on sauvegarde
234 return out;
235 }
236 }else{ //si le caractère i n'est pas le même caractère que nbMatch
237 if(nbMatch == 0lu){ //si on n'en avait pas trouver de bon avant
238 out += p_fileContent[p_currentChar]; //on ne change rien à ce caractère
239 }else{ //si on avais déjà tester des caractères avant
240 out += p_fileContent[beginTest];
241 p_currentChar = beginTest;
242 p_currentLine = beginLine;
243 i = beginI;
244 }
245 beginTest = 0lu; //on remet le début des tests à 0 (pour évité les dépassements, on ne sait jamais)
246 nbMatch = 0lu; //on remet ne nombre des tests à 0, comme on n'a pas trouver de nouveau le motif
247 }
249 }
250 return out;
251}
bool p_currentCharEchaped
True if the current char is escaped.

References incrementCurrentChar(), isEndOfFile(), p_currentChar, p_currentCharEchaped, p_currentLine, p_fileContent, and p_nbTotalChar.

Referenced by createNestedCallFromStr(), dico_create_nested_call(), PHighlightParser::doReplaceAction(), getUntilKey(), and DicoValue::parseString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUntilKeyWithoutPaternExclude()

PString PFileParser::getUntilKeyWithoutPaternExclude ( const PString & patern,
const PString & strNotBeforeEndPatern )

Parse a string until the patern is found, only if it has not strNotBeforeEndPatern before it.

Parameters
patern: patern to be found
strNotBeforeEndPatern: string which cannot be found before the patern, otherwise the patern is not considered as the end
Returns
string unit patern, without it

Definition at line 258 of file PFileParser.cpp.

258 {
259 if(patern == "" || p_nbTotalChar == 0lu || isEndOfFile()) return "";
260 std::string out(""); //on évite les petits désagréments
261 bool prevSkipSpace(p_dontSkipSpace);
262 p_dontSkipSpace = true;
263 bool skiptNextEnd(false);
264 while(!isEndOfFile()){
265 if(isMatch(strNotBeforeEndPatern)){
266 out += strNotBeforeEndPatern;
267 skiptNextEnd = true;
268 }else if(skiptNextEnd){
269 skiptNextEnd = false;
272 }else if(isMatch(patern)){
273 p_dontSkipSpace = prevSkipSpace;
274 return out;
275 }else{
278 }
279 }
280 p_dontSkipSpace = prevSkipSpace;
281 return out;
282}
bool p_dontSkipSpace
Say if we don't want to skip the spaces.
bool isMatch(const PString &patern)
Says if the patern match with the current caracters of the PFileParser.

References incrementCurrentChar(), isEndOfFile(), isMatch(), p_currentChar, p_dontSkipSpace, p_fileContent, and p_nbTotalChar.

+ Here is the call graph for this function:

◆ getUntilKeyWithoutPaternRecurse() [1/2]

PString PFileParser::getUntilKeyWithoutPaternRecurse ( const PString & patern,
const PString & beginPatern )

Get the string until end sequence and take account recursive patern (embeded strings)

Parameters
patern: end patern
beginPatern: definition of new embeded string
Returns
output string

Definition at line 369 of file PFileParser.cpp.

370{
371 if(patern == "" || beginPatern == "" || p_nbTotalChar == 0lu || isEndOfFile()) return "";
372 bool prevSkipSpace(p_dontSkipSpace);
373 p_dontSkipSpace = true;
374 std::string out("");
375 long int nbEmbeded(1l);
376 while(!isEndOfFile()){
377 if(isMatch(patern)){
378 --nbEmbeded;
379 if(nbEmbeded <= 0l){
380 p_dontSkipSpace = prevSkipSpace;
381 return out;
382 }else{
383 out += patern;
384 }
385 }else if(isMatch(beginPatern)){
386 out += beginPatern;
387 ++nbEmbeded;
388 }else{
391 }
392 }
393 p_dontSkipSpace = prevSkipSpace;
394 return out;
395}

References incrementCurrentChar(), isEndOfFile(), isMatch(), p_currentChar, p_dontSkipSpace, p_fileContent, and p_nbTotalChar.

+ Here is the call graph for this function:

◆ getUntilKeyWithoutPaternRecurse() [2/2]

PString PFileParser::getUntilKeyWithoutPaternRecurse ( const PString & patern,
const PString & beginPatern,
const PString & allowedCharAfterBegin )

Get the string until end sequence and take account recursive patern (embeded strings)

Parameters
patern: end patern
beginPatern: definition of new embeded string
allowedCharAfterBegin: characters allowed after the beginPatern
Returns
output string

Definition at line 290 of file PFileParser.cpp.

292{
293 if(patern == "" || beginPatern == "" || p_nbTotalChar == 0lu || isEndOfFile()) return "";
294 bool prevSkipSpace(p_dontSkipSpace);
295 p_dontSkipSpace = true;
296 std::string out("");
297 long int nbEmbeded(1lu);
298 while(!isEndOfFile()){
299 if(isMatch(patern)){
300 --nbEmbeded;
301 if(nbEmbeded <= 0l){
302 p_dontSkipSpace = prevSkipSpace;
303 return out;
304 }else{
305 out += patern;
306 }
307 }else if(isMatch(beginPatern)){
308 if(allowedCharAfterBegin.find(p_fileContent[p_currentChar])){
309 out += beginPatern;
310 ++nbEmbeded;
311 }
312 }else{
315 }
316 }
317 p_dontSkipSpace = prevSkipSpace;
318 return out;
319}

References incrementCurrentChar(), isEndOfFile(), isMatch(), p_currentChar, p_dontSkipSpace, p_fileContent, and p_nbTotalChar.

+ Here is the call graph for this function:

◆ getUntilKeyWithoutPaternRecurseExclude()

PString PFileParser::getUntilKeyWithoutPaternRecurseExclude ( const PString & patern,
const PString & beginPatern,
const PString & echapExpr )

Get the string until end sequence and take account recursive patern (embeded strings)

Parameters
patern: end patern
beginPatern: definition of new embeded string
echapExpr: echap expression
Returns
output string

Definition at line 327 of file PFileParser.cpp.

329{
330 if(patern == "" || beginPatern == "" || p_nbTotalChar == 0lu || isEndOfFile()) return "";
331 bool prevSkipSpace(p_dontSkipSpace);
332 p_dontSkipSpace = true;
333 std::string out("");
334 long int nbEmbeded(1lu);
335 bool skiptNextEnd(false);
336 while(!isEndOfFile()){
337 if(isMatch(echapExpr)){
338 out += echapExpr;
339 skiptNextEnd = true;
340 }else if(skiptNextEnd){
341 skiptNextEnd = false;
344 }else if(isMatch(patern)){
345 --nbEmbeded;
346 if(nbEmbeded <= 0l){
347 p_dontSkipSpace = prevSkipSpace;
348 return out;
349 }else{
350 out += patern;
351 }
352 }else if(isMatch(beginPatern)){
353 out += beginPatern;
354 ++nbEmbeded;
355 }else{
358 }
359 }
360 p_dontSkipSpace = prevSkipSpace;
361 return out;
362}

References incrementCurrentChar(), isEndOfFile(), isMatch(), p_currentChar, p_dontSkipSpace, p_fileContent, and p_nbTotalChar.

+ Here is the call graph for this function:

◆ getWhiteSpace()

PString PFileParser::getWhiteSpace ( ) const

renvoie la liste des caractères blancs

Returns
liste des caractères blancs

Definition at line 662 of file PFileParser.cpp.

662 {
663 return p_listWhiteSpace;
664}

References p_listWhiteSpace.

◆ incrementCurrentChar()

void PFileParser::incrementCurrentChar ( size_t nbChar = 1lu)

Increment the current caracter.

Parameters
nbChar: number of char to go ahead

Definition at line 784 of file PFileParser.cpp.

784 {
785 for(size_t i(0lu); i < nbChar; ++i){
786 if(p_fileContent[p_currentChar] == '\n'){
788 }
792 }
793 }
794}
void incrementCurrentLine()
Increment the current line.

References incrementCurrentLine(), p_currentChar, p_currentCharEchaped, p_echapChar, p_fileContent, and p_nbTotalChar.

Referenced by PHighlightParser::doReplaceAction(), getNextChar(), getNextToken(), getStrComposedOf(), getUntilKeyWithoutPatern(), getUntilKeyWithoutPaternExclude(), getUntilKeyWithoutPaternRecurse(), getUntilKeyWithoutPaternRecurse(), getUntilKeyWithoutPaternRecurseExclude(), isMatch(), isWhiteSpace(), PHighlightParser::makeHighlighting(), skipChars(), and skipWhiteSpace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ incrementCurrentLine()

void PFileParser::incrementCurrentLine ( )
private

Increment the current line.

Definition at line 776 of file PFileParser.cpp.

776 {
779}

References p_currentChar, p_currentLine, and p_currentLineFirstColumn.

Referenced by incrementCurrentChar().

+ Here is the caller graph for this function:

◆ initialisationPFileParser()

void PFileParser::initialisationPFileParser ( )
private

Fonction d'initialisation du PFileParser.

Definition at line 763 of file PFileParser.cpp.

763 {
764 p_currentChar = 0lu;
765 p_currentLine = 1lu;
767 p_fileContent = "";
768 p_listWhiteSpace = " \t\n";
769 p_listSeparator = "()[]{}+=.;,:/*%<>#";
770 p_echapChar = '\0';
771 p_dontSkipSpace = false;
772 p_currentCharEchaped = false;
773}

References p_currentChar, p_currentCharEchaped, p_currentLine, p_currentLineFirstColumn, p_dontSkipSpace, p_echapChar, p_fileContent, p_listSeparator, and p_listWhiteSpace.

Referenced by PFileParser().

+ Here is the caller graph for this function:

◆ isChSeparator()

bool PFileParser::isChSeparator ( ) const

Dis si le caractère courant est un séparateur.

Returns
true si caractère courant est un séparateur

Definition at line 133 of file PFileParser.cpp.

133 {
134 if(isEndOfFile()) return false;
136}

References isEndOfFile(), p_currentChar, p_fileContent, and p_listSeparator.

+ Here is the call graph for this function:

◆ isChSpace()

bool PFileParser::isChSpace ( ) const

Dis si le caractère courant est un caractère blanc.

Returns
true si caractère courant est un caractère blanc

Definition at line 125 of file PFileParser.cpp.

125 {
126 if(isEndOfFile()) return false;
128}

References isEndOfFile(), p_currentChar, p_fileContent, and p_listWhiteSpace.

+ Here is the call graph for this function:

◆ isEndOfFile()

◆ isMatch() [1/5]

PString PFileParser::isMatch ( const PParseSeq & seq)

Check the matching of a sequence in the current file.

Parameters
seq: sequence to be checked
Returns
matched string

Definition at line 589 of file PFileParser.cpp.

589 {
590 pushPosition();
591 PString body("");
592 const PVecParseStep & vecStep = seq.getVecStep();
593 PVecParseStep::const_iterator itStep(vecStep.begin());
594 bool isParseNextStep(true);
595 while(itStep != vecStep.end() && isParseNextStep){
596 isParseNextStep = itStep->getIsOptional();
597 const PVecParseCmd & vecCmd = itStep->getVecCmd();
598 bool isMatchedCmd(false);
599 PVecParseCmd::const_iterator itCmd(vecCmd.begin());
600 while(itCmd != vecCmd.end() && !isMatchedCmd){
601 PString str(itCmd->getStr());
602 if(itCmd->getIsMatch()){
603 isMatchedCmd = isMatch(str);
604 body += str;
605 }else{
606 PString res(getStrComposedOf(str));
607 if(res != ""){
608 body += res;
609 isMatchedCmd = true;
610 }
611 }
612 ++itCmd;
613 }
614 isParseNextStep |= isMatchedCmd;
615 ++itStep;
616 }
617 if(!isParseNextStep){
618 popPosition();
619 body = "";
620 }
621 return body;
622}
std::vector< PParseCmd > PVecParseCmd
std::vector< PParseStep > PVecParseStep
PString getStrComposedOf(const PString &charset)
Get string composed of the characters in the string charset.
void popPosition()
Get to the last saved position of the PFileParser in the current file.
void pushPosition()
Remember the current position of the PFileParser in the current file.
const std ::vector< PParseStep > & getVecStep() const
Get the variable p_vecStep.

References getStrComposedOf(), PParseSeq::getVecStep(), isMatch(), popPosition(), and pushPosition().

+ Here is the call graph for this function:

◆ isMatch() [2/5]

bool PFileParser::isMatch ( const PString & patern)

Says if the patern match with the current caracters of the PFileParser.

Parameters
patern: patern we want to check (this patern should not begin with white caracters)
Returns
true if the patern match, false otherwise If the patern match, the current char will be in the next char of the patern

Definition at line 448 of file PFileParser.cpp.

448 {
449 if(patern == "" || isEndOfFile() || p_currentCharEchaped) return false;
451 size_t nbCharPatern(patern.size());
452 if(p_currentChar + nbCharPatern > p_nbTotalChar){return false;}
453 bool match = true;
454 size_t i(0lu);
455 while(match && i < nbCharPatern){
456 match = (patern[i] == p_fileContent[p_currentChar + i]);
457 ++i;
458 }
459 if(match){
460 incrementCurrentChar(nbCharPatern);
461 }
462 return match;
463}
void skipWhiteSpace()
Skip the white space if there is at the current caracter position.

References incrementCurrentChar(), isEndOfFile(), p_currentChar, p_currentCharEchaped, p_fileContent, p_nbTotalChar, and skipWhiteSpace().

Referenced by getUntilKeyWithoutPaternExclude(), getUntilKeyWithoutPaternRecurse(), getUntilKeyWithoutPaternRecurse(), getUntilKeyWithoutPaternRecurseExclude(), isMatch(), isMatch(), isMatch(), isMatch(), isMatchRewind(), isMatchSeq(), isMatchToken(), parse_generic_string(), DicoValue::parseDicoValue(), DicoValue::parseList(), DicoValue::parseListOrMap(), parser_json_fileParser(), parser_json_key(), parser_json_list(), parser_json_map(), parser_jsonString(), and DicoValue::parseString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMatch() [3/5]

bool PFileParser::isMatch ( const PString & patern,
const PString & forbiddenCharBefore )

Says if the patern match with the current caracters of the PFileParser.

Parameters
patern: patern we want to check (this patern should not begin with white caracters)
forbiddenCharBefore: lisr of characters which cannot be just before the first character of the patern
Returns
true if the patern match, false otherwise If the patern match, the current char will be in the next char of the patern

Definition at line 502 of file PFileParser.cpp.

502 {
503 if(p_currentChar > 0lu){
504 //If we find a forbidden character before the current char, the patern is canceled
505 if(forbiddenCharBefore.find(p_fileContent[p_currentChar - 1lu])){
506 return false;
507 }
508 }
509 return isMatch(patern);
510}

References isMatch(), p_currentChar, and p_fileContent.

+ Here is the call graph for this function:

◆ isMatch() [4/5]

PString PFileParser::isMatch ( const PVecString & patern)

Check the matching between the current caracters and all the string in the vector.

Parameters
patern: vector of the patern we want to check
Returns
matching patern if there is one, empty string otherwise

Definition at line 543 of file PFileParser.cpp.

543 {
544 if(patern.size() == 0lu) return "";
545 PVecString::const_iterator it(patern.begin());
546 while(it != patern.end()){
547 if(isMatch(*it)) return *it;
548 ++it;
549 }
550 return "";
551}

References isMatch().

+ Here is the call graph for this function:

◆ isMatch() [5/5]

PString PFileParser::isMatch ( const std::vector< PVecString > & patern)

Check the matching between the current caracters and all the string in the list of list of string.

Parameters
patern: list of the list of the patern we want to check
Returns
matching patern if there is one, empty string otherwise

Definition at line 571 of file PFileParser.cpp.

571 {
572 if(patern.size() == 0lu) return "";
573 std::vector<PVecString >::const_iterator itList(patern.begin());
574 while(itList != patern.end()){
575 PVecString::const_iterator it(itList->begin());
576 while(it != itList->end()){
577 if(isMatch(*it)) return *it;
578 ++it;
579 }
580 ++itList;
581 }
582 return "";
583}

References isMatch().

+ Here is the call graph for this function:

◆ isMatchRewind()

bool PFileParser::isMatchRewind ( const PString & patern)

Do a isMatch and then go back at the previous position.

Parameters
patern: patern we want to check (this patern should not begin with white caracters)
Returns
true if the patern match, false otherwise If the patern match, the current char will be in the next char of the patern

Definition at line 470 of file PFileParser.cpp.

470 {
471 pushPosition();
472 bool b = isMatch(patern);
473 popPosition();
474 return b;
475}

References isMatch(), popPosition(), and pushPosition().

Referenced by DicoValue::parseList(), DicoValue::parseListOrMap(), parser_json_fileParser(), parser_json_list(), parser_json_map(), and parser_json_value().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMatchSeq()

bool PFileParser::isMatchSeq ( const PVecString & patern,
bool alwaysPopBack = false )

Match a sequence of token in a vector.

Parameters
patern: set of token to match in this order and totally
alwaysPopBack: true to make the PFileParser at the exact same place before the check even is the sequence matches
Returns
true if the full sequence matches, false otherwise

Definition at line 482 of file PFileParser.cpp.

482 {
483 pushPosition();
484 PVecString::const_iterator it(patern.begin());
485 bool matchPatern(true);
486 while(it != patern.end() && matchPatern){
487 matchPatern = isMatch(*it);
488 ++it;
489 }
490 if(!matchPatern || alwaysPopBack){
491 popPosition();
492 }
493 return matchPatern;
494}

References isMatch(), popPosition(), and pushPosition().

+ Here is the call graph for this function:

◆ isMatchToken() [1/3]

bool PFileParser::isMatchToken ( const PString & patern)

Says if the patern match with the current caracters of the PFileParser but treats the string as a token (cannot be part of a word)

Parameters
patern: patern we want to check (this patern should not begin with white caracters)
Returns
true if the patern match, false otherwise If the patern match, the current char will be in the next char of the patern

Definition at line 517 of file PFileParser.cpp.

517 {
518 pushPosition();
519 if(!isMatch(patern)){
520 popPosition();
521 return false;
522 }
523 PString letterNumberUnderscore("_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
524 if(p_currentChar > patern.size()){
525 if(letterNumberUnderscore.find(p_fileContent[p_currentChar - patern.size() - 1lu])){
526 popPosition();
527 return false;
528 }
529 }
531 if(letterNumberUnderscore.find(p_fileContent[p_currentChar])){
532 popPosition();
533 return false;
534 }
535 }
536 return true;
537}

References isMatch(), p_currentChar, p_fileContent, p_nbTotalChar, popPosition(), and pushPosition().

Referenced by isMatchToken(), and isMatchToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMatchToken() [2/3]

PString PFileParser::isMatchToken ( const PVecString & patern)

Check the matching between the current caracters and all the string in the vector but treats the string as a token (cannot be part of a word)

Parameters
patern: vector of the patern we want to check
Returns
matching patern if there is one, empty string otherwise

Definition at line 557 of file PFileParser.cpp.

557 {
558 if(patern.size() == 0lu) return "";
559 PVecString::const_iterator it(patern.begin());
560 while(it != patern.end()){
561 if(isMatchToken(*it)) return *it;
562 ++it;
563 }
564 return "";
565}
bool isMatchToken(const PString &patern)
Says if the patern match with the current caracters of the PFileParser but treats the string as a tok...

References isMatchToken().

+ Here is the call graph for this function:

◆ isMatchToken() [3/3]

template<typename T>
bool PFileParser::isMatchToken ( PString & matchKey,
T & matchValue,
const std::map< PString, T > & patern )

Check if one key of the map, matches the current token.

Parameters
[out]matchKey: matching key (on success)
[out]matchValue: matching value (on success)
patern: map of patterns to be checked
Returns
true if one of the map key matches the current token, false otherwise

Definition at line 19 of file PFileParser_impl.h.

19 {
20 if(patern.size() == 0lu) return false;
21 typename std::map<PString, T>::const_iterator it(patern.begin());
22 while(it != patern.end()){
23 if(isMatchToken(it->first)){
24 matchKey = it->first;
25 matchValue = it->second;
26 return true;
27 }
28 ++it;
29 }
30 return false;
31}

References isMatchToken().

+ Here is the call graph for this function:

◆ isWhiteSpace()

bool PFileParser::isWhiteSpace ( )

Says if the current char is a white space.

Returns
true if the current char is a white space, false if not If it matchs, the current caracter will be put on a non white space caracter

Definition at line 628 of file PFileParser.cpp.

628 {
629 if(isEndOfFile()) return false;
631 do{
634 return true;
635 }else return false;
636}

References incrementCurrentChar(), isEndOfFile(), p_currentChar, p_fileContent, and p_listWhiteSpace.

+ Here is the call graph for this function:

◆ open()

bool PFileParser::open ( const PPath & fileName)

Fonction qui ouvre le fichier que l'on va parser.

Parameters
fileName: nom du fichier à ouvrir
Returns
true si la fonction à réussie, false sinon

Definition at line 24 of file PFileParser.cpp.

24 {
25 p_fileName = fileName;
26 p_fileContent = fileName.loadFileContent();
28 return (p_fileContent != "");
29}

References p_fileContent, p_fileName, and p_nbTotalChar.

Referenced by DicoValue::load(), and parser_json().

+ Here is the caller graph for this function:

◆ popPosition()

void PFileParser::popPosition ( )

Get to the last saved position of the PFileParser in the current file.

Definition at line 106 of file PFileParser.cpp.

106 {
107 if(p_vecPosition.size() == 0lu){
108 return;
109 }
111 p_currentLine = p_vecLine.back();
112 p_vecPosition.pop_back();
113 p_vecLine.pop_back();
114}

References p_currentChar, p_currentLine, p_vecLine, and p_vecPosition.

Referenced by isMatch(), isMatchRewind(), isMatchSeq(), isMatchToken(), and parser_json_value().

+ Here is the caller graph for this function:

◆ pushPosition()

void PFileParser::pushPosition ( )

Remember the current position of the PFileParser in the current file.

Definition at line 100 of file PFileParser.cpp.

100 {
101 p_vecPosition.push_back(p_currentChar);
102 p_vecLine.push_back(p_currentLine);
103}

References p_currentChar, p_currentLine, p_vecLine, and p_vecPosition.

Referenced by isMatch(), isMatchRewind(), isMatchSeq(), isMatchToken(), and parser_json_value().

+ Here is the caller graph for this function:

◆ setColumn()

void PFileParser::setColumn ( size_t currentCol)

Set the current column of the PFileParser.

Parameters
currentCol: current column of the PFileParser

Definition at line 88 of file PFileParser.cpp.

88 {
89 p_currentLineFirstColumn = currentCol;
90}

References p_currentLineFirstColumn.

Referenced by setLocation().

+ Here is the caller graph for this function:

◆ setCurrentCharIdx()

void PFileParser::setCurrentCharIdx ( size_t index)

Set the index of the current char.

Parameters
index: index of the current char

Definition at line 74 of file PFileParser.cpp.

74 {
75 p_currentChar = index;
76}

References p_currentChar.

Referenced by PHighlightParser::doReplaceAction(), and PHighlightParser::makeHighlighting().

+ Here is the caller graph for this function:

◆ setEscapeChar()

void PFileParser::setEscapeChar ( char escapeChar)

Sets the escape character of the PFileParser.

Parameters
escapeChar: escape character of the PFileParser

Definition at line 58 of file PFileParser.cpp.

58 {
59 p_echapChar = escapeChar;
60}

References p_echapChar.

Referenced by DicoValue::fromString(), DicoValue::loadParser(), parser_json(), and parser_jsonString().

+ Here is the caller graph for this function:

◆ setFileContent()

void PFileParser::setFileContent ( const PString & fileContent)

Set the file content.

Parameters
fileContent: file content

Definition at line 50 of file PFileParser.cpp.

50 {
51 p_fileContent = fileContent;
53}

References p_fileContent, and p_nbTotalChar.

Referenced by createNestedCallFromStr(), dico_create_nested_call(), DicoValue::fromString(), PHighlightParser::makeHighlighting(), and parser_jsonString().

+ Here is the caller graph for this function:

◆ setLine()

void PFileParser::setLine ( size_t currentLine)

Set the current line of the PFileParser.

Parameters
currentLine: current line of the PFileParser

Definition at line 81 of file PFileParser.cpp.

81 {
82 p_currentLine = currentLine;
83}

References p_currentLine.

Referenced by setLocation().

+ Here is the caller graph for this function:

◆ setLocation()

void PFileParser::setLocation ( const PLocation & location)

Set the current location of the PFileParser.

Parameters
location: current location of the PFileParser

Definition at line 65 of file PFileParser.cpp.

65 {
66 setLine(location.getLine());
67 setColumn(location.getColumn());
68 p_fileName = location.getFileName();
69}
void setLine(size_t currentLine)
Set the current line of the PFileParser.
void setColumn(size_t currentCol)
Set the current column of the PFileParser.
size_t getLine() const
renvoie la ligne du PLocation
Definition PLocation.cpp:67
const PPath & getFileName() const
renvoie le fichier du PLocation
Definition PLocation.cpp:60
size_t getColumn() const
renvoie la colonne du PLocation
Definition PLocation.cpp:74

References PLocation::getColumn(), PLocation::getFileName(), PLocation::getLine(), p_fileName, setColumn(), and setLine().

+ Here is the call graph for this function:

◆ setSeparator()

void PFileParser::setSeparator ( const PString & separator)

Initialise la liste des caractères séparateurs.

Parameters
separator: liste des caractères séparateurs Se sont les caractères que l'on ne prend en compte un par un

Definition at line 43 of file PFileParser.cpp.

43 {
44 p_listSeparator = separator;
45}

References p_listSeparator.

Referenced by DicoValue::loadParser(), parser_json(), and parser_jsonString().

+ Here is the caller graph for this function:

◆ setWhiteSpace()

void PFileParser::setWhiteSpace ( const PString & whiteSpace)

Initialise la liste des caractères blancs.

Parameters
whiteSpace: liste des caractères blancs Se sont les caractères que l'on ne prend jamais en compte

Definition at line 35 of file PFileParser.cpp.

35 {
36 p_listWhiteSpace = whiteSpace;
37}

References p_listWhiteSpace.

Referenced by DicoValue::loadParser(), parser_json(), and parser_jsonString().

+ Here is the caller graph for this function:

◆ skipChars()

void PFileParser::skipChars ( const PString & chToSkip)

Skip the characters in the given string.

Parameters
chToSkip: set of characters tb skip

Definition at line 651 of file PFileParser.cpp.

651 {
652 if(chToSkip.find(p_fileContent[p_currentChar])){
653 do{
655 }while(chToSkip.find(p_fileContent[p_currentChar]) && !isEndOfFile());
656 }
657}

References incrementCurrentChar(), isEndOfFile(), p_currentChar, and p_fileContent.

Referenced by getStrComposedOf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skipWhiteSpace()

void PFileParser::skipWhiteSpace ( )

Skip the white space if there is at the current caracter position.

Definition at line 639 of file PFileParser.cpp.

639 {
640 if(p_dontSkipSpace){return;}
642 do{
645 }
646}

References incrementCurrentChar(), isEndOfFile(), p_currentChar, p_dontSkipSpace, p_fileContent, and p_listWhiteSpace.

Referenced by isMatch(), DicoValue::loadParser(), and DicoValue::parseDicoValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const PFileParser & other )
friend

Définition de l'opérateur de flux sortant.

Parameters
out: flux dans lequel il faut écrire
other: PFileParser
Returns
flux contenant le PFileParser

Definition at line 757 of file PFileParser.cpp.

757 {
758 out << "file '" << other.getFileName() << "' line " << other.getLine() << ":" << other.getColumn();
759 return out;
760}
size_t getLine() const
Fonction qui renvoie le numéro de la ligne courante.
PPath getFileName() const
Fonction qui renvoie le nom du fichier que l'on a ouvert.

References getColumn(), getFileName(), getLine(), and PFileParser().

Member Data Documentation

◆ p_currentChar

◆ p_currentCharEchaped

bool PFileParser::p_currentCharEchaped
private

True if the current char is escaped.

Definition at line 123 of file PFileParser.h.

Referenced by getUntilKeyWithoutPatern(), incrementCurrentChar(), initialisationPFileParser(), and isMatch().

◆ p_currentLine

size_t PFileParser::p_currentLine
private

◆ p_currentLineFirstColumn

size_t PFileParser::p_currentLineFirstColumn
private

Number of the first column caracter of the current line.

Definition at line 109 of file PFileParser.h.

Referenced by getColumn(), getLineIndentation(), incrementCurrentLine(), initialisationPFileParser(), and setColumn().

◆ p_dontSkipSpace

bool PFileParser::p_dontSkipSpace
private

◆ p_echapChar

char PFileParser::p_echapChar
private

Echap caracter.

Definition at line 115 of file PFileParser.h.

Referenced by getEscapeChar(), incrementCurrentChar(), initialisationPFileParser(), and setEscapeChar().

◆ p_fileContent

◆ p_fileName

PPath PFileParser::p_fileName
private

Nom du fichier que l'on veut parser.

Definition at line 99 of file PFileParser.h.

Referenced by getFileName(), getLocation(), open(), and setLocation().

◆ p_listSeparator

PString PFileParser::p_listSeparator
private

liste des séparateurs

Definition at line 113 of file PFileParser.h.

Referenced by getNextToken(), getSeparator(), initialisationPFileParser(), isChSeparator(), and setSeparator().

◆ p_listWhiteSpace

PString PFileParser::p_listWhiteSpace
private

◆ p_nbTotalChar

◆ p_vecLine

std::vector<size_t> PFileParser::p_vecLine
private

Vector of all the checkpoint rows in the text file (added with pushPosition() and removed with popPosition() or clear()

Definition at line 119 of file PFileParser.h.

Referenced by clearPosition(), popPosition(), and pushPosition().

◆ p_vecPosition

std::vector<size_t> PFileParser::p_vecPosition
private

Vector of all the checkpoint positions in the text file (added with pushPosition() and removed with popPosition() or clear()

Definition at line 117 of file PFileParser.h.

Referenced by clearPosition(), popPosition(), and pushPosition().


The documentation for this class was generated from the following files: