LeviLamina
Loading...
Searching...
No Matches
JsonHelpers.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7namespace Json { class Value; }
8// clang-format on
9
10namespace JsonHelpers {
11// functions
12// NOLINTBEGIN
13MCNAPI_C void addIntField(::Json::Value& rootValue, ::std::string const& fieldName, int const& value);
14
15MCNAPI_C void addStringField(::Json::Value& rootValue, ::std::string const& fieldName, ::std::string const& value);
16
17MCNAPI ::std::string getAsString(::Json::Value const& value, ::std::string_view defaultString);
18
19MCNAPI_C ::std::vector<::std::string> getAsStringArray(::Json::Value const& value);
20
21MCNAPI_C ::Json::Value const& getField(::Json::Value const& rootValue, ::std::string const& fieldName);
22
23MCNAPI_C ::Json::Value const& getFieldAsArray(::Json::Value const& rootValue, ::std::string const& fieldName);
24
25MCNAPI_C bool getFieldAsBool(::Json::Value const& rootValue, ::std::string const& fieldName, bool defaultBool);
26
27MCNAPI_C float getFieldAsFloat(::Json::Value const& rootValue, ::std::string const& fieldName, float defaultFloat);
28
29MCNAPI_C int getFieldAsInt(::Json::Value const& rootValue, ::std::string const& fieldName, int defaultInt);
30
31MCNAPI_C int64 getFieldAsInt64(::Json::Value const& rootValue, ::std::string const& fieldName, int64 defaultInt64);
32
33MCNAPI_C ::std::unordered_map<::std::string, ::std::string>
34getFieldAsLocDictionary(::Json::Value const& rootValue, ::std::string const& fieldName);
35
36MCNAPI_C ::std::unordered_map<::std::string, ::std::string>
37getFieldAsMapOfKeyValuePairs(::Json::Value const& rootValue, ::std::string const& fieldName);
38
39MCNAPI_C ::Json::Value const& getFieldAsObject(::Json::Value const& rootValue, ::std::string const& fieldName);
40
41MCNAPI_C ::std::vector<::std::reference_wrapper<::Json::Value const>>
42getFieldAsObjectArray(::Json::Value const& rootValue, ::std::string const& fieldName);
43
44MCNAPI_C ::std::string
45getFieldAsString(::Json::Value const& rootValue, ::std::string const& fieldName, ::std::string const& defaultString);
46
47MCNAPI_C ::std::vector<::std::string>
48getFieldAsStringArray(::Json::Value const& rootValue, ::std::string const& fieldName);
49
50MCNAPI_C uint64 getFieldAsUint64(::Json::Value const& rootValue, ::std::string const& fieldName, uint64 defaultUint64);
51
52MCNAPI_C bool hasField(::Json::Value const& rootValue, ::std::string const& fieldName);
53
54MCNAPI_C bool parseJson(::std::string const& str, ::Json::Value& root);
55
56MCNAPI_C ::std::string serialize(::Json::Value const& root);
57// NOLINTEND
58
59} // namespace JsonHelpers
Definition Value.h:16