Class: GLib::Strv

Inherits:
GObjectIntrospection::Strv show all
Defined in:
lib/ffi-glib/strv.rb

Overview

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

The implementation is mainly inherited from GObjectIntrospection::Strv.

Constant Summary

Constants inherited from GObjectIntrospection::Strv

GObjectIntrospection::Strv::POINTER_SIZE

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GObjectIntrospection::Strv

#each, #initialize, #to_ptr, wrap

Constructor Details

This class inherits a constructor from GObjectIntrospection::Strv

Class Method Details

.from(obj) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ffi-glib/strv.rb', line 13

def self.from(obj)
  case obj
  when nil
    nil
  when FFI::Pointer
    wrap obj
  when self
    obj
  else
    from_enumerable obj
  end
end

.from_enumerable(enum) ⇒ Object



26
27
28
# File 'lib/ffi-glib/strv.rb', line 26

def self.from_enumerable(enum)
  wrap GirFFI::InPointer.from_array :utf8, enum
end

Instance Method Details

#==(other) ⇒ Object



9
10
11
# File 'lib/ffi-glib/strv.rb', line 9

def ==(other)
  to_a == other.to_a
end