PhoenixFileParser  1.0.0
Set of tools to ease file parsing
Loading...
Searching...
No Matches
parse_generic_string.cpp File Reference
+ Include dependency graph for parse_generic_string.cpp:

Go to the source code of this file.

Functions

bool parse_generic_string (PString &str, PFileParser &parser)
 Parse string value.
 

Function Documentation

◆ parse_generic_string()

bool parse_generic_string ( PString & str,
PFileParser & parser )

Parse string value.

Parameters
[out]str: parsed string value
[out]parser: PFileParser to be used
Returns
true on success, false otherwise

Definition at line 14 of file parse_generic_string.cpp.

14 {
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}
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.

References PFileParser::getUntilKey(), and PFileParser::isMatch().

+ Here is the call graph for this function: