2020-04-25 20:53:49 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QJsonValue>
|
|
|
|
#include <QJsonArray>
|
|
|
|
#include <QJsonObject>
|
|
|
|
|
2022-12-27 22:47:46 +01:00
|
|
|
namespace json_converters {
|
2020-04-25 20:53:49 +02:00
|
|
|
|
2022-12-27 22:47:46 +01:00
|
|
|
QString jsonTypeToString(QJsonValue::Type type);
|
2020-04-25 20:53:49 +02:00
|
|
|
QJsonObject loadJson(const QByteArray &buffer);
|
|
|
|
QString parseString(const QJsonValue &jsonValue);
|
|
|
|
std::vector<QString> parseStringVector(const QJsonValue &jsonValue);
|
|
|
|
int parseInt(const QJsonValue &jsonValue);
|
|
|
|
bool parseBool(const QJsonValue &jsonValue);
|
2022-12-27 22:47:46 +01:00
|
|
|
bool parseBoolStr(const QJsonValue &jsonValue);
|
2020-04-25 20:53:49 +02:00
|
|
|
std::vector<int> parseIntVector(const QJsonValue &jsonValue);
|
2022-12-17 16:37:57 +01:00
|
|
|
std::vector<int> parseIntVectorIgnoreNulls(const QJsonValue &jsonValue);
|
2022-12-27 22:47:46 +01:00
|
|
|
template<std::size_t LENGTH>
|
|
|
|
std::array<QString, LENGTH> parseStringArray(const QJsonValue &jsonValue);
|
2020-04-25 20:53:49 +02:00
|
|
|
|
2022-12-27 22:47:46 +01:00
|
|
|
} // namespace json_converters
|