LeviLamina
Loading...
Searching...
No Matches
ExprToken.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/ExprTokenType.h"
7#include "mc/client/gui/LiteralType.h"
8#include "mc/client/gui/OperatorType.h"
9#include "mc/client/gui/UiExpression.h"
10#include "mc/deps/json/Value.h"
11
12class ExprToken {
13public:
14 // ExprToken inner types define
15 enum class StringOption : int {
16 EvaluateAsExpression = 0,
17 KeepAsString = 1,
18 };
19
20public:
21 // member variables
22 // NOLINTBEGIN
23 ::ll::TypedStorage<1, 1, ::OperatorType> mOperatorType;
24 ::ll::TypedStorage<1, 1, ::LiteralType> mLiteralType;
25 ::ll::TypedStorage<1, 1, ::ExprTokenType> mTokenType;
26 ::ll::TypedStorage<8, 40, ::std::variant<::Json::Value, ::UiExpression>> mValue;
27 // NOLINTEND
28
29public:
30 // prevent constructor by default
31 ExprToken& operator=(ExprToken const&);
32 ExprToken(ExprToken const&);
33 ExprToken();
34
35public:
36 // member functions
37 // NOLINTBEGIN
38 MCAPI void _parseOperator(::std::string_view str);
39
40 MCAPI void _parseToken(::std::string_view str);
41
42 MCAPI ::std::string_view asString() const;
43
44 MCAPI ::ExprToken& operator=(::ExprToken&&);
45
46 MCAPI void replaceWith(::std::string_view fromStringView);
47 // NOLINTEND
48
49public:
50 // static functions
51 // NOLINTBEGIN
52 MCAPI static ::ExprToken createBoolToken(bool fromBool);
53
54 MCAPI static ::ExprToken createExpressionToken(::UiExpression expression);
55
56 MCAPI static ::ExprToken createFloatToken(float fromFloat);
57
58 MCAPI static ::ExprToken createIntToken(int fromInt);
59
60 MCAPI static ::ExprToken createStringToken(::std::string_view fromStr, ::ExprToken::StringOption evalString);
61 // NOLINTEND
62};
Definition ExprToken.h:5