switch back to json lohman - qtjson in new branch for more testing

This commit is contained in:
DenioD
2020-07-05 20:06:35 +02:00
parent 362e93f0b3
commit 460974f594
28 changed files with 19342 additions and 466 deletions

View File

@@ -4,6 +4,8 @@
#include "precompiled.h"
#include "camount.h"
using json = nlohmann::json;
struct Config {
QString server;
};
@@ -221,12 +223,13 @@ private:
};
inline bool isJsonResultSuccess(const QJsonValue& res) {
return res.toObject()["result"].toString() == "success";
inline bool isJsonResultSuccess(const json& res) {
return res.find("result") != res.end() &&
QString::fromStdString(res["result"].get<json::string_t>()) == "success";
}
inline bool isJsonError(const QJsonValue& res) {
return !res.toObject()["error"].isNull();
inline bool isJsonError(const json& res) {
return res.find("error") != res.end();
}