mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-23 20:12:34 +00:00
NOISSUE even more version file refactors
There is no end to them in sight
This commit is contained in:
27
logic/Json.h
27
logic/Json.h
@@ -48,33 +48,6 @@ MULTIMC_LOGIC_EXPORT QJsonArray requireArray(const QJsonDocument &doc, const QSt
|
||||
void writeString(QJsonObject & to, const QString &key, const QString &value);
|
||||
void writeStringList(QJsonObject & to, const QString &key, const QStringList &values);
|
||||
|
||||
template <typename T>
|
||||
void writeObjectList(QJsonObject & to, QString key, QList<std::shared_ptr<T>> values)
|
||||
{
|
||||
if (!values.isEmpty())
|
||||
{
|
||||
QJsonArray array;
|
||||
for (auto value: values)
|
||||
{
|
||||
array.append(value->toJson());
|
||||
}
|
||||
to.insert(key, array);
|
||||
}
|
||||
}
|
||||
template <typename T>
|
||||
void writeObjectList(QJsonObject & to, QString key, QList<T> values)
|
||||
{
|
||||
if (!values.isEmpty())
|
||||
{
|
||||
QJsonArray array;
|
||||
for (auto value: values)
|
||||
{
|
||||
array.append(value.toJson());
|
||||
}
|
||||
to.insert(key, array);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
QJsonValue toJson(const T &t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user