class FFIAdditions::Struct

Public Class Methods

encoded_setter(name) click to toggle source
# 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