NOISSUE disambiguate Json parsing calls

This commit is contained in:
Petr Mrázek
2022-05-29 04:58:42 +02:00
parent f59822fd65
commit 66c6e6e05d
16 changed files with 59 additions and 58 deletions

View File

@@ -212,11 +212,11 @@ QVector<T> ensureIsArrayOf(const QJsonObject &parent, const QString &key,
// this macro part could be replaced by variadic functions that just pass on their arguments, but that wouldn't work well with IDE helpers
#define JSON_HELPERFUNCTIONS(NAME, TYPE) \
inline TYPE require##NAME(const QJsonValue &value, const QString &what = "Value") \
inline TYPE requireValue##NAME(const QJsonValue &value, const QString &what = "Value") \
{ \
return requireIsType<TYPE>(value, what); \
} \
inline TYPE ensure##NAME(const QJsonValue &value, const TYPE default_ = TYPE(), const QString &what = "Value") \
inline TYPE ensureValue##NAME(const QJsonValue &value, const TYPE default_ = TYPE(), const QString &what = "Value") \
{ \
return ensureIsType<TYPE>(value, default_, what); \
} \