Class: FFI::Generator::Type::Declaration
- Inherits:
-
Object
- Object
- FFI::Generator::Type::Declaration
- Defined in:
- lib/generator/type.rb
Instance Method Summary collapse
-
#initialize(declaration) ⇒ Declaration
constructor
A new instance of Declaration.
- #is_array? ⇒ Boolean
- #is_callback? ⇒ Boolean
- #is_constant? ⇒ Boolean
- #is_enum? ⇒ Boolean
- #is_inline_callback? ⇒ Boolean
- #is_native? ⇒ Boolean
- #is_pointer? ⇒ Boolean
- #is_struct? ⇒ Boolean
- #is_union? ⇒ Boolean
- #is_volatile? ⇒ Boolean
Constructor Details
#initialize(declaration) ⇒ Declaration
Returns a new instance of Declaration.
10 11 12 |
# File 'lib/generator/type.rb', line 10 def initialize(declaration) @full_decl = declaration end |
Instance Method Details
#is_array? ⇒ Boolean
22 23 24 |
# File 'lib/generator/type.rb', line 22 def is_array? @full_decl and @full_decl[ArrayRE] end |
#is_callback? ⇒ Boolean
37 38 39 |
# File 'lib/generator/type.rb', line 37 def is_callback? @full_decl[/^callback/] end |
#is_constant? ⇒ Boolean
31 32 33 |
# File 'lib/generator/type.rb', line 31 def is_constant? @full_decl[/^q\(const\)/] end |
#is_enum? ⇒ Boolean
19 20 21 |
# File 'lib/generator/type.rb', line 19 def is_enum? @full_decl[/^enum/] end |
#is_inline_callback? ⇒ Boolean
40 41 42 |
# File 'lib/generator/type.rb', line 40 def is_inline_callback? @full_decl[/^p.f\(/] end |
#is_native? ⇒ Boolean
13 14 15 |
# File 'lib/generator/type.rb', line 13 def is_native? Generator::TYPES.has_key?(@full_decl) end |
#is_pointer? ⇒ Boolean
16 17 18 |
# File 'lib/generator/type.rb', line 16 def is_pointer? @full_decl[/^p\./] and not is_inline_callback? end |
#is_struct? ⇒ Boolean
25 26 27 |
# File 'lib/generator/type.rb', line 25 def is_struct? @full_decl[/^struct/] end |
#is_union? ⇒ Boolean
28 29 30 |
# File 'lib/generator/type.rb', line 28 def is_union? @full_decl[/^union/] end |
#is_volatile? ⇒ Boolean
34 35 36 |
# File 'lib/generator/type.rb', line 34 def is_volatile? @full_decl[/^q\(volatile\)/] end |