abstract class BinData

Direct Known Subclasses

Defined in:

bindata.cr
bindata/exceptions.cr

Constant Summary

BIT_PARTS = [{more => {UInt8, nil}, tag_number => {UInt8, nil}}, {tag_class => {UInt8, nil}, constructed => {UInt8, nil}, tag_number => {UInt8, nil}}, {long => {UInt8, nil}, length_indicator => {UInt8, nil}}] of Nil
CUSTOM_TYPES = [BER, ASN1::BER, ASN1::BER::ExtendedIdentifier, ASN1::BER::Identifier, ASN1::BER::Length] of BinData.class
INDEX = [2]
RESERVED_NAMES = ["inherited", "included", "extended", "method_missing", "method_added", "finished"]

Class Method Summary

Macro Summary

Instance Method Summary

Class Method Detail

def self.bit_fields #

[View source]
def self.from_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) #

[View source]
def self.from_slice(bytes : Slice, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) #

[View source]

Macro Detail

macro __add_enum_field(name, cls, onlyif, verify, value, encoding, enum_type) #

this needs to be split out so we can resolve the enum base_type


[View source]
macro __build_methods__ #

[View source]
macro after_deserialize(&block) #

[View source]
macro array(name, length, onlyif = nil, verify = nil, value = nil) #

DEPRECATED Use #field instead


[View source]
macro before_serialize(&block) #

[View source]
macro bit_field(onlyif = nil, verify = nil, &block) #

[View source]
macro bits(size, name, value = nil, default = nil) #

[View source]
macro bool(name, default = false) #

[View source]
macro bytes(name, length, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro custom(name, onlyif = nil, verify = nil, value = nil) #

DEPRECATED Use #field instead


[View source]
macro endian(format) #

[View source]
macro enum_bits(size, name) #

DEPRECATED Use #bits instead


[View source]
macro enum_field(size, name, onlyif = nil, verify = nil, value = nil) #

DEPRECATED Use #field instead


[View source]
macro field(type_declaration, onlyif = nil, verify = nil, value = nil, length = nil, read_next = nil, encoding = nil, endian = nil) #

[View source]
macro float32(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro float32be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro float32le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro float64(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro float64be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro float64le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro group(name, onlyif = nil, verify = nil, value = nil, &block) #

}# Encapsulates a bunch of fields by creating a nested BinData class


[View source]
macro int128(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int128be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int128le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int16(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int16be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int16le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int32(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int32be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int32le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int64(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int64be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int64le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int8(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int8be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro int8le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro remaining_bytes(name, onlyif = nil, verify = nil, default = nil) #

[View source]
macro string(name, onlyif = nil, verify = nil, length = nil, value = nil, encoding = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint128(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint128be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint128le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint16(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint16be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint16le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint32(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint32be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint32le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint64(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint64be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint64le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint8(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint8be(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro uint8le(name, onlyif = nil, verify = nil, value = nil, default = nil) #

DEPRECATED Use #field instead


[View source]
macro variable_array(name, read_next, onlyif = nil, verify = nil, value = nil) #

DEPRECATED Use #field instead


[View source]

Instance Method Detail

def __format__ : IO::ByteFormat #

[View source]
def read(io : IO) : IO #

[View source]
def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) #

[View source]
def to_slice #

[View source]
def write(io : IO) #

[View source]