GCompris-qt
JsonParser Class Reference
Inherits QtQuick.Item, and QtObject.
Signals | |
void | error (string msg) |
Public Member Functions | |
void | parseFromUrl (string url, functions validateFunc) |
void | parseString (string json, function validateFunc) |
Properties | |
File | jsonFile |
Detailed Description
A QML helper component for loading and validating JSON data.
Definition at line 29 of file JsonParser.qml.
Member Function Documentation
|
signal |
Emitted upon error.
- Parameters
-
msg Error message.
void JsonParser::parseFromUrl | ( | string | url, |
functions | validateFunc | ||
) |
Parse a json string from the given url and return a corresponding object.
- Parameters
-
url Source URL for the json file to parse. Supported URL-schemes: file://, qrc://. validateFunc cf. parseString
- Returns
- cf. parseString
void JsonParser::parseString | ( | string | json, |
function | validateFunc | ||
) |
Parse the passed json string and return a corresponding object.
- Parameters
-
json JSON string to parse. validateFunc Function used to semantically validate the parsed json [optional]. The function must have the signature bool validateFunc(jsonString)
and returntrue
if json string is semantically valid,false
otherwise.
- Returns
- The object parsed from json if valid,
null
if json is syntactically or semantically invalid.
Property Documentation
File JsonParser::jsonFile |
File with json content to parse.
Definition at line 35 of file JsonParser.qml.
The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:48 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:48 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.