12345678module juptune.data.buffer;
bool tryIntegral(
IntT,
Endian endian
)(
IntT value
);
Attempts to write an integral type into the buffer; automatically converting it from big/little endian into the native endianess, and then 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 write*aliases instead of this function directly.
If you're in @gc code, then you can also use the enforce*functions instead.
If there's not enough space in the buffer, then the buffer (and cursor) are left unmodified.
trueif there's enough space to write the value, falseotherwise.