class GirFFI::Boolean

Class representing a boolean (natively, an int).

Constants

FROM_NATIVE
TO_NATIVE

Public Class Methods

copy_value_to_pointer(value, pointer, offset = 0) click to toggle source
# File lib/gir_ffi/boolean.rb, line 26
def self.copy_value_to_pointer(value, pointer, offset = 0)
  pointer.put_int offset, to_native(value, nil)
end
from_native(value, _context) click to toggle source
# File lib/gir_ffi/boolean.rb, line 14
def self.from_native(value, _context)
  FROM_NATIVE.fetch(value)
end
get_value_from_pointer(pointer, offset) click to toggle source
# File lib/gir_ffi/boolean.rb, line 30
def self.get_value_from_pointer(pointer, offset)
  from_native pointer.get_int(offset), nil
end
size() click to toggle source
# File lib/gir_ffi/boolean.rb, line 22
def self.size
  FFI.type_size FFI::Type::INT
end
to_native(value, _context) click to toggle source
# File lib/gir_ffi/boolean.rb, line 18
def self.to_native(value, _context)
  TO_NATIVE.fetch(value ? true : false)
end