Class: Win32::CaptureIE::FFI::PrimitiveType
- Defined in:
- lib/win32/capture_ie/ffi/struct.rb
Overview
:nodoc:
Constant Summary collapse
- BASE_TYPES =
{ :int8 => ["c", 1], :uint8 => ["C", 1], :int16 => ["s", 2], :uint16 => ["S", 2], :int32 => ["l", 4], :uint32 => ["L", 4], :float => ["f", 4], :double => ["d", 8], :string => ["p", 4], :pointer => ["P", 4], }
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(name, size = guess_size(name), format = guess_format(name)) ⇒ PrimitiveType
constructor
A new instance of PrimitiveType.
- #pack(value) ⇒ Object
Constructor Details
#initialize(name, size = guess_size(name), format = guess_format(name)) ⇒ PrimitiveType
Returns a new instance of PrimitiveType.
27 28 29 30 31 |
# File 'lib/win32/capture_ie/ffi/struct.rb', line 27 def initialize(name, size=guess_size(name), format=guess_format(name)) super(name) @size = size @format = format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
26 27 28 |
# File 'lib/win32/capture_ie/ffi/struct.rb', line 26 def format @format end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
26 27 28 |
# File 'lib/win32/capture_ie/ffi/struct.rb', line 26 def size @size end |
Instance Method Details
#pack(value) ⇒ Object
33 34 35 |
# File 'lib/win32/capture_ie/ffi/struct.rb', line 33 def pack(value) [value].pack(format) end |