Class: Ronin::Support::Binary::CTypes::UIntType

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

Overview

Base class for all unsigned integer types.

Direct Known Subclasses

UInt16Type, UInt32Type, UInt64Type, UInt8Type

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) ⇒ UIntType

Initializes the unsigned integer type.

Parameters:

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for Type#initialize.

Options Hash (**kwargs):

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

    The endian-ness of the unsigned integer type.

  • :pack_string (String)

    The String for Array#pack or String#unpack.



42
43
44
# File 'lib/ronin/support/binary/ctypes/uint_type.rb', line 42

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

Instance Method Details

#uninitialized_value0

Returns an uninitialized unsigned integer value.

Returns:

  • (0)


51
52
53
# File 'lib/ronin/support/binary/ctypes/uint_type.rb', line 51

def uninitialized_value
  0
end