Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions MemoryReader.tryIntegral

1
2
3
4
5
6
7
8
9
module juptune.data.buffer;

bool tryIntegral(
    IntT, 
    Endian endian, 
    bool advanceCursor
)(
    IntT result
);

Documentation

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.

Notes

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.

Params

Returns

trueif there's enough bytes to read in the value, falseotherwise.