LeviLamina
Loading...
Searching...
No Matches
ReadOnlyBinaryStream.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/platform/Result.h"
7
8class ReadOnlyBinaryStream {
9public:
10 // member variables
11 // NOLINTBEGIN
12 ::std::string mOwnedBuffer;
13 ::std::string_view mView;
14 uint64 mReadPointer;
15 bool mHasOverflowed;
16 // NOLINTEND
17
18 ReadOnlyBinaryStream(::std::string_view buffer, bool copyBuffer)
19 : mView(buffer),
20 mReadPointer(0),
21 mHasOverflowed(false) {
22 if (copyBuffer) {
23 mOwnedBuffer = std::string(buffer);
24 mView = mOwnedBuffer;
25 }
26 }
27
28public:
29 // virtual functions
30 // NOLINTBEGIN
31 virtual ~ReadOnlyBinaryStream();
32
33 virtual ::Bedrock::Result<void> read(void* target, uint64 num);
34 // NOLINTEND
35
36public:
37 // member functions
38 // NOLINTBEGIN
39 MCAPI ::Bedrock::Result<void> ensureReadCompleted() const;
40
41 MCAPI ::Bedrock::Result<bool> getBool();
42
43 MCAPI ::Bedrock::Result<uchar> getByte();
44
45 MCAPI ::Bedrock::Result<double> getDouble();
46
47 MCAPI ::Bedrock::Result<float> getFloat();
48
49 MCAPI ::Bedrock::Result<void> getRawBytes(::buffer_span_mut<uchar> outBuffer, uint64 length);
50
51 MCAPI ::Bedrock::Result<int> getSignedBigEndianInt();
52
53 MCAPI ::Bedrock::Result<int> getSignedInt();
54
55 MCAPI ::Bedrock::Result<int64> getSignedInt64();
56
57 MCAPI ::Bedrock::Result<short> getSignedShort();
58
59 MCAPI ::Bedrock::Result<::std::string> getString(uint64 maxLength);
60
61 MCAPI ::Bedrock::Result<void> getString(::std::string& outStringStream, uint64 maxLength);
62
63 MCAPI ::Bedrock::Result<uchar> getUnsignedChar();
64
65 MCAPI ::Bedrock::Result<uint> getUnsignedInt();
66
67 MCAPI ::Bedrock::Result<uint64> getUnsignedInt64();
68
69 MCAPI ::Bedrock::Result<ushort> getUnsignedShort();
70
71 MCAPI ::Bedrock::Result<uint> getUnsignedVarInt();
72
73 MCAPI ::Bedrock::Result<uint64> getUnsignedVarInt64();
74
75 MCAPI ::Bedrock::Result<int> getVarInt();
76
77 MCAPI ::Bedrock::Result<int64> getVarInt64();
78 // NOLINTEND
79
80public:
81 // constructor thunks
82 // NOLINTBEGIN
83 MCAPI_C void* $ctor(::std::string_view buffer, bool copyBuffer);
84 // NOLINTEND
85
86public:
87 // destructor thunk
88 // NOLINTBEGIN
89 MCFOLD void $dtor();
90 // NOLINTEND
91
92public:
93 // virtual function thunks
94 // NOLINTBEGIN
95 MCAPI ::Bedrock::Result<void> $read(void* target, uint64 num);
96
97
98 // NOLINTEND
99
100public:
101 // vftables
102 // NOLINTBEGIN
103 MCNAPI static void** $vftable();
104 // NOLINTEND
105};
static MCAPI void ** $vftable()
Definition _HeaderOutputPredefine.h:238
Definition buffer.h:5