class GLib::Strv

Represents a null-terminated array of strings. GLib uses this construction, but does not provide any actual functions for this class.

Extra methods for GLib::Strv.

Constants

POINTER_SIZE

Public Class Methods

from(it) click to toggle source
# File lib/ffi-glib/strv.rb, line 4
def self.from it
  case it
  when nil
    nil
  when FFI::Pointer
    wrap it
  when self
    it
  else
    from_enumerable it
  end
end
from_enumerable(enum) click to toggle source
# File lib/ffi-glib/strv.rb, line 17
def self.from_enumerable enum
  self.wrap GirFFI::InPointer.from_array :utf8, enum
end
new(ptr) click to toggle source
# File lib/gir_ffi-base/glib/strv.rb, line 11
def initialize ptr
  @ptr = ptr
end
wrap(ptr) click to toggle source
# File lib/gir_ffi-base/glib/strv.rb, line 26
def self.wrap ptr
  self.new ptr
end

Public Instance Methods

each() { |read_string| ... } click to toggle source
# 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
to_ptr() click to toggle source
# File lib/gir_ffi-base/glib/strv.rb, line 15
def to_ptr
  @ptr
end