class GObjectIntrospection::Strv
Represents a null-terminated array of strings. GLib
uses this construction, but does not provide any actual functions for this class.
Constants
- POINTER_SIZE
Public Class Methods
Source
# File lib/ffi-gobject_introspection/strv.rb, line 14 def initialize(ptr) @ptr = ptr end
Source
# File lib/ffi-gobject_introspection/strv.rb, line 30 def self.wrap(ptr) new ptr end
Public Instance Methods
Source
# File lib/ffi-gobject_introspection/strv.rb, line 22 def each offset = 0 while (ptr = fetch_ptr offset) offset += POINTER_SIZE yield ptr.read_string end end
Private Instance Methods
Source
# File lib/ffi-gobject_introspection/strv.rb, line 36 def fetch_ptr(offset) return if @ptr.null? ptr = @ptr.get_pointer offset ptr unless ptr.null? end