2021-11-05 17:04:26 +03:00
{
"types" : {
2021-12-07 17:46:42 +03:00
"Str" : { "go_type" : "string" , "zero" : "\"\"" , "compare" : "a == b" , "range" : "a >= start && a <= end" } ,
"U" : { "go_type" : "uint64" , "zero" : "0" , "compare" : "a == b" , "range" : "a >= start && a <= end" } ,
"S" : { "go_type" : "int64" , "zero" : "0" , "compare" : "a == b" , "range" : "a >= start && a <= end" } ,
"F" : { "go_type" : "float64" , "map_from" : false , "zero" : "0" , "compare" : "a == b" , "range" : "a >= start && a <= end" } ,
2021-11-05 17:04:26 +03:00
"Bool" : { "go_type" : "bool" , "zero" : "false" , "compare" : "a == b" } ,
2022-01-24 23:21:48 +03:00
"BitBuf" : { "go_type" : "bitio.ReaderAtSeeker" , "zero" : "nil" , "map_from" : false , "map_to" : false } ,
2022-01-14 03:58:42 +03:00
"BigInt" : { "go_type" : "*big.Int" , "zero" : "nil" , "map_from" : false , "map_to" : false , "compare" : "a.Cmp(b) == 0" , "range" : "a.Cmp(start) >= 0 && a.Cmp(end) <= 0" }
2021-11-05 17:04:26 +03:00
} ,
"readers" : [
{
"name" : "Raw" ,
"type" : "BitBuf" ,
2021-11-17 18:13:10 +03:00
"variants" : [ { "name" : "Len" , "args" : "nBits" , "params" : "nBits int64" , "call" : "d.tryBitBuf(nBits)" , "doc" : "nBits raw bits" } ]
2021-11-05 17:04:26 +03:00
} ,
{
"name" : "Bool" ,
"type" : "Bool" ,
2021-11-17 18:13:10 +03:00
"variants" : [ { "name" : "" , "args" : "" , "params" : "" , "call" : "d.tryBool()" , "doc" : "1 bit boolean" } ]
2021-11-05 17:04:26 +03:00
} ,
{
"name" : "U" ,
"type" : "U" ,
"variants" : [
2022-01-14 03:58:42 +03:00
{ "name" : "" , "args" : "nBits" , "params" : "nBits int" , "call" : "d.tryUEndian(nBits, d.Endian)" , "doc" : "nBits bits unsigned integer in current endian" } ,
2021-11-05 17:04:26 +03:00
{
"name" : "E" ,
"args" : "nBits, endian" ,
2021-11-17 18:13:10 +03:00
"params" : "nBits int, endian Endian" ,
2022-01-14 03:58:42 +03:00
"call" : "d.tryUEndian(nBits, endian)" ,
2021-11-17 18:13:10 +03:00
"doc" : "nBits unsigned integer in specified endian"
2021-11-05 17:04:26 +03:00
} ,
2022-07-16 19:39:57 +03:00
{ "name" : "$n" , "range" : [ 1 , 65 ] , "args" : "" , "params" : "" , "call" : "d.tryUEndian($n, d.Endian)" , "doc" : "$n bit unsigned integer in current endian" } ,
{ "name" : "$nLE" , "range" : [ 8 , 65 ] , "args" : "" , "params" : "" , "call" : "d.tryUEndian($n, LittleEndian)" , "doc" : "$n bit unsigned integer in little-endian" } ,
{ "name" : "$nBE" , "range" : [ 8 , 65 ] , "args" : "" , "params" : "" , "call" : "d.tryUEndian($n, BigEndian)" , "doc" : "$n bit unsigned integer in big-endian" }
2021-11-05 17:04:26 +03:00
]
} ,
{
"name" : "S" ,
"type" : "S" ,
"variants" : [
2022-01-14 03:58:42 +03:00
{ "name" : "" , "args" : "nBits" , "params" : "nBits int" , "call" : "d.trySEndian(nBits, d.Endian)" , "doc" : "nBits bits signed integer in current endian" } ,
2021-11-05 17:04:26 +03:00
{
"name" : "E" ,
"args" : "nBits, endian" ,
2021-11-17 18:13:10 +03:00
"params" : "nBits int, endian Endian" ,
2022-01-14 03:58:42 +03:00
"call" : "d.trySEndian(nBits, endian)" ,
2021-11-17 18:13:10 +03:00
"doc" : "nBits signed integer in specified endian"
2021-11-05 17:04:26 +03:00
} ,
2022-07-16 19:39:57 +03:00
{ "name" : "$n" , "range" : [ 1 , 65 ] , "args" : "" , "params" : "" , "call" : "d.trySEndian($n, d.Endian)" , "doc" : "$n bit signed integer in current endian" } ,
{ "name" : "$nLE" , "range" : [ 8 , 65 ] , "args" : "" , "params" : "" , "call" : "d.trySEndian($n, LittleEndian)" , "doc" : "$n bit signed integer in little-endian" } ,
{ "name" : "$nBE" , "range" : [ 8 , 65 ] , "args" : "" , "params" : "" , "call" : "d.trySEndian($n, BigEndian)" , "doc" : "$n bit signed integer in big-endian" }
2022-01-14 03:58:42 +03:00
]
} ,
{
"name" : "UBigInt" ,
"type" : "BigInt" ,
"variants" : [
2022-01-24 23:21:48 +03:00
{
"name" : "" ,
"args" : "nBits" ,
"params" : "nBits int" ,
"call" : "d.tryBigIntEndianSign(nBits, d.Endian, false)" ,
"doc" : "nBits bits signed integer in current endian"
} ,
2022-01-14 03:58:42 +03:00
{
"name" : "E" ,
"args" : "nBits, endian" ,
"params" : "nBits int, endian Endian" ,
"call" : "d.tryBigIntEndianSign(nBits, endian, false)" ,
"doc" : "nBits signed integer in specified endian"
} ,
2022-01-24 23:21:48 +03:00
{
"name" : "LE" ,
"args" : "nBits" ,
"params" : "nBits int" ,
"call" : "d.tryBigIntEndianSign(nBits, LittleEndian, false)" ,
"doc" : "nBits bit signed integer in little-endian"
} ,
{
"name" : "BE" ,
"args" : "nBits" ,
"params" : "nBits int" ,
"call" : "d.tryBigIntEndianSign(nBits, BigEndian, false)" ,
"doc" : "nBits bit signed integer in big-endian"
}
2022-01-14 03:58:42 +03:00
]
} ,
{
"name" : "SBigInt" ,
"type" : "BigInt" ,
"variants" : [
2022-01-24 23:21:48 +03:00
{
"name" : "" ,
"args" : "nBits" ,
"params" : "nBits int" ,
"call" : "d.tryBigIntEndianSign(nBits, d.Endian, true)" ,
"doc" : "nBits bits signed integer in current endian"
} ,
2022-01-14 03:58:42 +03:00
{
"name" : "E" ,
"args" : "nBits, endian" ,
"params" : "nBits int, endian Endian" ,
"call" : "d.tryBigIntEndianSign(nBits, endian, true)" ,
"doc" : "nBits signed integer in specified endian"
} ,
2022-01-24 23:21:48 +03:00
{
"name" : "LE" ,
"args" : "nBits" ,
"params" : "nBits int" ,
"call" : "d.tryBigIntEndianSign(nBits, LittleEndian, true)" ,
"doc" : "nBits bit signed integer in little-endian"
} ,
2022-01-14 03:58:42 +03:00
{ "name" : "BE" , "args" : "nBits" , "params" : "nBits int" , "call" : "d.tryBigIntEndianSign(nBits, BigEndian, true)" , "doc" : "nBits bit signed integer in big-endian" }
2021-11-05 17:04:26 +03:00
]
} ,
{
"name" : "F" ,
"type" : "F" ,
"variants" : [
2022-01-14 03:58:42 +03:00
{ "name" : "" , "args" : "nBits" , "params" : "nBits int" , "call" : "d.tryFEndian(nBits, d.Endian)" , "doc" : "nBit IEEE 754 float in current endian" } ,
2022-01-24 23:21:48 +03:00
{
"name" : "E" ,
"args" : "nBits, endian" ,
"params" : "nBits int, endian Endian" ,
"call" : "d.tryFEndian(nBits, endian)" ,
"doc" : "nBit IEEE 754 float in specified endian"
} ,
2022-01-14 03:58:42 +03:00
{ "name" : "16" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(16, d.Endian)" , "doc" : "16 bit IEEE 754 float in current endian" } ,
{ "name" : "32" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(32, d.Endian)" , "doc" : "32 bit IEEE 754 float in current endian" } ,
{ "name" : "64" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(64, d.Endian)" , "doc" : "64 bit IEEE 754 float in current endian" } ,
{ "name" : "16LE" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(16, LittleEndian)" , "doc" : "16 bit IEEE 754 float in little-endian" } ,
{ "name" : "32LE" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(32, LittleEndian)" , "doc" : "32 bit IEEE 754 float in little-endian" } ,
{ "name" : "64LE" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(64, LittleEndian)" , "doc" : "64 bit IEEE 754 float in little-endian" } ,
{ "name" : "16BE" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(16, BigEndian)" , "doc" : "16 bit IEEE 754 float in big-endian" } ,
{ "name" : "32BE" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(32, BigEndian)" , "doc" : "32 bit IEEE 754 float in big-endian" } ,
{ "name" : "64BE" , "args" : "" , "params" : "" , "call" : "d.tryFEndian(64, BigEndian)" , "doc" : "64 bit IEEE 754 float in big-endian" }
2021-11-05 17:04:26 +03:00
]
} ,
{
"name" : "FP" ,
"type" : "F" ,
"variants" : [
{
"name" : "" ,
"args" : "nBits, fBits" ,
2021-11-19 17:24:53 +03:00
"params" : "nBits int, fBits int" ,
2022-01-14 03:58:42 +03:00
"call" : "d.tryFPEndian(nBits, fBits, d.Endian)" ,
2021-11-17 18:13:10 +03:00
"doc" : "nBits fixed-point number in current endian"
2021-11-05 17:04:26 +03:00
} ,
{
2021-11-17 18:13:10 +03:00
"name" : "E" ,
"args" : "nBits, fBits, endian" ,
2021-11-19 17:24:53 +03:00
"params" : "nBits int, fBits int, endian Endian" ,
2022-01-14 03:58:42 +03:00
"call" : "d.tryFPEndian(nBits, fBits, endian)" ,
2021-11-17 18:13:10 +03:00
"doc" : "nBits fixed-point number in specified endian"
2021-11-05 17:04:26 +03:00
} ,
2022-01-14 03:58:42 +03:00
{ "name" : "16" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(16, 8, d.Endian)" , "doc" : "16 bit fixed-point number in current endian" } ,
{ "name" : "32" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(32, 16, d.Endian)" , "doc" : "32 bit fixed-point number in current endian" } ,
{ "name" : "64" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(64, 32, d.Endian)" , "doc" : "64 bit fixed-point number in current endian" } ,
{ "name" : "16LE" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(16, 8, LittleEndian)" , "doc" : "16 bit fixed-point number in little-endian" } ,
{ "name" : "32LE" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(32, 16, LittleEndian)" , "doc" : "32 bit fixed-point number in little-endian" } ,
{ "name" : "64LE" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(64, 32, LittleEndian)" , "doc" : "64 bit fixed-point number in little-endian" } ,
{ "name" : "16BE" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(16, 8, BigEndian)" , "doc" : "16 bit fixed-point number in big-endian" } ,
{ "name" : "32BE" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(32, 16, BigEndian)" , "doc" : "32 bit fixed-point number in big-endian" } ,
{ "name" : "64BE" , "args" : "" , "params" : "" , "call" : "d.tryFPEndian(64, 32, BigEndian)" , "doc" : "64 bit fixed-point number in big-endian" }
2021-11-05 17:04:26 +03:00
]
} ,
{
"name" : "Unary" ,
"type" : "U" ,
2021-11-17 18:13:10 +03:00
"variants" : [ { "name" : "" , "args" : "ov" , "params" : "ov uint64" , "call" : "d.tryUnary(ov)" , "doc" : "unary integer using ov as \"one\" value" } ]
2021-11-05 17:04:26 +03:00
} ,
2022-08-20 13:05:07 +03:00
{
"name" : "ULEB128" ,
"type" : "U" ,
"variants" : [ { "name" : "" , "args" : "" , "params" : "" , "call" : "d.tryULEB128()" , "doc" : "unsigned LEB128 integer" } ]
} ,
{
"name" : "SLEB128" ,
"type" : "S" ,
"variants" : [ { "name" : "" , "args" : "" , "params" : "" , "call" : "d.trySLEB128()" , "doc" : "signed LEB128 integer" } ]
} ,
2021-11-05 17:04:26 +03:00
{
"type" : "Str" ,
"name" : "UTF" ,
"variants" : [
2021-11-17 18:13:10 +03:00
{ "name" : "8" , "args" : "nBytes" , "params" : "nBytes int" , "call" : "d.tryText(nBytes, UTF8BOM)" , "doc" : "nBytes bytes UTF8 string" } ,
2021-11-05 17:04:26 +03:00
{
"name" : "16" ,
"args" : "nBytes" ,
2021-11-17 18:13:10 +03:00
"params" : "nBytes int" ,
"call" : "d.tryText(nBytes, UTF16BOM)" ,
"doc" : "nBytes bytes UTF16 string, default big-endian and accepts BOM"
2021-11-05 17:04:26 +03:00
} ,
2021-11-17 18:13:10 +03:00
{ "name" : "16LE" , "args" : "nBytes" , "params" : "nBytes int" , "call" : "d.tryText(nBytes, UTF16LE)" , "doc" : "nBytes bytes UTF16 little-endian string" } ,
{ "name" : "16BE" , "args" : "nBytes" , "params" : "nBytes int" , "call" : "d.tryText(nBytes, UTF16BE)" , "doc" : "nBytes bytes UTF16 big-endian string" }
2021-11-05 17:04:26 +03:00
]
} ,
{
"name" : "UTF8ShortString" ,
"type" : "Str" ,
"variants" : [
2021-11-17 18:13:10 +03:00
{ "name" : "" , "args" : "" , "params" : "" , "call" : "d.tryTextLenPrefixed(8, -1, UTF8BOM)" , "doc" : "one byte length fixed UTF8 string" } ,
2021-11-05 17:04:26 +03:00
{
2021-11-17 18:13:10 +03:00
"name" : "FixedLen" ,
"args" : "fixedBytes" ,
"params" : "fixedBytes int" ,
"call" : "d.tryTextLenPrefixed(8, fixedBytes, UTF8BOM)" ,
"doc" : "fixedBytes bytes long one byte length prefixed UTF8 string"
2021-11-05 17:04:26 +03:00
}
]
} ,
{
2022-08-01 19:42:24 +03:00
"name" : "UTF" ,
2021-11-05 17:04:26 +03:00
"type" : "Str" ,
2022-08-01 19:42:24 +03:00
"variants" : [
{ "name" : "8Null" , "args" : "" , "params" : "" , "call" : "d.tryTextNull(1, UTF8BOM)" , "doc" : "null terminated UTF8 string" } ,
{ "name" : "16Null" , "args" : "" , "params" : "" , "call" : "d.tryTextNull(2, UTF16BOM)" , "doc" : "null terminated UTF16 string, default big-endian and accepts BOM" } ,
{ "name" : "16LENull" , "args" : "" , "params" : "" , "call" : "d.tryTextNull(2, UTF16LE)" , "doc" : "null terminated UTF16LE string" } ,
{ "name" : "16BENull" , "args" : "" , "params" : "" , "call" : "d.tryTextNull(2, UTF16BE)" , "doc" : "null terminated UTF16BE string" }
]
2021-11-05 17:04:26 +03:00
} ,
{
2021-11-17 18:13:10 +03:00
"name" : "UTF8NullFixedLen" ,
2021-11-05 17:04:26 +03:00
"type" : "Str" ,
"variants" : [
{
"name" : "" ,
"args" : "fixedBytes" ,
2021-11-17 18:13:10 +03:00
"params" : "fixedBytes int" ,
"call" : "d.tryTextNullLen(fixedBytes, UTF8BOM)" ,
"doc" : "fixedBytes bytes long null terminated UTF8 string"
2021-11-05 17:04:26 +03:00
}
]
}
]
}