Class: FFI::Clang::CodeCompletion::Results
- Inherits:
-
AutoPointer
- Object
- AutoPointer
- FFI::Clang::CodeCompletion::Results
- Includes:
- Enumerable
- Defined in:
- lib/ffi/clang/code_completion.rb
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Class Method Summary collapse
Instance Method Summary collapse
- #container_kind ⇒ Object
- #container_usr ⇒ Object
- #contexts ⇒ Object
- #diagnostic(i) ⇒ Object
- #diagnostics ⇒ Object
- #each(&block) ⇒ Object
- #incomplete? ⇒ Boolean
-
#initialize(code_complete_results, translation_unit) ⇒ Results
constructor
A new instance of Results.
- #inspect ⇒ Object
- #num_diagnostics ⇒ Object
- #objc_selector ⇒ Object
- #sort! ⇒ Object
Constructor Details
#initialize(code_complete_results, translation_unit) ⇒ Results
Returns a new instance of Results.
23 24 25 26 27 28 |
# File 'lib/ffi/clang/code_completion.rb', line 23 def initialize(code_complete_results, translation_unit) super code_complete_results.pointer @translation_unit = translation_unit @code_complete_results = code_complete_results initialize_results end |
Instance Attribute Details
#results ⇒ Object (readonly)
Returns the value of attribute results.
21 22 23 |
# File 'lib/ffi/clang/code_completion.rb', line 21 def results @results end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
20 21 22 |
# File 'lib/ffi/clang/code_completion.rb', line 20 def size @size end |
Class Method Details
.release(pointer) ⇒ Object
30 31 32 33 |
# File 'lib/ffi/clang/code_completion.rb', line 30 def self.release(pointer) results = Lib::CXCodeCompleteResults.new(pointer) Lib.dispose_code_complete_results(results) end |
Instance Method Details
#container_kind ⇒ Object
63 64 65 66 |
# File 'lib/ffi/clang/code_completion.rb', line 63 def container_kind is_incomplete = MemoryPointer.new :uint Lib.get_code_complete_get_container_kind(@code_complete_results, is_incomplete) end |
#container_usr ⇒ Object
59 60 61 |
# File 'lib/ffi/clang/code_completion.rb', line 59 def container_usr Lib.extract_string Lib.get_code_complete_get_container_usr(@code_complete_results) end |
#contexts ⇒ Object
55 56 57 |
# File 'lib/ffi/clang/code_completion.rb', line 55 def contexts Lib.opts_from Lib::CompletionContext, Lib.get_code_complete_get_contexts(@code_complete_results) end |
#diagnostic(i) ⇒ Object
45 46 47 |
# File 'lib/ffi/clang/code_completion.rb', line 45 def diagnostic(i) Diagnostic.new(@translation_unit, Lib.get_code_complete_get_diagnostic(@code_complete_results, i)) end |
#diagnostics ⇒ Object
49 50 51 52 53 |
# File 'lib/ffi/clang/code_completion.rb', line 49 def diagnostics num_diagnostics.times.map { |i| Diagnostic.new(@translation_unit, Lib.get_code_complete_get_diagnostic(@code_complete_results, i)) } end |
#each(&block) ⇒ Object
35 36 37 38 39 |
# File 'lib/ffi/clang/code_completion.rb', line 35 def each(&block) @results.each do |token| block.call(token) end end |
#incomplete? ⇒ Boolean
68 69 70 71 72 |
# File 'lib/ffi/clang/code_completion.rb', line 68 def incomplete? is_incomplete = MemoryPointer.new :uint Lib.get_code_complete_get_container_kind(@code_complete_results, is_incomplete) is_incomplete.read_uint != 0 end |
#inspect ⇒ Object
83 84 85 |
# File 'lib/ffi/clang/code_completion.rb', line 83 def inspect @results.inspect end |
#num_diagnostics ⇒ Object
41 42 43 |
# File 'lib/ffi/clang/code_completion.rb', line 41 def num_diagnostics Lib.get_code_complete_get_num_diagnostics(@code_complete_results) end |
#objc_selector ⇒ Object
74 75 76 |
# File 'lib/ffi/clang/code_completion.rb', line 74 def objc_selector Lib.extract_string Lib.get_code_complete_get_objc_selector(@code_complete_results) end |
#sort! ⇒ Object
78 79 80 81 |
# File 'lib/ffi/clang/code_completion.rb', line 78 def sort! Lib.sort_code_completion_results(@code_complete_results[:results], @code_complete_results[:num]) initialize_results end |