1
0
mirror of https://github.com/blawar/ooot.git synced 2024-06-25 22:09:34 +00:00
ooot/include/json.h

25 lines
1.5 KiB
C++

#pragma once
#include <rapidjson/istreamwrapper.h>
#include "rapidjson/document.h"
#include "rapidjson/prettywriter.h"
#include "rapidjson/stringbuffer.h"
#include "ultra64/types.h"
namespace oot::json
{
bool save(rapidjson::Document& doc, const std::string& jsonFilePath);
void set(rapidjson::Value& document, const char* key, const std::string& value, rapidjson::Document::AllocatorType& alloc);
void set(rapidjson::Value& document, const char* key, rapidjson::Value& value, rapidjson::Document::AllocatorType& alloc);
void set(rapidjson::Value& document, const char* key, int value, rapidjson::Document::AllocatorType& alloc);
void setU64(rapidjson::Value& document, const char* key, u64 value, rapidjson::Document::AllocatorType& alloc);
void setS64(rapidjson::Value& document, const char* key, s64 value, rapidjson::Document::AllocatorType& alloc);
void setBool(rapidjson::Value& document, const char* key, bool value, rapidjson::Document::AllocatorType& alloc);
void setFloat(rapidjson::Value& document, const char* key, float value, rapidjson::Document::AllocatorType& alloc);
bool get(rapidjson::Value& document, const char* key, std::string& value);
bool getU64(rapidjson::Value& document, const char* key, u64& value);
bool getS64(rapidjson::Value& document, const char* key, s64& value);
bool getBool(rapidjson::Value& document, const char* key, bool& value);
bool getFloat(rapidjson::Value& document, const char* key, float& value);
} // namespace oot::json