2022-06-12 17:07:53 -04:00
|
|
|
#pragma once
|
|
|
|
|
2023-02-15 06:58:31 -05:00
|
|
|
#include <json.hpp>
|
|
|
|
|
2022-06-12 17:07:53 -04:00
|
|
|
namespace Utils::Json
|
|
|
|
{
|
2022-07-29 15:54:18 -04:00
|
|
|
std::string TypeToString(nlohmann::json::value_t type);
|
2022-12-14 03:40:15 -05:00
|
|
|
|
2023-02-15 06:58:31 -05:00
|
|
|
unsigned long ReadFlags(const std::string binaryFlags, size_t size);
|
|
|
|
|
|
|
|
Game::Bounds ReadBounds(const nlohmann::json& value);
|
|
|
|
|
|
|
|
template <typename T> void CopyArray(T* destination, const nlohmann::json& json_member, size_t count = 0)
|
|
|
|
{
|
|
|
|
if (count == 0)
|
|
|
|
{
|
|
|
|
count = json_member.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
destination[i] = json_member[i].get<T>();
|
|
|
|
}
|
|
|
|
}
|
2022-06-12 17:07:53 -04:00
|
|
|
}
|