Class: HTS::LibHTS::KString
Overview
Instance Method Summary
collapse
Methods inherited from FFI::Struct
struct_layout, union_layout
Instance Method Details
#buffer_ptr ⇒ Object
16
17
18
|
# File 'lib/hts/libhts/constants.rb', line 16
def buffer_ptr
to_ptr.get_pointer(self.class.offset_of(:s))
end
|
#free_buffer ⇒ Object
27
28
29
30
31
32
33
34
35
|
# File 'lib/hts/libhts/constants.rb', line 27
def free_buffer
ptr = buffer_ptr
return if ptr.null?
LibHTS.hts_free(ptr)
to_ptr.put_pointer(self.class.offset_of(:s), FFI::Pointer::NULL)
self[:l] = 0
self[:m] = 0
end
|
#read_string_copy ⇒ Object
20
21
22
23
24
25
|
# File 'lib/hts/libhts/constants.rb', line 20
def read_string_copy
ptr = buffer_ptr
return "" if ptr.null?
ptr.read_string(self[:l])
end
|