PhoenixYml  1.2.2
Yml parser for Phoenix
Loading...
Searching...
No Matches
parser_yml.h File Reference
#include "phoenix_get_string.h"
+ Include dependency graph for parser_yml.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool parser_yml (ConfigNode &dico, const PPath &fileName)
 Parse a yml file and update the given ConfigNode.
 
bool parser_yml (DicoValue &dico, const PPath &fileName)
 Parse a yml file and update the given DicoValue.
 
bool parser_ymlString (ConfigNode &dico, const PString &content)
 Parse a toml string.
 

Function Documentation

◆ parser_yml() [1/2]

bool parser_yml ( ConfigNode & dico,
const PPath & fileName )

Parse a yml file and update the given ConfigNode.

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

Definition at line 390 of file parser_yml.cpp.

390 {
391 VecValue vecValue;
392 bool b(parser_yml_parseVecValue(vecValue, fileName));
393 vecValueToConfigNode(dico, vecValue);
394 return b;
395}
Vector of keys and values.
Definition VecValue.h:15
bool parser_yml_parseVecValue(VecValue &dico, const PPath &fileName)
Parse a VecValue from a file.
void vecValueToConfigNode(ConfigNode &dicoValue, const VecValue &vecVal, bool isMainValue)
Convert a VecValue into a ConfigNode.

References parser_yml_parseVecValue(), and vecValueToConfigNode().

+ Here is the call graph for this function:

◆ parser_yml() [2/2]

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

Parse a yml file and update the given DicoValue.

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

Definition at line 378 of file parser_yml.cpp.

378 {
379 VecValue vecValue;
380 bool b(parser_yml_parseVecValue(vecValue, fileName));
381 vecValueToDicoValue(dico, vecValue);
382 return b;
383}
void vecValueToDicoValue(DicoValue &dicoValue, const VecValue &vecVal, bool isMainValue)
Convert a VecValue into a DicoValue.

References parser_yml_parseVecValue(), and vecValueToDicoValue().

+ Here is the call graph for this function:

◆ parser_ymlString()

bool parser_ymlString ( 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 402 of file parser_yml.cpp.

402 {
403 PFileParser parser;
404 parser.setWhiteSpace("");
405 parser.setSeparator(":-'\",{}[]>|#");
406 parser.setEscapeChar('\\');
407 parser.setFileContent(fileContent);
408 VecValue vecValue;
409 vecValue.setType(VecValueType::MAIN);
410 vecValue.setIndentation(parser.getLocation().getColumn());
411 bool b = parser_yml_fileParser(vecValue, parser);
412 vecValueToConfigNode(node, vecValue);
413
414 return b;
415}
void setIndentation(size_t indentation)
Sets the indentation of the VecValue.
Definition VecValue.cpp:69
void setType(const VecValueType::VecValueType &type)
Sets the type of the VecValue.
Definition VecValue.cpp:62
bool parser_yml_fileParser(VecValue &dico, PFileParser &parser)
Parse a yml file and update the given VecValue.

References VecValueType::MAIN, parser_yml_fileParser(), VecValue::setIndentation(), VecValue::setType(), and vecValueToConfigNode().

+ Here is the call graph for this function: