Class: FFI::Clang::Type
- Inherits:
-
Object
- Object
- FFI::Clang::Type
- Defined in:
- lib/ffi/clang/type.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #alignof ⇒ Object
- #arg_type(i) ⇒ Object
- #array_element_type ⇒ Object
- #array_size ⇒ Object
- #calling_conv ⇒ Object
- #canonical ⇒ Object
- #class_type ⇒ Object
- #const_qualified? ⇒ Boolean
- #declaration ⇒ Object
- #element_type ⇒ Object
-
#initialize(type, translation_unit) ⇒ Type
constructor
A new instance of Type.
- #kind ⇒ Object
- #kind_spelling ⇒ Object
- #num_arg_types ⇒ Object
- #num_elements ⇒ Object
- #offsetof(field) ⇒ Object
- #pod? ⇒ Boolean
- #pointee ⇒ Object
- #ref_qualifier ⇒ Object
- #restrict_qualified? ⇒ Boolean
- #result_type ⇒ Object
- #sizeof ⇒ Object
- #spelling ⇒ Object
- #variadic? ⇒ Boolean
- #volatile_qualified? ⇒ Boolean
Constructor Details
#initialize(type, translation_unit) ⇒ Type
Returns a new instance of Type.
27 28 29 30 |
# File 'lib/ffi/clang/type.rb', line 27 def initialize(type, translation_unit) @type = type @translation_unit = translation_unit end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
25 26 27 |
# File 'lib/ffi/clang/type.rb', line 25 def type @type end |
Instance Method Details
#==(other) ⇒ Object
128 129 130 |
# File 'lib/ffi/clang/type.rb', line 128 def ==(other) Lib.equal_types(@type, other.type) != 0 end |
#alignof ⇒ Object
104 105 106 |
# File 'lib/ffi/clang/type.rb', line 104 def alignof Lib.type_get_align_of(@type) end |
#arg_type(i) ⇒ Object
80 81 82 |
# File 'lib/ffi/clang/type.rb', line 80 def arg_type(i) Type.new Lib.get_arg_type(@type, i), @translation_unit end |
#array_element_type ⇒ Object
96 97 98 |
# File 'lib/ffi/clang/type.rb', line 96 def array_element_type Type.new Lib.get_array_element_type(@type), @translation_unit end |
#array_size ⇒ Object
100 101 102 |
# File 'lib/ffi/clang/type.rb', line 100 def array_size Lib.get_array_size(@type) end |
#calling_conv ⇒ Object
120 121 122 |
# File 'lib/ffi/clang/type.rb', line 120 def calling_conv Lib.get_fuction_type_calling_conv(@type) end |
#canonical ⇒ Object
60 61 62 |
# File 'lib/ffi/clang/type.rb', line 60 def canonical Type.new Lib.get_canonical_type(@type), @translation_unit end |
#class_type ⇒ Object
64 65 66 |
# File 'lib/ffi/clang/type.rb', line 64 def class_type Type.new Lib.type_get_class_type(@type), @translation_unit end |
#const_qualified? ⇒ Boolean
68 69 70 |
# File 'lib/ffi/clang/type.rb', line 68 def const_qualified? Lib.is_const_qualified_type(@type) != 0 end |
#declaration ⇒ Object
124 125 126 |
# File 'lib/ffi/clang/type.rb', line 124 def declaration Cursor.new Lib.get_type_declaration(@type), @translation_unit end |
#element_type ⇒ Object
88 89 90 |
# File 'lib/ffi/clang/type.rb', line 88 def element_type Type.new Lib.get_element_type(@type), @translation_unit end |
#kind ⇒ Object
32 33 34 |
# File 'lib/ffi/clang/type.rb', line 32 def kind @type[:kind] end |
#kind_spelling ⇒ Object
36 37 38 |
# File 'lib/ffi/clang/type.rb', line 36 def kind_spelling Lib.extract_string Lib.get_type_kind_spelling @type[:kind] end |
#num_arg_types ⇒ Object
52 53 54 |
# File 'lib/ffi/clang/type.rb', line 52 def num_arg_types Lib.get_num_arg_types(@type) end |
#num_elements ⇒ Object
92 93 94 |
# File 'lib/ffi/clang/type.rb', line 92 def num_elements Lib.get_num_elements(@type) end |
#offsetof(field) ⇒ Object
112 113 114 |
# File 'lib/ffi/clang/type.rb', line 112 def offsetof(field) Lib.type_get_offset_of(@type, field) end |
#pod? ⇒ Boolean
48 49 50 |
# File 'lib/ffi/clang/type.rb', line 48 def pod? Lib.is_pod_type(@type) != 0 end |
#pointee ⇒ Object
56 57 58 |
# File 'lib/ffi/clang/type.rb', line 56 def pointee Type.new Lib.get_pointee_type(@type), @translation_unit end |
#ref_qualifier ⇒ Object
116 117 118 |
# File 'lib/ffi/clang/type.rb', line 116 def ref_qualifier Lib.type_get_cxx_ref_qualifier(@type) end |
#restrict_qualified? ⇒ Boolean
76 77 78 |
# File 'lib/ffi/clang/type.rb', line 76 def restrict_qualified? Lib.is_restrict_qualified_type(@type) != 0 end |
#result_type ⇒ Object
84 85 86 |
# File 'lib/ffi/clang/type.rb', line 84 def result_type Type.new Lib.get_result_type(@type), @translation_unit end |
#sizeof ⇒ Object
108 109 110 |
# File 'lib/ffi/clang/type.rb', line 108 def sizeof Lib.type_get_size_of(@type) end |
#spelling ⇒ Object
40 41 42 |
# File 'lib/ffi/clang/type.rb', line 40 def spelling Lib.extract_string Lib.get_type_spelling(@type) end |
#variadic? ⇒ Boolean
44 45 46 |
# File 'lib/ffi/clang/type.rb', line 44 def variadic? Lib.is_function_type_variadic(@type) != 0 end |
#volatile_qualified? ⇒ Boolean
72 73 74 |
# File 'lib/ffi/clang/type.rb', line 72 def volatile_qualified? Lib.is_volatile_qualified_type(@type) != 0 end |