Class: FFIGen::Clang::String

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/ffi_gen/clang.rb,
lib/ffi_gen.rb

Overview

A character string.

The c CXString type is used to return strings from the interface when the ownership of that string might different from one call to the next. Use c clang_getCString() to retrieve the string data and, once finished with the string data, call c clang_disposeString() to free the string.

Fields:

:data

(FFI::Pointer(*Void))

:private_flags

(Integer)

Instance Method Summary collapse

Instance Method Details

#to_sObject



36
37
38
# File 'lib/ffi_gen.rb', line 36

def to_s
  Clang.get_c_string self
end

#to_s_and_disposeObject



40
41
42
43
44
# File 'lib/ffi_gen.rb', line 40

def to_s_and_dispose
  str = to_s
  Clang.dispose_string self
  str
end