NBT: Implement readInt8 helper closing #2

BodgeMaster-unfinished
BodgeMaster 2022-06-28 16:58:31 +02:00
parent 12e9533772
commit 4f760f44be
1 changed files with 2 additions and 2 deletions

View File

@ -44,8 +44,8 @@ int endianness_example() {
namespace NBT {
namespace helper {
ErrorOr<int8_t> readInt8(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) {
//TODO: implement
return ErrorOr<int8_t>((int8_t) 0);
if (dataSize<=currentPosition) return ErrorOr<int8_t>(true, ErrorCodes::RANGE_ERROR);
return ErrorOr<int8_t>((int8_t) data[currentPosition]);
}
ErrorOr<int16_t> readInt16(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) {