Class: FFIAdditions::Struct
- Inherits:
-
Object
- Object
- FFIAdditions::Struct
- Defined in:
- lib/win-ffi/core/struct.rb
Direct Known Subclasses
WinFFI::GUID, WinFFI::Kernel32::ULARGE_INTEGER, WinFFI::LARGE_INTEGER, WinFFI::LUID, WinFFI::OSVERSIONINFOEX, WinFFI::POINT, WinFFI::POINTS, WinFFI::RECT, WinFFI::SECURITY_ATTRIBUTES, WinFFI::SIZE, WinFFI::SIZEL
Class Method Summary collapse
Class Method Details
.encoded_setter(name) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/win-ffi/core/struct.rb', line 7 def self.encoded_setter(name) define_method("#{name}=", ->(string) do if WinFFI.encoding == 'A' (to_ptr + offset_of(name)).write_string(string) else (to_ptr + offset_of(name)).write_array_of_uint16(string.to_w.unpack('S*')) end end) end |