Object
# File lib/ffi/pointer.rb, line 57 def read_array_of_type(type, reader, length) ary = [] size = FFI.type_size(type) tmp = self length.times { |j| ary << tmp.send(reader) tmp += size unless j == length-1 # avoid OOB } ary end
# File lib/ffi/pointer.rb, line 31 def read_string(len=nil) if len get_bytes(0, len) else get_string(0) end end
# File lib/ffi/pointer.rb, line 39 def read_string_length(len) get_bytes(0, len) end
# File lib/ffi/pointer.rb, line 43 def read_string_to_null get_string(0) end
# File lib/ffi/pointer.rb, line 68 def write_array_of_type(type, writer, ary) size = FFI.type_size(type) tmp = self ary.each_with_index {|i, j| tmp.send(writer, i) tmp += size unless j == ary.length-1 # avoid OOB } self end
Generated with the Darkfish Rdoc Generator 2.