dde-application-manager/src/modules/util/json.h
tsic404 d36a325b06 chore(CI): fix reuse
remove multi SPDX info

log:
2023-02-23 21:57:13 +08:00

63 lines
1.3 KiB
C

// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef LINGLONG_BOX_SRC_UTIL_JSON_H_
#define LINGLONG_BOX_SRC_UTIL_JSON_H_
#define JSON_USE_IMPLICIT_CONVERSIONS 0
#include <optional>
#define tl std
// namespace nlohmann {
// template<class J, class T>
// inline void from_json(const J &j, tl::optional<T> &v)
// {
// if (j.is_null()) {
// v = tl::nullopt;
// } else {
// v = j.template get<T>();
// }
// }
// template<class J, class T>
// inline void to_json(J &j, const tl::optional<T> &o)
// {
// if (o.has_value()) {
// j = o.value();
// }
// }
// } // namespace nlohmann
// namespace linglong {
// template<class T>
// tl::optional<T> optional(const QJsonObject &j, const char *key)
// {
// tl::optional<T> o;
// auto iter = j.template find(key);
// if (iter != j.end()) {
// o = iter->template get<tl::optional<T>>();
// }
// return o;
// }
// template<class T>
// tl::optional<T> optional(const nlohmann::json &j, const char *key)
// {
// tl::optional<T> o;
// auto iter = j.template find(key);
// if (iter != j.end()) {
// o = iter->template get<tl::optional<T>>();
// }
// return o;
// }
// } // namespace linglong
#endif /* LINGLONG_BOX_SRC_UTIL_JSON_H_ */