PhoenixToml  1.4.0
Toml parser for Phoenix
Loading...
Searching...
No Matches
parser_toml.h File Reference
#include "phoenix_get_string.h"
#include "ConfigNode.h"
+ Include dependency graph for parser_toml.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool parser_toml (ConfigNode &node, const PPath &fileName)
 Parse a toml file.
 
bool parser_toml (DicoValue &dico, const PPath &fileName)
 Parse a toml file and update the given DicoValue.
 
bool parser_tomlString (ConfigNode &node, const PString &fileContent)
 Parse a toml string.
 

Function Documentation

◆ parser_toml() [1/2]

bool parser_toml ( ConfigNode & node,
const PPath & fileName )

Parse a toml file.

Parameters
[out]node: ConfigNode to be updated
fileName: name of the file to be parsed
Returns
true on success, false otherwise

Definition at line 489 of file parser_toml.cpp.

489 {
491 PFileParser & parser = data.parser;
492 parser.setWhiteSpace(" \n\t");
493 parser.setSeparator(":-'\",{}[]>|");
494 parser.setEscapeChar('\\');
495 if(!parser.open(fileName)){
496 std::cerr << "parser_toml : cannot open file '"<<fileName<<"'" << std::endl;
497 return false;
498 }
499 node.setFileName(fileName);
500 bool b(parser_toml_fileParser(node, data));
501 return b;
502}
bool parser_toml_fileParser(DicoValue &dico, PTomlParserData &data)
Parse a yml file and update the given VecValue.
PTomlParserData default_PTomlParserData()
Default value of PTomlParserData.
Data used to parse a toml file.

References default_PTomlParserData(), PTomlParserData::parser, and parser_toml_fileParser().

+ Here is the call graph for this function:

◆ parser_toml() [2/2]

bool parser_toml ( DicoValue & dico,
const PPath & fileName )

Parse a toml file and update the given DicoValue.

Parameters
[out]dico: dictionary of values
fileName: name of the file to be parsed
Returns
true on success, false otherwise

Definition at line 280 of file parser_toml.cpp.

280 {
282 PFileParser & parser = data.parser;
283 parser.setWhiteSpace(" \n\t");
284 parser.setSeparator(":-'\",{}[]>|");
285 parser.setEscapeChar('\\');
286 if(!parser.open(fileName)){
287 std::cerr << "parser_toml : cannot open file '"<<fileName<<"'" << std::endl;
288 return false;
289 }
290 bool b(parser_toml_fileParser(dico, data));
291 return b;
292}

References default_PTomlParserData(), PTomlParserData::parser, and parser_toml_fileParser().

+ Here is the call graph for this function:

◆ parser_tomlString()

bool parser_tomlString ( ConfigNode & node,
const PString & fileContent )

Parse a toml string.

Parameters
[out]node: ConfigNode to be updated
fileName: name of the file to be parsed
Returns
true on success, false otherwise

Definition at line 509 of file parser_toml.cpp.

509 {
511 PFileParser & parser = data.parser;
512 parser.setWhiteSpace(" \n\t");
513 parser.setSeparator(":-'\",{}[]>|");
514 parser.setEscapeChar('\\');
515 parser.setFileContent(fileContent);
516 bool b(parser_toml_fileParser(node, data));
517 return b;
518}

References default_PTomlParserData(), PTomlParserData::parser, and parser_toml_fileParser().

+ Here is the call graph for this function: