class GLib::ByteArray
Overrides for GByteArray, GLib's automatically growing array of bytes.
Public Class Methods
new()
click to toggle source
# File lib/ffi-glib/byte_array.rb, line 16 def initialize store_pointer(Lib.g_byte_array_new) end
Public Instance Methods
append(data)
click to toggle source
# File lib/ffi-glib/byte_array.rb, line 10 def append(data) bytes = GirFFI::InPointer.from :utf8, data len = data.bytesize self.class.wrap(Lib.g_byte_array_append to_ptr, bytes, len) end
to_string()
click to toggle source
# File lib/ffi-glib/byte_array.rb, line 6 def to_string GirFFI::ArgHelper.ptr_to_utf8_length @struct[:data], @struct[:len] end