iw4x-client/src/Utils/Json.hpp
Louve f409b881e2
IW4OF integration (#772)
Co-authored-by: Louvenarde <louve@louve.systems>
Co-authored-by: Roxanne <roxanne@thegamebakers.com>
Co-authored-by: FutureRave <edoardo.sanguineti222@gmail.com>
2023-02-15 11:58:31 +00:00

26 lines
507 B
C++

#pragma once
#include <json.hpp>
namespace Utils::Json
{
std::string TypeToString(nlohmann::json::value_t type);
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>();
}
}
}