mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-24 04:22:39 +00:00
NOISSUE add a way to require object from Json value ref
This commit is contained in:
@@ -78,6 +78,14 @@ QJsonObject requireObject(const QJsonDocument &doc, const QString &what)
|
||||
}
|
||||
return doc.object();
|
||||
}
|
||||
QJsonObject requireObject(const QJsonValueRef &node, const QString &what)
|
||||
{
|
||||
if (!node.isObject())
|
||||
{
|
||||
throw JsonException(what + " is not an object");
|
||||
}
|
||||
return node.toObject();
|
||||
}
|
||||
QJsonArray requireArray(const QJsonDocument &doc, const QString &what)
|
||||
{
|
||||
if (!doc.isArray())
|
||||
|
||||
Reference in New Issue
Block a user