Class: FFI::Clang::EvalResult

Inherits:
AutoPointer
  • Object
show all
Defined in:
lib/ffi/clang/evaluation.rb

Overview

Represents the result of evaluating a cursor as a compile-time constant.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.release(pointer) ⇒ Object

Release the evaluation result.



56
57
58
# File 'lib/ffi/clang/evaluation.rb', line 56

def self.release(pointer)
	Lib.eval_result_dispose(pointer)
end

Instance Method Details

#as_doubleObject

Get the result as a double.



44
45
46
# File 'lib/ffi/clang/evaluation.rb', line 44

def as_double
	Lib.eval_result_get_as_double(self)
end

#as_intObject

Get the result as an integer.



20
21
22
# File 'lib/ffi/clang/evaluation.rb', line 20

def as_int
	Lib.eval_result_get_as_int(self)
end

#as_long_longObject

Get the result as a long long integer.



26
27
28
# File 'lib/ffi/clang/evaluation.rb', line 26

def as_long_long
	Lib.eval_result_get_as_long_long(self)
end

#as_strObject

Get the result as a string.



50
51
52
# File 'lib/ffi/clang/evaluation.rb', line 50

def as_str
	Lib.eval_result_get_as_str(self)
end

#as_unsignedObject

Get the result as an unsigned integer.



38
39
40
# File 'lib/ffi/clang/evaluation.rb', line 38

def as_unsigned
	Lib.eval_result_get_as_unsigned(self)
end

#kindObject

Get the kind of this evaluation result.



14
15
16
# File 'lib/ffi/clang/evaluation.rb', line 14

def kind
	Lib.eval_result_get_kind(self)
end

#unsigned_int?Boolean

Check if the result is an unsigned integer.

Returns:

  • (Boolean)


32
33
34
# File 'lib/ffi/clang/evaluation.rb', line 32

def unsigned_int?
	Lib.eval_result_is_unsigned_int(self) != 0
end