Ground.Attr
Attr
is module for getting AttrSpec.t
of ground types.
All the functions in this module take an id
parameter. This is used for the id
field of the generated attribute in the produced Kaitai Struct file. E.g., float ~id:"foo"
generates the attribute
- id: foo
type: f8
val bool : id:string -> Kaitai.Types.AttrSpec.t
bool ~id
is an AttrSpec.t
definition of bool ground type.
val uint8 : id:string -> Kaitai.Types.AttrSpec.t
uint8 ~id
is an AttrSpec.t
definition of 8-bit unsigned integer.
val int8 : id:string -> Kaitai.Types.AttrSpec.t
int8 ~id
is an AttrSpec.t
definition of 8-bit signed integer.
val uint16 :
id:string ->
endian:Data_encoding__TzEndian.endianness ->
Kaitai.Types.AttrSpec.t
uint16 ~id ~endian
is an AttrSpec.t
definition of 16-bit unsigned integer in endian
ness.
val int16 :
id:string ->
endian:Data_encoding__TzEndian.endianness ->
Kaitai.Types.AttrSpec.t
int16 ~id
is an AttrSpec.t
definition of 16-bit signed integer in endian
ness.
val int32 :
id:string ->
endian:Data_encoding__TzEndian.endianness ->
Kaitai.Types.AttrSpec.t
int32 ~id
is an AttrSpec.t
definition of 32-bit signed integer in endian
ness.
val int64 :
id:string ->
endian:Data_encoding__TzEndian.endianness ->
Kaitai.Types.AttrSpec.t
int64 ~id
is an AttrSpec.t
definition of 64-bit signed integer in endian
ness.
val int31 :
id:string ->
endian:Data_encoding__TzEndian.endianness ->
Kaitai.Types.AttrSpec.t
int31 ~id
is an AttrSpec.t
definition of 31-bit signed integer in endian
ness. For more about this type see Data_encoding.int31
.
val uint30 :
id:string ->
endian:Data_encoding__TzEndian.endianness ->
Kaitai.Types.AttrSpec.t
uint30 ~id
is an AttrSpec.t
definition of 30-bit unsigned integer in endian
ness. For more about this type see Data_encoding.int31
.
val float : id:string -> Kaitai.Types.AttrSpec.t
float ~id
is an AttrSpec.t
definition of 64-bit float.
type byte_size =
| Fixed of int
Fixed known size, makes size: <int>
in kaitai
| Dynamic8
Dynamic size header stored in a uint8
| Dynamic16
Dynamic size header stored in a uint16
| Dynamic30
Dynamic size header stored in a uint30
| Variable
Unknown size (until end of stream), makes size-eos: true
in kaitai
byte_size
is a description of the different kinds of sizing that bytes (and strings) can have in data-encoding.
val bytes : id:string -> byte_size -> Kaitai.Types.AttrSpec.t
bytes
is an AttrSpec.t
definition of Data_encoding.bytes
. See byte_size
for details about this parameter.
val string : id:string -> byte_size -> Kaitai.Types.AttrSpec.t
string
is an AttrSpec.t
definition of Data_encoding.string
. See bytes
for detail.
val n : id:string -> Kaitai.Types.AttrSpec.t
n
is an AttrSpec.t
definition of Data_encoding.n
.
val z : id:string -> Kaitai.Types.AttrSpec.t
z
is an AttrSpec.t
definition of Data_encoding.z
.
val binary_length_kind :
id:string ->
[ `N | `Uint8 | `Uint16 | `Uint30 ] ->
Kaitai.Types.AttrSpec.t
binary_length_kind ~id k
is an AttrSpec.t
definition for the Data_encoding__Binary_length.length
type.