Class: FFI::Clang::CodeCompletion::String

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi/clang/code_completion.rb

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ String

Returns a new instance of String.



119
120
121
# File 'lib/ffi/clang/code_completion.rb', line 119

def initialize(ptr)
	@pointer = ptr
end

Instance Method Details

#annotation(i) ⇒ Object



157
158
159
# File 'lib/ffi/clang/code_completion.rb', line 157

def annotation(i)
	Lib.extract_string Lib.get_completion_annotation(@pointer, i)
end

#annotationsObject



161
162
163
164
165
# File 'lib/ffi/clang/code_completion.rb', line 161

def annotations
	num_annotations.times.map { |i|
		Lib.extract_string Lib.get_completion_annotation(@pointer, i)
	}
end

#availabilityObject



149
150
151
# File 'lib/ffi/clang/code_completion.rb', line 149

def availability
	Lib.get_completion_availability(@pointer)
end

#chunk_completion(i) ⇒ Object



131
132
133
# File 'lib/ffi/clang/code_completion.rb', line 131

def chunk_completion(i)
	CodeCompletion::String.new Lib.get_completion_chunk_completion_string(@pointer, i)
end

#chunk_kind(i) ⇒ Object



123
124
125
# File 'lib/ffi/clang/code_completion.rb', line 123

def chunk_kind(i)
	Lib.get_completion_chunk_kind(@pointer, i)
end

#chunk_text(i) ⇒ Object



127
128
129
# File 'lib/ffi/clang/code_completion.rb', line 127

def chunk_text(i)
	Lib.extract_string Lib.get_completion_text(@pointer, i)
end

#chunksObject



139
140
141
142
143
# File 'lib/ffi/clang/code_completion.rb', line 139

def chunks
	num_chunks.times.map { |i|
		{ kind: chunk_kind(i), text: chunk_text(i), completion: chunk_completion(i) }
	}
end

#commentObject



171
172
173
# File 'lib/ffi/clang/code_completion.rb', line 171

def comment
	Lib.extract_string Lib.get_completion_brief_comment(@pointer)
end

#inspectObject



175
176
177
# File 'lib/ffi/clang/code_completion.rb', line 175

def inspect
	chunks.inspect
end

#num_annotationsObject



153
154
155
# File 'lib/ffi/clang/code_completion.rb', line 153

def num_annotations
	Lib.get_completion_num_annotations(@pointer)
end

#num_chunksObject



135
136
137
# File 'lib/ffi/clang/code_completion.rb', line 135

def num_chunks
	Lib.get_num_completion_chunks(@pointer)
end

#parentObject



167
168
169
# File 'lib/ffi/clang/code_completion.rb', line 167

def parent
	Lib.extract_string Lib.get_completion_parent(@pointer, nil)
end

#priorityObject



145
146
147
# File 'lib/ffi/clang/code_completion.rb', line 145

def priority
	Lib.get_completion_priority(@pointer)
end