Functions for working with fixed-size structures.
struct | Functions for working with fixed-size structures. |
Enumerations | |
Type | The type of a field. |
Types | |
Field | Represents a field in a structure. |
Struct | Represents a complete structure as a sequence of fields. |
Functions | |
make | Make a Struct based on an array of Fields. |
field | Helper function to create Field records. |
packBool | Pack a Boolean value into a Bytes. |
packIEEE32 | Pack a Number value into a Bytes in IEEE 754 binary32 floating point format. |
packIEEE64 | Pack a Number value into a Bytes in IEEE 754 binary64 floating point format. |
packInt8 | Pack a signed Number into a Bytes of width 1. |
packInt16BE | Pack a signed Number into a Bytes of width 2. |
packInt16LE | Pack a signed Number into a Bytes of width 2. |
packInt32BE | Pack a signed Number into a Bytes of width 4. |
packInt32LE | Pack a signed Number into a Bytes of width 4. |
packInt64BE | Pack a signed Number into a Bytes of width 8. |
packInt64LE | Pack a signed Number into a Bytes of width 8. |
packUInt8 | Pack a signed Number into a Bytes of width 1. |
packUInt16BE | Pack an unsigned Number into a Bytes of width 2. |
packUInt16LE | Pack an unsigned Number into a Bytes of width 2. |
packUInt32BE | Pack an unsigned Number into a Bytes of width 4. |
packUInt32LE | Pack an unsigned Number into a Bytes of width 4. |
packUInt64BE | Pack an unsigned Number into a Bytes of width 8. |
packUInt64LE | Pack an unsigned Number into a Bytes of width 8. |
unpackBool | Unpack a Boolean from a Bytes. |
unpackIEEE32 | Unpack a Number from a Bytes in IEEE 754 binary32 floating point format. |
unpackIEEE64 | Unpack a Number from a Bytes in IEEE 754 binary64 floating point format. |
unpackInt8 | Unpack a Number from a Bytes of size 1. |
unpackInt16BE | Unpack a Number from a Bytes of size 2. |
unpackInt16LE | Unpack a Number from a Bytes of size 2. |
unpackInt32BE | Unpack a Number from a Bytes of size 4. |
unpackInt32LE | Unpack a Number from a Bytes of size 4. |
unpackInt64BE | Unpack a Number from a Bytes of size 8. |
unpackInt64LE | Unpack a Number from a Bytes of size 8. |
unpackUInt8 | Unpack a Number from a Bytes of size 1. |
unpackUInt16BE | Unpack a Number from a Bytes of size 2. |
unpackUInt16LE | Unpack a Number from a Bytes of size 2. |
unpackUInt32BE | Unpack a Number from a Bytes of size 4. |
unpackUInt32LE | Unpack a Number from a Bytes of size 4. |
unpackUInt64BE | Unpack a Number from a Bytes of size 8. |
unpackUInt64LE | Unpack a Number from a Bytes of size 8. |
Struct.pack | Convert a dictionary of values into a structure. |
Struct. | Return the total size of a structure definition. |
Struct. | Convert a structure into a dictionary of values. |
The type of a field.
FUNCTION field( name: String, type: Type, width: Number ): Field
Helper function to create Field records.
Make a Struct based on an array of Fields.
FUNCTION make( fields: Array<Field> ): Struct
Helper function to create Field records.
FUNCTION field( name: String, type: Type, width: Number ): Field
Pack a Boolean value into a Bytes.
FUNCTION packBool( b: Boolean ): Bytes
Pack a Number value into a Bytes in IEEE 754 binary32 floating point format.
DECLARE NATIVE FUNCTION packIEEE32( n: Number ): Bytes
Pack a Number value into a Bytes in IEEE 754 binary64 floating point format.
DECLARE NATIVE FUNCTION packIEEE64( n: Number ): Bytes
Pack a signed Number into a Bytes of width 1.
FUNCTION packInt8( n: Number ): Bytes
Pack a signed Number into a Bytes of width 2.
FUNCTION packInt16BE( n: Number ): Bytes
Pack a signed Number into a Bytes of width 2.
FUNCTION packInt16LE( n: Number ): Bytes
Pack a signed Number into a Bytes of width 4.
FUNCTION packInt32BE( n: Number ): Bytes
Pack a signed Number into a Bytes of width 4.
FUNCTION packInt32LE( n: Number ): Bytes
Pack a signed Number into a Bytes of width 8.
FUNCTION packInt64BE( n: Number ): Bytes
Pack a signed Number into a Bytes of width 8.
FUNCTION packInt64LE( n: Number ): Bytes
Pack a signed Number into a Bytes of width 1.
FUNCTION packUInt8( n: Number ): Bytes
Pack an unsigned Number into a Bytes of width 2.
FUNCTION packUInt16BE( n: Number ): Bytes
Pack an unsigned Number into a Bytes of width 2.
FUNCTION packUInt16LE( n: Number ): Bytes
Pack an unsigned Number into a Bytes of width 4.
FUNCTION packUInt32BE( n: Number ): Bytes
Pack an unsigned Number into a Bytes of width 4.
FUNCTION packUInt32LE( n: Number ): Bytes
Pack an unsigned Number into a Bytes of width 8.
FUNCTION packUInt64BE( n: Number ): Bytes
Pack an unsigned Number into a Bytes of width 8.
FUNCTION packUInt64LE( n: Number ): Bytes
Unpack a Boolean from a Bytes.
FUNCTION unpackBool( b: Bytes ): Boolean
Unpack a Number from a Bytes in IEEE 754 binary32 floating point format.
DECLARE NATIVE FUNCTION unpackIEEE32( b: Bytes ): Number
Unpack a Number from a Bytes in IEEE 754 binary64 floating point format.
DECLARE NATIVE FUNCTION unpackIEEE64( b: Bytes ): Number
Unpack a Number from a Bytes of size 1.
FUNCTION unpackInt8( b: Bytes ): Number
Unpack a Number from a Bytes of size 2.
FUNCTION unpackInt16BE( b: Bytes ): Number
Unpack a Number from a Bytes of size 2.
FUNCTION unpackInt16LE( b: Bytes ): Number
Unpack a Number from a Bytes of size 4.
FUNCTION unpackInt32BE( b: Bytes ): Number
Unpack a Number from a Bytes of size 4.
FUNCTION unpackInt32LE( b: Bytes ): Number
Unpack a Number from a Bytes of size 8.
FUNCTION unpackInt64BE( b: Bytes ): Number
Unpack a Number from a Bytes of size 8.
FUNCTION unpackInt64LE( b: Bytes ): Number
Unpack a Number from a Bytes of size 1.
FUNCTION unpackUInt8( b: Bytes ): Number
Unpack a Number from a Bytes of size 2.
FUNCTION unpackUInt16BE( b: Bytes ): Number
Unpack a Number from a Bytes of size 2.
FUNCTION unpackUInt16LE( b: Bytes ): Number
Unpack a Number from a Bytes of size 4.
FUNCTION unpackUInt32BE( b: Bytes ): Number
Unpack a Number from a Bytes of size 4.
FUNCTION unpackUInt32LE( b: Bytes ): Number
Unpack a Number from a Bytes of size 8.
FUNCTION unpackUInt64BE( b: Bytes ): Number
Unpack a Number from a Bytes of size 8.
FUNCTION unpackUInt64LE( b: Bytes ): Number
Convert a dictionary of values into a structure.
FUNCTION Struct.pack( self: Struct, values: Dictionary<Object> ): Bytes
Return the total size of a structure definition.
FUNCTION Struct.sizeof( self: Struct ): Number
Convert a structure into a dictionary of values.
FUNCTION Struct.unpack( self: Struct, data: Bytes ): Dictionary<Object>