More refactor.
This commit is contained in:
parent
6b76af116e
commit
47bc7e5ee3
10 changed files with 184 additions and 215 deletions
|
@ -44,6 +44,13 @@ QJsonObject MMCJson::ensureObject(const QJsonValue val, const QString what)
|
|||
return val.toObject();
|
||||
}
|
||||
|
||||
QJsonObject MMCJson::ensureObject(const QJsonDocument val, const QString what)
|
||||
{
|
||||
if (!val.isObject())
|
||||
throw JSONValidationError(what + " is not an object");
|
||||
return val.object();
|
||||
}
|
||||
|
||||
QString MMCJson::ensureString(const QJsonValue val, const QString what)
|
||||
{
|
||||
if (!val.isString())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue