Extra methods for GLib::Strv. The bulk is defined in `gir_ffi-base/glib/strv.rb`
Represents a null-terminated array of strings. GLib uses this construction, but does not provide any actual functions for this class.
# File lib/ffi-glib/strv.rb, line 8 def self.from it case it when nil nil when FFI::Pointer wrap it when self it else from_enumerable it end end
# File lib/ffi-glib/strv.rb, line 21 def self.from_enumerable enum self.wrap GirFFI::InPointer.from_array :utf8, enum end
# File lib/gir_ffi-base/glib/strv.rb, line 11 def initialize ptr @ptr = ptr end
# File lib/gir_ffi-base/glib/strv.rb, line 26 def self.wrap ptr self.new ptr end
# File lib/ffi-glib/strv.rb, line 4 def ==(other) self.to_a == other.to_a end
# File lib/gir_ffi-base/glib/strv.rb, line 19 def each reset_iterator or return while (ptr = next_ptr) yield ptr.read_string end end
# File lib/gir_ffi-base/glib/strv.rb, line 15 def to_ptr @ptr end
# File lib/gir_ffi-base/glib/strv.rb, line 37 def next_ptr ptr = @ptr.get_pointer @offset @offset += POINTER_SIZE ptr unless ptr.null? end
# File lib/gir_ffi-base/glib/strv.rb, line 32 def reset_iterator return if @ptr.null? @offset = 0 end