GCompris-qt
42 onError: jsonparser.
error(msg);
50 signal error(
string msg);
67 function parseString(json, validateFunc)
71 doc = JSON.parse(json);
73 if (validateFunc !== undefined
74 && !validateFunc(doc)) {
75 error(
"JsonParser: JSON is semantically invalid");
79 error(
"JsonParser: JSON is syntactically invalid: " + e);
94 function parseFromUrl(url, validateFunc)
97 if (url.substring(0,3) ==
"qrc" || url.substring(0,4) ==
"file"
98 || url.substring(0,1) ==
":") {
99 json = jsonFile.read(url);
101 return parseString(json, validateFunc);
102 }
else if (url.substring(0,4) ==
"http")
103 error(
"http:// scheme not yet implemented");
105 error(
"Unknown url scheme in url parameter");
void error(const QString &msg)
Emitted when an error occurs.
A helper component for accessing local files from QML.
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:47 by
doxygen 1.8.9.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.