3#include "mc/_HeaderOutputPredefine.h"
7namespace Json {
class Value; }
10namespace JsonHelpers {
14MCNAPI
void addBoolField(::Json::Value& rootValue, ::std::string
const& fieldName,
bool const& value);
16MCNAPI
void addFloatField(::Json::Value& rootValue, ::std::string
const& fieldName,
double const& value);
18MCNAPI
void addInt64Field(::Json::Value& rootValue, ::std::string
const& fieldName, int64
const& value);
20MCNAPI
void addIntField(::Json::Value& rootValue, ::std::string
const& fieldName,
int const& value);
22MCNAPI
void addObjectArrayField(
23 ::Json::Value& rootValue,
24 ::std::string
const& fieldName,
25 ::std::vector<::Json::Value>
const& objectArray
29MCNAPI
void addObjectField(::Json::Value& rootValue, ::std::string
const& fieldName, ::Json::Value
const&
object);
32MCNAPI
void addStringArrayField(
33 ::Json::Value& rootValue,
34 ::std::string
const& fieldName,
35 ::std::vector<::std::string>
const& stringArray
39MCNAPI
void addStringField(::Json::Value& rootValue, ::std::string
const& fieldName, ::std::string
const& value);
42MCNAPI
void addUint32Field(::Json::Value& rootValue, ::std::string
const& fieldName, uint
const& value);
45MCNAPI
void addUint64Field(::Json::Value& rootValue, ::std::string
const& fieldName, uint64
const& value);
48MCNAPI ::Json::Value
const& getAsArray(::Json::Value
const& value, ::Json::Value
const& defaultValue);
50MCNAPI
bool getAsBool(::Json::Value
const& value,
bool defaultBool);
52MCNAPI
int getAsInt(::Json::Value
const& value,
int defaultInt);
55MCNAPI ::std::string getAsString(::Json::Value
const& value, ::std::string_view defaultString);
58MCNAPI ::std::vector<::std::string> getAsStringArray(::Json::Value
const& value);
60MCNAPI uint getAsUint(::Json::Value
const& value, uint defaultUint);
63MCNAPI ::Json::Value
const& getField(::Json::Value
const& rootValue, ::std::string
const& fieldName);
66MCNAPI ::Json::Value
const& getFieldAsArray(::Json::Value
const& rootValue, ::std::string
const& fieldName);
69MCNAPI
bool getFieldAsBool(::Json::Value
const& rootValue, ::std::string
const& fieldName,
bool defaultBool);
72MCNAPI
float getFieldAsFloat(::Json::Value
const& rootValue, ::std::string
const& fieldName,
float defaultFloat);
74MCNAPI
int getFieldAsInt(::Json::Value
const& rootValue, ::std::string
const& fieldName,
int defaultInt);
76MCNAPI int64 getFieldAsInt64(::Json::Value
const& rootValue, ::std::string
const& fieldName, int64 defaultInt64);
78MCNAPI ::std::unordered_map<::std::string, ::std::string>
79getFieldAsLocDictionary(::Json::Value
const& rootValue, ::std::string
const& fieldName);
81MCNAPI ::std::unordered_map<::std::string, ::std::string>
82getFieldAsMapOfKeyValuePairs(::Json::Value
const& rootValue, ::std::string
const& fieldName);
85MCNAPI ::Json::Value
const& getFieldAsObject(::Json::Value
const& rootValue, ::std::string
const& fieldName);
88MCNAPI ::std::vector<::std::reference_wrapper<::Json::Value const>>
89getFieldAsObjectArray(::Json::Value
const& rootValue, ::std::string
const& fieldName);
91MCNAPI ::std::optional<uint64> getFieldAsOptUint64(::Json::Value
const& rootValue, ::std::string
const& fieldName);
95getFieldAsString(::Json::Value
const& rootValue, ::std::string
const& fieldName, ::std::string
const& defaultString);
98MCNAPI ::std::vector<::std::string>
99getFieldAsStringArray(::Json::Value
const& rootValue, ::std::string
const& fieldName);
101MCNAPI uint getFieldAsUint(::Json::Value
const& rootValue, ::std::string
const& fieldName, uint defaultUint);
103MCNAPI uint64 getFieldAsUint64(::Json::Value
const& rootValue, ::std::string
const& fieldName, uint64 defaultUint64);
105MCNAPI
bool hasField(::Json::Value
const& rootValue, ::std::string
const& fieldName);
108MCNAPI
bool parseJson(::std::string
const& str, ::Json::Value& root);
110MCNAPI ::std::string serialize(::Json::Value
const& root);
115MCNAPI ::Json::Value
const& EMPTY_JSON();