48 varName = parser.
getStrComposedOf(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");
66 std::cerr <<
"parse_toml_varValue : expect ',' or ']' forunclosed list of values at " << parser.
getLocation() << std::endl;
72 std::cerr <<
"parse_toml_varBase : missing ']' token to close empty list of value at " << parser.
getLocation() << std::endl;
82 }
else if(parser.
isMatch(
"true")){
84 }
else if(parser.
isMatch(
"false")){
88 if(valueNumber !=
""){
91 std::cerr <<
"parse_toml_varValue : missing value of variable '"<<var.
getKey()<<
"' at " << parser.
getLocation() << std::endl;
107 if(!parser.
isMatch(
"{")){
return false;}
112 std::cerr <<
"parse_tomlCompactDico : expect ',' or '}' for unclosed dictionary of values at " << parser.
getLocation() << std::endl;
118 std::cerr <<
"parse_tomlCompactDico : missing '}' token to close empty dictionary of value at " << parser.
getLocation() << std::endl;
137 std::cerr <<
"parse_toml_varBase : missing '=' token to define value of variable '"<<varName<<
"' at " << parser.
getLocation() << std::endl;
182 for(PVecString::const_iterator it(vecDicoName.begin()); it != vecDicoName.end(); ++it){
196 if(!parser.
isMatch(
"[")){
return false;}
224 if(!parser.
isMatch(
"[[")){
return false;}
261 if(nextToken.size() != 0lu){
262 std::cerr <<
"parser_toml_fileParser : error at " << parser.
getLocation() << std::endl;
263 std::cerr <<
"\tunexpected token '"<<nextToken<<
"'" << std::endl;
281 if(!parser.
open(fileName)){
282 std::cerr <<
"parser_toml : cannot open file '"<<fileName<<
"'" << std::endl;
285 bool b(parser_toml_fileParser(dico, parser));
std::vector< PString > PVecString
const PString & getKey() const
Gets the key of the DicoValue.
void setKey(const PString &key)
Sets the key of the DicoValue.
const std::vector< DicoValue > & getVecChild() const
Gets the vecChild of the DicoValue.
void setValue(const PString &value)
Sets the value of the DicoValue.
const std::map< PString, DicoValue > & getMapChild() const
Gets the mapChild of the DicoValue.
classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres
void setSeparator(const PString &separator)
Initialise la liste des caractères séparateurs.
bool open(const PPath &fileName)
Fonction qui ouvre le fichier que l'on va parser.
PString getNextToken()
Get the next token.
PString getUntilKeyWithoutPatern(const PString &patern)
Renvoie la chaine de caractère du caractère courant jusqu'à patern exclu.
void setEscapeChar(char escapeChar)
Sets the escape character of the PFileParser.
PString getStrComposedOf(const PString &charset)
Get string composed of the characters in the string charset.
void setWhiteSpace(const PString &whiteSpace)
Initialise la liste des caractères blancs.
bool isMatchRewind(const PString &patern)
Do a isMatch and then go back at the previous position.
bool isMatch(const PString &patern)
Says if the patern match with the current caracters of the PFileParser.
PLocation getLocation() const
Fonction qui renvoie la PLocation du PFileParser.
bool isEndOfFile() const
Dit si on est à la fin du fichier.
Path of a directory or a file.
std::vector< PString > split(char separator) const
Cut a PString on the given separator char.
bool parse_generic_string(PString &str, PFileParser &parser)
Parse string value.
void parse_toml_stopParsing(PTomlParserData &data)
Stop the file parsing.
bool parse_toml_dico_def(DicoValue &parent, PFileParser &parser, PTomlParserData &data)
Parse a dico definition.
bool parse_toml_varBase(DicoValue &var, PFileParser &parser, PTomlParserData &data)
Parse a toml var name.
bool parse_toml_isParse(const PTomlParserData &data)
Say if the file parsing is enable.
bool parse_toml_varName(PString &varName, PFileParser &parser)
Parse a toml var name.
bool parse_toml_varValue(DicoValue &var, PFileParser &parser, PTomlParserData &data)
Parse a toml var name.
DicoValue * parse_get_parent_dico(DicoValue &parent, const PVecString &vecDicoName)
Get the parent dictionary by respect to the vecDicoName.
bool parse_toml_varTable(DicoValue &dico, PFileParser &parser, PTomlParserData &data)
Parse a toml var name.
bool parse_toml_table_def(DicoValue &parent, PFileParser &parser, PTomlParserData &data)
Parse a dico definition.
bool parse_tomlCompactDico(DicoValue &parent, PFileParser &parser, PTomlParserData &data)
Parse a compact dico definition.
PTomlParserData default_PTomlParserData()
Default value of PTomlParserData.
bool parse_toml_all(DicoValue &parent, PFileParser &parser, PTomlParserData &data)
bool parse_toml_var(DicoValue &dico, PFileParser &parser, PTomlParserData &data)
Parse a toml var name.
bool parser_toml(DicoValue &dico, const PPath &fileName)
Data used to parse a toml file.
bool isRun
True to continue the parsing, false to stop.