iw4x-client/src/Utils/Json.cpp

30 lines
690 B
C++
Raw Normal View History

2022-06-12 23:07:53 +02:00
#include <STDInclude.hpp>
namespace Utils::Json
{
std::string TypeToString(nlohmann::json::value_t type)
2022-06-12 23:07:53 +02:00
{
switch (type)
{
case nlohmann::json::value_t::null:
return "null";
case nlohmann::json::value_t::number_integer:
return "number_integer";
case nlohmann::json::value_t::number_unsigned:
return "number_unsigned";
case nlohmann::json::value_t::number_float:
return "number_float";
case nlohmann::json::value_t::boolean:
return "boolean";
case nlohmann::json::value_t::string:
return "string";
case nlohmann::json::value_t::array:
return "array";
case nlohmann::json::value_t::object:
return "object";
2022-06-12 23:07:53 +02:00
default:
return "null";
2022-06-12 23:07:53 +02:00
}
}
}