PhoenixToml  1.2.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 486 of file parser_toml.cpp.

486 {
488 PFileParser & parser = data.parser;
489 parser.setWhiteSpace(" \n\t");
490 parser.setSeparator(":-'\",{}[]>|");
491 parser.setEscapeChar('\\');
492 if(!parser.open(fileName)){
493 std::cerr << "parser_toml : cannot open file '"<<fileName<<"'" << std::endl;
494 return false;
495 }
496 node.setFileName(fileName);
497 bool b(parser_toml_fileParser(node, data));
498 return b;
499}
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 506 of file parser_toml.cpp.

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

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

+ Here is the call graph for this function: