PhoenixFileParser  1.0.0
Set of tools to ease file parsing
Loading...
Searching...
No Matches
parse_generic_string.cpp
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
8
10
14bool parse_generic_string(PString & str, PFileParser & parser){
15 if(parser.isMatch("\"\"\"")){
16 str = "\"\"\"" + parser.getUntilKey("\"\"\"");
17 }else if(parser.isMatch("\"")){
18 str = "\"" + parser.getUntilKey("\"");
19 }else if(parser.isMatch("'''")){
20 str = "'''" + parser.getUntilKey("'''");
21 }else if(parser.isMatch("'")){
22 str = "'" + parser.getUntilKey("'");
23 }else{
24 return false;
25 }
26 return true;
27}
28
29
30
classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres
Definition PFileParser.h:20
bool isMatch(const PString &patern)
Says if the patern match with the current caracters of the PFileParser.
PString getUntilKey(const PString &patern)
Renvoie la chaine de caractère du caractère courant jusqu'à patern comprise.
bool parse_generic_string(PString &str, PFileParser &parser)
Parse string value.