Class: Ronin::Support::Binary::CTypes::IntType

Inherits:
ScalarType show all
Defined in:
lib/ronin/support/binary/ctypes/int_type.rb

Overview

Base class for all signed integer types.

Direct Known Subclasses

Int16Type, Int32Type, Int64Type, Int8Type

Instance Attribute Summary

Attributes inherited from ScalarType

#alignment, #endian, #signed, #size

Attributes inherited from Type

#pack_string

Instance Method Summary collapse

Methods inherited from ScalarType

#align, #dequeue_value, #enqueue_value, #pack, #signed?, #unpack, #unsigned?

Methods inherited from Type

#[], #align, #alignment, #dequeue_value, #enqueue_value, #pack, #size, #unpack

Constructor Details

#initialize(**kwargs) ⇒ IntType

Initializes the integer type.

Parameters:

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for Type#initialize.

Options Hash (**kwargs):

  • :size (Integer)

    The size in bytes of the type.

  • :endian (:little, :big, nil)

    The endian-ness of the integer type.

  • :pack_string (String)

    The String for Array#pack or String#unpack.



45
46
47
# File 'lib/ronin/support/binary/ctypes/int_type.rb', line 45

def initialize(**kwargs)
  super(signed: true, **kwargs)
end

Instance Method Details

#uninitialized_value0

Returns an uninitialized signed integer value.

Returns:

  • (0)


54
55
56
# File 'lib/ronin/support/binary/ctypes/int_type.rb', line 54

def uninitialized_value
  0
end