Class: FFI::Clang::IndexAction::IncludedFile
- Inherits:
-
Object
- Object
- FFI::Clang::IndexAction::IncludedFile
- Defined in:
- lib/ffi/clang/index_action.rb
Overview
Represents an include directive encountered during indexing.
Instance Attribute Summary collapse
- #file ⇒ Object readonly
- #filename ⇒ Object readonly
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Class Method Summary collapse
Instance Method Summary collapse
-
#angled? ⇒ Boolean
Check if the include used angle brackets.
-
#import? ⇒ Boolean
Check if the directive was an import.
-
#initialize(info, translation_unit) ⇒ IncludedFile
constructor
Build an include wrapper from a libclang include info pointer.
-
#module_import? ⇒ Boolean
Check if the include was converted into a module import by clang.
Constructor Details
#initialize(info, translation_unit) ⇒ IncludedFile
Build an include wrapper from a libclang include info pointer.
103 104 105 106 107 108 109 110 |
# File 'lib/ffi/clang/index_action.rb', line 103 def initialize(info, translation_unit) @filename = Entity.string_from_pointer(info[:filename]) @file = self.class.file_from_pointer(info[:file], translation_unit) @location = ExpansionLocation.new(Lib.index_loc_get_source_location(info[:hash_loc])) @import = info[:is_import] != 0 @angled = info[:is_angled] != 0 @module_import = info[:is_module_import] != 0 end |
Instance Attribute Details
#file ⇒ Object (readonly)
98 |
# File 'lib/ffi/clang/index_action.rb', line 98 attr_reader :filename, :file, :location |
#filename ⇒ Object (readonly)
98 99 100 |
# File 'lib/ffi/clang/index_action.rb', line 98 def filename @filename end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
98 |
# File 'lib/ffi/clang/index_action.rb', line 98 attr_reader :filename, :file, :location |
Class Method Details
Instance Method Details
#angled? ⇒ Boolean
Check if the include used angle brackets.
120 121 122 |
# File 'lib/ffi/clang/index_action.rb', line 120 def angled? @angled end |
#import? ⇒ Boolean
Check if the directive was an import.
114 115 116 |
# File 'lib/ffi/clang/index_action.rb', line 114 def import? @import end |
#module_import? ⇒ Boolean
Check if the include was converted into a module import by clang.
126 127 128 |
# File 'lib/ffi/clang/index_action.rb', line 126 def module_import? @module_import end |