LeviLamina
Loading...
Searching...
No Matches
BinaryStream.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/network/serialize/serialize.h"
5
6// auto generated inclusion list
7#include "mc/deps/core/utility/ReadOnlyBinaryStream.h"
8#include "mc/platform/brstd/function_ref.h"
9
11public:
12 // BinaryStream inner types declare
13 // clang-format off
14 struct ConditionBlock;
15 // clang-format on
16
17 // BinaryStream inner types define
19 public:
20 // member variables
21 // NOLINTBEGIN
22 ::ll::TypedStorage<1, 1, bool> controlValue;
23 ::ll::TypedStorage<8, 16, ::brstd::function_ref<void(::BinaryStream&)>> writeCondition;
24 ::ll::TypedStorage<8, 8, char const*> docFieldName;
25 // NOLINTEND
26 };
27
28public:
29 template <typename T>
30 inline void writeType(T const& x, char const* = nullptr, char const* = nullptr) {
31 serialize<T>::write(x, *this);
32 }
33
34 MCTAPI void writeType(class BlockPos const&, char const*, char const*);
35 MCTAPI void writeType(class Vec3 const&, char const*, char const*);
36 MCTAPI void writeType(class MoveActorAbsoluteData const&, char const*, char const*);
37 MCTAPI void writeType(class BaseGameVersion const&, char const*, char const*);
38 MCTAPI void writeType(struct ActorLink const&, char const*, char const*);
39 MCTAPI void writeType(struct GameRulesChangedPacketData const&, char const*, char const*);
40
41 BinaryStream() : ReadOnlyBinaryStream({}, true), mBuffer(mOwnedBuffer) {}
42 BinaryStream(std::string& buffer) : ReadOnlyBinaryStream(buffer, false), mBuffer(buffer) {}
43
44public:
45 // member variables
46 // NOLINTBEGIN
47 ::std::string& mBuffer;
48 // NOLINTEND
49
50public:
51 // prevent constructor by default
52 BinaryStream& operator=(BinaryStream const&);
54
55public:
56 // virtual functions
57 // NOLINTBEGIN
58 // vIndex: 0
59 virtual ~BinaryStream() /*override*/;
60
61 // vIndex: 2
62 virtual void writeBool(bool value, char const* docFieldName, char const* docFieldNotes);
63
64 // vIndex: 3
65 virtual void writeByte(uchar value, char const* docFieldName, char const* docFieldNotes);
66
67 // vIndex: 4
68 virtual void writeUnsignedShort(ushort value, char const* docFieldName, char const* docFieldNotes);
69
70 // vIndex: 5
71 virtual void writeSignedShort(short value, char const* docFieldName, char const* docFieldNotes);
72
73 // vIndex: 6
74 virtual void writeUnsignedInt(uint value, char const* docFieldName, char const* docFieldNotes);
75
76 // vIndex: 7
77 virtual void writeSignedBigEndianInt(int value, char const* docFieldName, char const* docFieldNotes);
78
79 // vIndex: 8
80 virtual void writeSignedInt(int value, char const* docFieldName, char const* docFieldNotes);
81
82 // vIndex: 9
83 virtual void writeUnsignedInt64(uint64 value, char const* docFieldName, char const* docFieldNotes);
84
85 // vIndex: 10
86 virtual void writeSignedInt64(int64 value, char const* docFieldName, char const* docFieldNotes);
87
88 // vIndex: 11
89 virtual void writeUnsignedVarInt(uint uvalue, char const* docFieldName, char const* docFieldNotes);
90
91 // vIndex: 12
92 virtual void writeUnsignedVarInt64(uint64 uvalue, char const* docFieldName, char const* docFieldNotes);
93
94 // vIndex: 13
95 virtual void writeVarInt(int value, char const* docFieldName, char const* docFieldNotes);
96
97 // vIndex: 14
98 virtual void writeVarInt64(int64 value, char const* docFieldName, char const* docFieldNotes);
99
100 // vIndex: 15
101 virtual void writeDouble(double value, char const* docFieldName, char const* docFieldNotes);
102
103 // vIndex: 16
104 virtual void writeFloat(float value, char const* docFieldName, char const* docFieldNotes);
105
106 // vIndex: 17
107 virtual void writeFixedFloat(float value, char const* docFieldName, char const* docFieldNotes, double size);
108
109 // vIndex: 18
110 virtual void writeNormalizedFloat(float value, char const* docFieldName, char const* docFieldNotes);
111
112 // vIndex: 19
113 virtual void writeString(::std::string_view value, char const* docFieldName, char const* docFieldNotes);
114
115 // vIndex: 20
116 virtual void writeIf(
117 bool controlValue,
118 char const* docFieldName,
119 ::brstd::function_ref<void(::BinaryStream&)> const& writeIfTrue,
120 ::std::optional<::brstd::function_ref<void(::BinaryStream&)>> const& writeIfFalse
121 );
122
123 // vIndex: 21
124 virtual void writeConditional(
125 char const* docFieldName,
126 ::std::initializer_list<::BinaryStream::ConditionBlock>&& conditions,
127 ::std::optional<::brstd::function_ref<void(::BinaryStream&)>> const& writeDefault
128 );
129
130 // vIndex: 23
131 virtual void branchingWrite_DEPRECATED(
132 ::std::function<void(::BinaryStream&, int)>&& branchWriter,
133 int controlValue,
134 int docRangeBegin,
135 int docRangeEnd,
136 char const* controlDocFieldName
137 );
138
139 // vIndex: 22
140 virtual void branchingWrite_DEPRECATED(
141 ::std::function<void(::BinaryStream&, int)>&& branchWriter,
142 int controlValue,
143 ::std::vector<int> const& docControlSet,
144 char const* controlDocFieldName
145 );
146
147 // vIndex: 24
148 virtual void _writeArray(
149 ::std::function<void(::BinaryStream&)>&& sizeWriter,
150 ::std::function<void(::BinaryStream&)>&& writer,
151 char const* docFieldName,
152 char const* docFieldNotes
153 );
154 // NOLINTEND
155
156public:
157 // member functions
158 // NOLINTBEGIN
159 MCAPI BinaryStream(::std::string& buffer, bool copyBuffer);
160 // NOLINTEND
161
162public:
163 // constructor thunks
164 // NOLINTBEGIN
165 MCAPI void* $ctor(::std::string& buffer, bool copyBuffer);
166 // NOLINTEND
167
168public:
169 // destructor thunk
170 // NOLINTBEGIN
171 MCFOLD void $dtor();
172 // NOLINTEND
173
174public:
175 // virtual function thunks
176 // NOLINTBEGIN
177 MCAPI void $writeBool(bool value, char const* docFieldName, char const* docFieldNotes);
178
179 MCAPI void $writeByte(uchar value, char const* docFieldName, char const* docFieldNotes);
180
181 MCFOLD void $writeUnsignedShort(ushort value, char const* docFieldName, char const* docFieldNotes);
182
183 MCFOLD void $writeSignedShort(short value, char const* docFieldName, char const* docFieldNotes);
184
185 MCFOLD void $writeUnsignedInt(uint value, char const* docFieldName, char const* docFieldNotes);
186
187 MCAPI void $writeSignedBigEndianInt(int value, char const* docFieldName, char const* docFieldNotes);
188
189 MCFOLD void $writeSignedInt(int value, char const* docFieldName, char const* docFieldNotes);
190
191 MCFOLD void $writeUnsignedInt64(uint64 value, char const* docFieldName, char const* docFieldNotes);
192
193 MCFOLD void $writeSignedInt64(int64 value, char const* docFieldName, char const* docFieldNotes);
194
195 MCAPI void $writeUnsignedVarInt(uint uvalue, char const* docFieldName, char const* docFieldNotes);
196
197 MCAPI void $writeUnsignedVarInt64(uint64 uvalue, char const* docFieldName, char const* docFieldNotes);
198
199 MCAPI void $writeVarInt(int value, char const* docFieldName, char const* docFieldNotes);
200
201 MCAPI void $writeVarInt64(int64 value, char const* docFieldName, char const* docFieldNotes);
202
203 MCAPI void $writeDouble(double value, char const* docFieldName, char const* docFieldNotes);
204
205 MCAPI void $writeFloat(float value, char const* docFieldName, char const* docFieldNotes);
206
207 MCAPI void $writeFixedFloat(float value, char const* docFieldName, char const* docFieldNotes, double size);
208
209 MCAPI void $writeNormalizedFloat(float value, char const* docFieldName, char const* docFieldNotes);
210
211 MCAPI void $writeString(::std::string_view value, char const* docFieldName, char const* docFieldNotes);
212
213 MCAPI void $writeIf(
214 bool controlValue,
215 char const* docFieldName,
216 ::brstd::function_ref<void(::BinaryStream&)> const& writeIfTrue,
217 ::std::optional<::brstd::function_ref<void(::BinaryStream&)>> const& writeIfFalse
218 );
219
220 MCAPI void $writeConditional(
221 char const* docFieldName,
222 ::std::initializer_list<::BinaryStream::ConditionBlock>&& conditions,
223 ::std::optional<::brstd::function_ref<void(::BinaryStream&)>> const& writeDefault
224 );
225
226 MCFOLD void $branchingWrite_DEPRECATED(
227 ::std::function<void(::BinaryStream&, int)>&& branchWriter,
228 int controlValue,
229 int docRangeBegin,
230 int docRangeEnd,
231 char const* controlDocFieldName
232 );
233
234 MCFOLD void $branchingWrite_DEPRECATED(
235 ::std::function<void(::BinaryStream&, int)>&& branchWriter,
236 int controlValue,
237 ::std::vector<int> const& docControlSet,
238 char const* controlDocFieldName
239 );
240
241 MCAPI void $_writeArray(
242 ::std::function<void(::BinaryStream&)>&& sizeWriter,
243 ::std::function<void(::BinaryStream&)>&& writer,
244 char const* docFieldName,
245 char const* docFieldNotes
246 );
247 // NOLINTEND
248
249public:
250 // vftables
251 // NOLINTBEGIN
252 MCNAPI static void** $vftable();
253 // NOLINTEND
254};
Definition BaseGameVersion.h:8
Definition BinaryStream.h:10
static MCAPI void ** $vftable()
Definition BlockPos.h:17
Definition GameRulesChangedPacketData.h:10
Definition MoveActorAbsoluteData.h:15
Definition ReadOnlyBinaryStream.h:8
Definition Vec3.h:10
Definition function_ref.h:60
Definition BinaryStream.h:18
Definition buffer.h:5
Definition serialize.h:11