![]() |
|
PhoenixFileParser
1.5.1
Set of tools to ease file parsing
|
Include dependency graph for parser_json.cpp:Go to the source code of this file.
Classes | |
| struct | PJsonParserData |
| Data used to parse a toml file. More... | |
Functions | |
| bool | parser_json (ConfigNode &main, const PPath &fileName) |
| Load a JSON file. | |
| bool | parser_json_fileParser (ConfigNode &node, PJsonParserData &data) |
| Parse a json file. | |
| bool | parser_json_key (ConfigNode &node, PJsonParserData &data) |
| Parse a json. | |
| bool | parser_json_list (ConfigNode &node, PJsonParserData &data) |
| Parse a json. | |
| bool | parser_json_map (ConfigNode &node, PJsonParserData &data) |
| Parse a json. | |
| bool | parser_json_value (ConfigNode &node, PJsonParserData &data) |
| Parse a json. | |
| bool | parser_json_value (PString &value, PJsonParserData &data) |
| Parse a json. | |
| bool | parser_jsonErrorAt (PJsonParserData &data, const PString &errorMsg) |
| Print the parsing error. | |
| bool | parser_jsonString (ConfigNode &main, const PString &fileContent) |
| Load a JSON string. | |
| bool | parser_jsonString (PString &str, PJsonParserData &data) |
| Parse a JSON string. | |
| PString | toJsonSaveRecurse (const ConfigNode &node, const PString &indentation, const PString &baseIndentation, const PString &baseNewLine, bool isInList) |
| Convert the ConfigNode in a PString. | |
| PString | toJsonString (const ConfigNode &main, const PString &baseIndentation, const PString &baseNewLine) |
| Convert the current ConfigNode to a JSON string. | |
| bool parser_json | ( | ConfigNode & | main, |
| const PPath & | fileName ) |
Load a JSON file.
| [out] | main | : ConfigNode to be updated |
| fileName | : name of the file to be loaded |
Definition at line 219 of file parser_json.cpp.
References PFileParser::open(), PJsonParserData::parser, parser_json_fileParser(), PFileParser::setEscapeChar(), ConfigNode::setFileName(), PFileParser::setSeparator(), and PFileParser::setWhiteSpace().
Here is the call graph for this function:| bool parser_json_fileParser | ( | ConfigNode & | node, |
| PJsonParserData & | data ) |
Parse a json file.
| [out] | node | : ConfigNode of values |
| data | : PJsonParserData to be used |
Definition at line 182 of file parser_json.cpp.
References PFileParser::getLocation(), PFileParser::getStrComposedOf(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PFileParser::isMatchRewind(), PJsonParserData::isRun, PJsonParserData::parser, parser_json_key(), parser_json_list(), parser_json_map(), parser_json_value(), parser_jsonErrorAt(), and ConfigNode::setLineCol().
Referenced by parser_json(), and parser_jsonString().
Here is the call graph for this function:
Here is the caller graph for this function:| bool parser_json_key | ( | ConfigNode & | node, |
| PJsonParserData & | data ) |
Parse a json.
| [out] | node | : ConfigNode of values |
| data | : PJsonParserData to be used |
Definition at line 93 of file parser_json.cpp.
References ConfigNode::addChild(), ConfigNode::getChild(), ConfigNode::getLocation(), PFileParser::getLocation(), PFileParser::isMatch(), PJsonParserData::isRun, PJsonParserData::parser, parser_json_list(), parser_json_map(), parser_json_value(), parser_jsonErrorAt(), parser_jsonString(), and ConfigNode::setLineCol().
Referenced by parser_json_fileParser(), and parser_json_map().
Here is the call graph for this function:
Here is the caller graph for this function:| bool parser_json_list | ( | ConfigNode & | node, |
| PJsonParserData & | data ) |
Parse a json.
| [out] | node | : ConfigNode of values |
| data | : PJsonParserData to be used |
Definition at line 152 of file parser_json.cpp.
References ConfigNode::addChild(), PFileParser::getLocation(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PFileParser::isMatchRewind(), PJsonParserData::isRun, PJsonParserData::parser, parser_json_list(), parser_json_map(), parser_json_value(), parser_jsonErrorAt(), ConfigNode::setLineCol(), and ConfigNode::setValue().
Referenced by parser_json_fileParser(), parser_json_key(), and parser_json_list().
Here is the call graph for this function:
Here is the caller graph for this function:| bool parser_json_map | ( | ConfigNode & | node, |
| PJsonParserData & | data ) |
Parse a json.
| [out] | node | : ConfigNode of values |
| data | : PJsonParserData to be used |
Definition at line 129 of file parser_json.cpp.
References PFileParser::getLocation(), PFileParser::isEndOfFile(), PFileParser::isMatch(), PFileParser::isMatchRewind(), PJsonParserData::isRun, PJsonParserData::parser, parser_json_key(), parser_jsonErrorAt(), and ConfigNode::setLineCol().
Referenced by parser_json_fileParser(), parser_json_key(), and parser_json_list().
Here is the call graph for this function:
Here is the caller graph for this function:| bool parser_json_value | ( | ConfigNode & | node, |
| PJsonParserData & | data ) |
Parse a json.
| [out] | node | : ConfigNode of values |
| data | : PJsonParserData to be used |
Definition at line 78 of file parser_json.cpp.
References PFileParser::getLocation(), PJsonParserData::parser, parser_json_value(), ConfigNode::setLineCol(), and ConfigNode::setValue().
Here is the call graph for this function:| bool parser_json_value | ( | PString & | value, |
| PJsonParserData & | data ) |
Parse a json.
| [out] | node | : ConfigNode of values |
| data | : PJsonParserData to be used |
Definition at line 54 of file parser_json.cpp.
References PFileParser::clearPosition(), PFileParser::getStrComposedOf(), PFileParser::isMatchRewind(), PJsonParserData::parser, parser_jsonString(), PFileParser::popPosition(), and PFileParser::pushPosition().
Referenced by parser_json_fileParser(), parser_json_key(), parser_json_list(), and parser_json_value().
Here is the call graph for this function:
Here is the caller graph for this function:| bool parser_jsonErrorAt | ( | PJsonParserData & | data, |
| const PString & | errorMsg ) |
Print the parsing error.
| [out] | parser | : parser to be used |
| [out] | isRunning | : true to continue the parsing, false to stop it |
| errorMsg | : error message |
Definition at line 27 of file parser_json.cpp.
References PFileParser::getLocation(), PFileParser::getNextToken(), PJsonParserData::isRun, and PJsonParserData::parser.
Referenced by parser_json_fileParser(), parser_json_key(), parser_json_list(), and parser_json_map().
Here is the call graph for this function:
Here is the caller graph for this function:| bool parser_jsonString | ( | ConfigNode & | main, |
| const PString & | fileContent ) |
Load a JSON string.
| [out] | main | : ConfigNode to be updated |
| fileContent | : string to be loaded |
Definition at line 239 of file parser_json.cpp.
References PJsonParserData::parser, parser_json_fileParser(), PFileParser::setEscapeChar(), PFileParser::setFileContent(), PFileParser::setSeparator(), and PFileParser::setWhiteSpace().
Here is the call graph for this function:| bool parser_jsonString | ( | PString & | str, |
| PJsonParserData & | data ) |
Parse a JSON string.
| [out] | str | : parsed string |
| [out] | data | : parsing data |
Definition at line 40 of file parser_json.cpp.
References PFileParser::getUntilKey(), PFileParser::isMatch(), and PJsonParserData::parser.
Referenced by parser_json_key(), and parser_json_value().
Here is the call graph for this function:
Here is the caller graph for this function:| PString toJsonSaveRecurse | ( | const ConfigNode & | node, |
| const PString & | indentation, | ||
| const PString & | baseIndentation, | ||
| const PString & | baseNewLine, | ||
| bool | isInList ) |
Convert the ConfigNode in a PString.
| node | : ConfigNode to be saved |
| indentation | : indentation of the current ConfigNode |
| baseIndentation | : indentation character(s) to be used |
| baseNewLine | : new line character(s) to be used |
| isInList | : true if the dico value is in a list |
Definition at line 259 of file parser_json.cpp.
References ConfigNode::getMapChild(), ConfigNode::getName(), ConfigNode::getValue(), ConfigNode::getVecChild(), and toJsonSaveRecurse().
Referenced by toJsonSaveRecurse(), and toJsonString().
Here is the call graph for this function:
Here is the caller graph for this function:| PString toJsonString | ( | const ConfigNode & | main, |
| const PString & | baseIndentation, | ||
| const PString & | baseNewLine ) |
Convert the current ConfigNode to a JSON string.
| main | : ConfigNode to be converted |
| baseIndentation | : indentation to be used |
| baseNewLine | : new line to be used |
Definition at line 300 of file parser_json.cpp.
References toJsonSaveRecurse().
Here is the call graph for this function: