Sha256: d57273377104ef9347b32915e7f5c82dcf5dce129889df847885e2f6ec2a6e9e
Contents?: true
Size: 613 Bytes
Versions: 3
Compression:
Stored size: 613 Bytes
Contents
require 'gir_ffi/class_base' module GirFFI # Base class for generated classes representing GLib structs. class StructBase < ClassBase extend FFI::DataConverter def self.native_type FFI::Type::Struct.new(self::Struct) end def self.to_ffitype self end def self.to_native value, _context value.struct end def self.get_value_from_pointer pointer pointer.to_ptr end def self.copy_value_to_pointer value, pointer, offset = 0 size = self::Struct.size pointer.put_bytes offset, value.to_ptr.read_bytes(size), 0, size end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gir_ffi-0.7.8 | lib/gir_ffi/struct_base.rb |
gir_ffi-0.7.7 | lib/gir_ffi/struct_base.rb |
gir_ffi-0.7.6 | lib/gir_ffi/struct_base.rb |