Class: FFI::Clang::Types::Record
- Inherits:
-
Type
- Object
- Type
- FFI::Clang::Types::Record
show all
- Defined in:
- lib/ffi/clang/types/record.rb
Instance Attribute Summary
Attributes inherited from Type
#translation_unit, #type
Instance Method Summary
collapse
Methods inherited from Type
#==, #alignof, #const_qualified?, create, #declaration, #initialize, #kind, #kind_spelling, #pod?, #ref_qualifier, #restrict_qualified?, #sizeof, #spelling, #to_s, #volatile_qualified?
Instance Method Details
#anonymous? ⇒ Boolean
9
10
11
|
# File 'lib/ffi/clang/types/record.rb', line 9
def anonymous?
self.spelling.match(/unnamed/)
end
|
#offsetof(field) ⇒ Object
5
6
7
|
# File 'lib/ffi/clang/types/record.rb', line 5
def offsetof(field)
Lib.type_get_offset_of(@type, field)
end
|
#record_type ⇒ Object
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/ffi/clang/types/record.rb', line 13
def record_type
case self.spelling
when /struct/
:struct
when /union/
:union
else
raise("Unknown record type: #{self.spelling}")
end
end
|