Class: Ronin::Support::Binary::CTypes::CharType

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

Overview

Base class for all character types.

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

Initializes the character type.

Parameters:

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for Type#initialize.

Options Hash (**kwargs):

  • :signed (Boolean)

    Indicates whether the character type is signed or unsigned.

  • :pack_string (String)

    The String for Array#pack or String#unpack.



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

def initialize(**kwargs)
  super(size: 1, endian: nil, **kwargs)
end

Instance Method Details

#uninitialized_value''

The default uniniitalized char value.

Returns:

  • ('')


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

def uninitialized_value
  ''
end