LeviLamina
Loading...
Searching...
No Matches
JsonUtil.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/debug/log/LogArea.h"
7#include "mc/world/item/ItemColor.h"
8#include "mc/world/level/block/BannerBlockType.h"
9
10// auto generated forward declare list
11// clang-format off
12class HashedString;
13class SemVersion;
14class Vec2;
15class Vec3;
16namespace Json { class Value; }
17// clang-format on
18
19namespace JsonUtil {
20// functions
21// NOLINTBEGIN
22MCAPI void LogMissingChildSchemaOption(
23 ::LogArea area,
24 ::Json::Value const& node,
25 ::std::string const& missingName,
26 ::std::string const& foundNodesStr,
27 ::std::string const& optionsStr
28);
29
30MCAPI void LogUnknownChildSchemaOption(::std::string const& childName, ::LogArea area, ::Json::Value const& childValue);
31
32MCAPI void eraseSchema(::HashedString const& name, ::SemVersion const& version);
33
34MCAPI ::Json::Value& getMemberByCaseInsensitiveName(::Json::Value& node, ::std::string_view memberName);
35
36MCAPI ::Json::Value const&
37getMemberByCaseInsensitiveNameConst(::Json::Value const& node, ::std::string_view memberName);
38
39MCAPI bool parseBannerBlockType(::BannerBlockType& outType, ::Json::Value const& root);
40
41MCAPI bool
42parseItem(::std::string& outItemName, ::std::string& outItemNamespace, int& inoutItemAux, ::std::string_view inString);
43
44MCAPI bool parseItemColor(::ItemColor& outColor, ::Json::Value const& root);
45
46MCAPI bool parseRange(::Json::Value const& root, int& outMin, int& outMax);
47
48MCAPI bool parseVec2(::Vec2& outVec, ::Json::Value const& root);
49
50MCAPI bool parseVec3(::Vec3& outVec, ::Json::Value const& root);
51
52MCAPI void printJsonSchema_childNode(
53 ::std::string& output,
54 ::std::string const& indent,
55 ::HashedString const& typeName,
56 ::std::string const& memberName,
57 bool isRequired,
58 uint64 minChildren,
59 uint64 maxChildren,
60 ::std::string const& validValuesDocumentation,
61 ::std::string const& documentation
62);
63
64MCAPI void setDefaultPrettyName(::std::string& destPrettyName, ::HashedString const& sourceName);
65
66MCAPI void unregisterSchema(::HashedString const& name, ::SemVersion const& version);
67// NOLINTEND
68
69} // namespace JsonUtil
Definition HashedString.h:5
Definition Value.h:16
Definition SemVersion.h:15
Definition Vec2.h:5
Definition Vec3.h:10