1c5f01b2fSopenharmony_ci// __ _____ _____ _____ 2c5f01b2fSopenharmony_ci// __| | __| | | | JSON for Modern C++ 3c5f01b2fSopenharmony_ci// | | |__ | | | | | | version 3.11.2 4c5f01b2fSopenharmony_ci// |_____|_____|_____|_|___| https://github.com/nlohmann/json 5c5f01b2fSopenharmony_ci// 6c5f01b2fSopenharmony_ci// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me> 7c5f01b2fSopenharmony_ci// SPDX-License-Identifier: MIT 8c5f01b2fSopenharmony_ci 9c5f01b2fSopenharmony_ci#pragma once 10c5f01b2fSopenharmony_ci 11c5f01b2fSopenharmony_ci#include <utility> 12c5f01b2fSopenharmony_ci 13c5f01b2fSopenharmony_ci#include <nlohmann/detail/abi_macros.hpp> 14c5f01b2fSopenharmony_ci#include <nlohmann/detail/conversions/from_json.hpp> 15c5f01b2fSopenharmony_ci#include <nlohmann/detail/conversions/to_json.hpp> 16c5f01b2fSopenharmony_ci#include <nlohmann/detail/meta/identity_tag.hpp> 17c5f01b2fSopenharmony_ci 18c5f01b2fSopenharmony_ciNLOHMANN_JSON_NAMESPACE_BEGIN 19c5f01b2fSopenharmony_ci 20c5f01b2fSopenharmony_ci/// @sa https://json.nlohmann.me/api/adl_serializer/ 21c5f01b2fSopenharmony_citemplate<typename ValueType, typename> 22c5f01b2fSopenharmony_cistruct adl_serializer 23c5f01b2fSopenharmony_ci{ 24c5f01b2fSopenharmony_ci /// @brief convert a JSON value to any value type 25c5f01b2fSopenharmony_ci /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ 26c5f01b2fSopenharmony_ci template<typename BasicJsonType, typename TargetType = ValueType> 27c5f01b2fSopenharmony_ci static auto from_json(BasicJsonType && j, TargetType& val) noexcept( 28c5f01b2fSopenharmony_ci noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))) 29c5f01b2fSopenharmony_ci -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()) 30c5f01b2fSopenharmony_ci { 31c5f01b2fSopenharmony_ci ::nlohmann::from_json(std::forward<BasicJsonType>(j), val); 32c5f01b2fSopenharmony_ci } 33c5f01b2fSopenharmony_ci 34c5f01b2fSopenharmony_ci /// @brief convert a JSON value to any value type 35c5f01b2fSopenharmony_ci /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ 36c5f01b2fSopenharmony_ci template<typename BasicJsonType, typename TargetType = ValueType> 37c5f01b2fSopenharmony_ci static auto from_json(BasicJsonType && j) noexcept( 38c5f01b2fSopenharmony_ci noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))) 39c5f01b2fSopenharmony_ci -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})) 40c5f01b2fSopenharmony_ci { 41c5f01b2fSopenharmony_ci return ::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}); 42c5f01b2fSopenharmony_ci } 43c5f01b2fSopenharmony_ci 44c5f01b2fSopenharmony_ci /// @brief convert any value type to a JSON value 45c5f01b2fSopenharmony_ci /// @sa https://json.nlohmann.me/api/adl_serializer/to_json/ 46c5f01b2fSopenharmony_ci template<typename BasicJsonType, typename TargetType = ValueType> 47c5f01b2fSopenharmony_ci static auto to_json(BasicJsonType& j, TargetType && val) noexcept( 48c5f01b2fSopenharmony_ci noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val)))) 49c5f01b2fSopenharmony_ci -> decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void()) 50c5f01b2fSopenharmony_ci { 51c5f01b2fSopenharmony_ci ::nlohmann::to_json(j, std::forward<TargetType>(val)); 52c5f01b2fSopenharmony_ci } 53c5f01b2fSopenharmony_ci}; 54c5f01b2fSopenharmony_ci 55c5f01b2fSopenharmony_ciNLOHMANN_JSON_NAMESPACE_END 56