2022-06-12 23:07:53 +02:00
|
|
|
#include <STDInclude.hpp>
|
|
|
|
|
|
|
|
namespace Utils::Json
|
|
|
|
{
|
2022-08-10 23:03:26 +02:00
|
|
|
std::string TypeToString(const nlohmann::json::value_t type)
|
2022-06-12 23:07:53 +02:00
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
2022-07-29 21:54:18 +02:00
|
|
|
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-08-02 23:04:02 +02:00
|
|
|
case nlohmann::json::value_t::binary:
|
|
|
|
return "binary";
|
|
|
|
case nlohmann::json::value_t::discarded:
|
|
|
|
return "discarded";
|
2022-06-12 23:07:53 +02:00
|
|
|
default:
|
2022-08-10 23:03:26 +02:00
|
|
|
AssertUnreachable;
|
2022-08-03 18:27:07 +02:00
|
|
|
return "null";
|
2022-06-12 23:07:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|