8class ReadOnlyBinaryStream {
12 ::std::string mOwnedBuffer;
13 ::std::string_view mView;
18 ReadOnlyBinaryStream(::std::string_view
buffer,
bool copyBuffer)
21 mHasOverflowed(
false) {
23 mOwnedBuffer = std::string(
buffer);
31 virtual ~ReadOnlyBinaryStream();
33 virtual ::Bedrock::Result<void> read(
void* target, uint64 num);
39 MCAPI
explicit ReadOnlyBinaryStream(::std::string&&
buffer);
41 MCAPI
bool canReadBool()
const;
43 MCAPI ::Bedrock::Result<void> ensureReadCompleted()
const;
45 MCAPI ::Bedrock::Result<bool> getBool();
47 MCAPI ::Bedrock::Result<uchar> getByte();
49 MCAPI ::Bedrock::Result<double> getDouble();
51 MCAPI ::Bedrock::Result<float> getFloat();
55 MCAPI ::Bedrock::Result<int> getSignedBigEndianInt();
57 MCAPI ::Bedrock::Result<schar> getSignedByte();
59 MCAPI ::Bedrock::Result<int> getSignedInt();
61 MCAPI ::Bedrock::Result<int64> getSignedInt64();
63 MCAPI ::Bedrock::Result<short> getSignedShort();
65 MCAPI ::Bedrock::Result<::std::string> getString(uint64 maxLength);
67 MCAPI ::Bedrock::Result<void> getString(::std::string& outStringStream, uint64 maxLength);
69 MCAPI ::Bedrock::Result<uchar> getUnsignedChar();
71 MCAPI ::Bedrock::Result<uint> getUnsignedInt();
73 MCAPI ::Bedrock::Result<uint64> getUnsignedInt64();
75 MCAPI ::Bedrock::Result<ushort> getUnsignedShort();
77 MCAPI ::Bedrock::Result<uint> getUnsignedVarInt();
79 MCAPI ::Bedrock::Result<uint64> getUnsignedVarInt64();
81 MCAPI ::Bedrock::Result<int> getVarInt();
83 MCAPI ::Bedrock::Result<int64> getVarInt64();
85 MCFOLD
bool hasOverflowed()
const;
91 MCAPI
void* $ctor(::std::string&&
buffer);
93 MCAPI
void* $ctor(::std::string_view
buffer,
bool copyBuffer);
105 MCAPI ::Bedrock::Result<void> $read(
void* target, uint64 num);