Class: Vigilem::Win32API::Types::PBYTE
- Inherits:
-
Object
- Object
- Vigilem::Win32API::Types::PBYTE
- Includes:
- FFI::ArrayPointerSync
- Defined in:
- lib/vigilem/win32_api/types.rb
Class Method Summary collapse
-
.array_type ⇒ Object
[Class || Symbol].
-
.from_native(value, ctx) ⇒ Integer
Converts the specified value from the native type.
-
.to_native(value, ctx) ⇒ ::FFI::Pointer
Converts the specified value to the native type.
Instance Method Summary collapse
-
#initialize(max_len_or_ptr, *init_values) ⇒ PBYTE
constructor
A new instance of PBYTE.
Constructor Details
#initialize(max_len_or_ptr, *init_values) ⇒ PBYTE
Returns a new instance of PBYTE.
59 60 61 |
# File 'lib/vigilem/win32_api/types.rb', line 59 def initialize(max_len_or_ptr, *init_values) initialize_array_sync(max_len_or_ptr, *init_values) end |
Class Method Details
.array_type ⇒ Object
- Class || Symbol
67 68 69 |
# File 'lib/vigilem/win32_api/types.rb', line 67 def array_type :BYTE end |
.from_native(value, ctx) ⇒ Integer
Converts the specified value from the native type.
73 74 75 |
# File 'lib/vigilem/win32_api/types.rb', line 73 def from_native(value, ctx) new(value) end |
.to_native(value, ctx) ⇒ ::FFI::Pointer
Converts the specified value to the native type.
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/vigilem/win32_api/types.rb', line 79 def to_native(value, ctx) case when value.is_a?(::FFI::Pointer) value when value.is_a?(self) value.ptr else raise "#{value} is an Unsupported Type" end end |