123456789module juptune.data.buffer;
bool tryIntegral(
IntT,
Endian endian,
bool advanceCursor
)(
IntT result
);
Attempts to read an integral type from the buffer; automatically converting it from big/little endian into the native endianess, and then optionally advances the cursor.
If the given IntTis only a byte long, then the endian parameter is ignored.
IntTcan be anything supported by std.traits.isIntegral, this includes numeric enums.
Generally, you should use the read*and peek*aliases instead of this function directly.
If you're in @gc code, then you can also use the enforce*functions instead.
trueif there's enough bytes to read in the value, falseotherwise.