Class: FFI::Clang::Cursor
- Inherits:
-
Object
- Object
- FFI::Clang::Cursor
- Includes:
- Enumerable
- Defined in:
- lib/ffi/clang/cursor.rb
Defined Under Namespace
Classes: PlatformAvailability
Instance Attribute Summary collapse
-
#cursor ⇒ Object
readonly
Returns the value of attribute cursor.
-
#translation_unit ⇒ Object
readonly
Returns the value of attribute translation_unit.
Class Method Summary collapse
-
.kind_spelling(kind) ⇒ Object
this function is categorized as “Debugging facilities”.
- .null_cursor ⇒ Object
Instance Method Summary collapse
- #abstract? ⇒ Boolean
- #access_specifier ⇒ Object
- #ancestors_by_kind(*kinds) ⇒ Object
- #anonymous? ⇒ Boolean
- #anonymous_record_declaration? ⇒ Boolean
- #argument(i) ⇒ Object
- #attribute? ⇒ Boolean
- #availability ⇒ Object
- #bitfield? ⇒ Boolean
- #bitwidth ⇒ Object
- #canonical ⇒ Object
- #comment ⇒ Object
- #comment_range ⇒ Object
- #completion ⇒ Object
- #const? ⇒ Boolean
- #converting_constructor? ⇒ Boolean
- #copy_assignment_operator? ⇒ Boolean
- #copy_constructor? ⇒ Boolean
- #declaration? ⇒ Boolean
- #default_constructor? ⇒ Boolean
- #defaulted? ⇒ Boolean
- #definition ⇒ Object
- #definition? ⇒ Boolean
- #deleted? ⇒ Boolean
- #display_name ⇒ Object
- #dynamic_call? ⇒ Boolean
- #each(recurse = true, &block) ⇒ Object
- #enum_scoped? ⇒ Boolean
- #enum_type ⇒ Object
- #enum_unsigned_value ⇒ Object
- #enum_value ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #exception_specification ⇒ Object
- #expansion_location ⇒ Object (also: #location)
- #explicit? ⇒ Boolean
- #expression? ⇒ Boolean
- #extent ⇒ Object
- #file_location ⇒ Object
- #find_by_kind(recurse, *kinds) ⇒ Object
- #find_references_in_file(file = nil, &block) ⇒ Object
- #forward_declaration? ⇒ Boolean
- #hash ⇒ Object
- #included_file ⇒ Object
-
#initialize(cxcursor, translation_unit) ⇒ Cursor
constructor
A new instance of Cursor.
- #invalid? ⇒ Boolean
- #kind ⇒ Object
- #kind_spelling ⇒ Object
- #language ⇒ Object
- #lexical_parent ⇒ Object
- #linkage ⇒ Object
- #move_assignment_operator? ⇒ Boolean
- #move_constructor? ⇒ Boolean
- #mutable? ⇒ Boolean
- #null? ⇒ Boolean
- #num_args ⇒ Object
- #num_arguments ⇒ Object
- #num_overloaded_decls ⇒ Object
- #objc_type_encoding ⇒ Object
- #opaque_declaration? ⇒ Boolean
- #overloaded_decl(i) ⇒ Object
- #overriddens ⇒ Object
- #platform_availability(max_availability_size = 4) ⇒ Object
- #preprocessing? ⇒ Boolean
- #presumed_location ⇒ Object
- #printing_policy ⇒ Object
- #private? ⇒ Boolean
- #protected? ⇒ Boolean
- #public? ⇒ Boolean
- #pure_virtual? ⇒ Boolean
- #qualified_name ⇒ Object
- #raw_comment_text ⇒ Object
- #reference? ⇒ Boolean
- #referenced ⇒ Object
- #references(file = nil) ⇒ Object
- #result_type ⇒ Object
- #semantic_parent ⇒ Object
- #specialized_template ⇒ Object
- #spelling ⇒ Object
- #spelling_location ⇒ Object
- #statement? ⇒ Boolean
- #static? ⇒ Boolean
- #template_kind ⇒ Object
- #to_s ⇒ Object
- #translation_unit? ⇒ Boolean
- #type ⇒ Object
- #underlying_type ⇒ Object
- #unexposed? ⇒ Boolean
- #usr ⇒ Object
- #variadic? ⇒ Boolean
- #virtual? ⇒ Boolean
- #virtual_base? ⇒ Boolean
- #visit_children(&block) ⇒ Object
Constructor Details
#initialize(cxcursor, translation_unit) ⇒ Cursor
Returns a new instance of Cursor.
41 42 43 44 |
# File 'lib/ffi/clang/cursor.rb', line 41 def initialize(cxcursor, translation_unit) @cursor = cxcursor @translation_unit = translation_unit end |
Instance Attribute Details
#cursor ⇒ Object (readonly)
Returns the value of attribute cursor.
29 30 31 |
# File 'lib/ffi/clang/cursor.rb', line 29 def cursor @cursor end |
#translation_unit ⇒ Object (readonly)
Returns the value of attribute translation_unit.
30 31 32 |
# File 'lib/ffi/clang/cursor.rb', line 30 def translation_unit @translation_unit end |
Class Method Details
.kind_spelling(kind) ⇒ Object
this function is categorized as “Debugging facilities”
37 38 39 |
# File 'lib/ffi/clang/cursor.rb', line 37 def self.kind_spelling(kind) Lib.extract_string Lib.get_cursor_kind_spelling(kind) end |
Instance Method Details
#abstract? ⇒ Boolean
499 500 501 |
# File 'lib/ffi/clang/cursor.rb', line 499 def abstract? Lib.is_abstract(@cursor) != 0 end |
#access_specifier ⇒ Object
272 273 274 |
# File 'lib/ffi/clang/cursor.rb', line 272 def access_specifier Lib.get_cxx_access_specifier @cursor end |
#ancestors_by_kind(*kinds) ⇒ Object
308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/ffi/clang/cursor.rb', line 308 def ancestors_by_kind(*kinds) result = Array.new parent = self while parent != self.semantic_parent parent = self.semantic_parent if kinds.include?(parent.kind) result << parent end end result end |
#anonymous? ⇒ Boolean
66 67 68 |
# File 'lib/ffi/clang/cursor.rb', line 66 def anonymous? Lib.cursor_is_anonymous(@cursor) != 0 end |
#anonymous_record_declaration? ⇒ Boolean
70 71 72 |
# File 'lib/ffi/clang/cursor.rb', line 70 def anonymous_record_declaration? Lib.cursor_is_anonymous_record_decl(@cursor) != 0 end |
#argument(i) ⇒ Object
429 430 431 |
# File 'lib/ffi/clang/cursor.rb', line 429 def argument(i) Cursor.new Lib.cursor_get_argument(@cursor, i), @translation_unit end |
#attribute? ⇒ Boolean
90 91 92 |
# File 'lib/ffi/clang/cursor.rb', line 90 def attribute? Lib.is_attribute(kind) != 0 end |
#availability ⇒ Object
355 356 357 |
# File 'lib/ffi/clang/cursor.rb', line 355 def availability Lib.get_cursor_availability(@cursor) end |
#bitfield? ⇒ Boolean
409 410 411 |
# File 'lib/ffi/clang/cursor.rb', line 409 def bitfield? Lib.is_bit_field(@cursor) != 0 end |
#bitwidth ⇒ Object
413 414 415 |
# File 'lib/ffi/clang/cursor.rb', line 413 def bitwidth Lib.get_field_decl_bit_width(@cursor) end |
#canonical ⇒ Object
233 234 235 |
# File 'lib/ffi/clang/cursor.rb', line 233 def canonical Cursor.new Lib.get_canonical_cursor(@cursor), @translation_unit end |
#comment ⇒ Object
54 55 56 |
# File 'lib/ffi/clang/cursor.rb', line 54 def comment Comment.build_from Lib.cursor_get_parsed_comment(@cursor) end |
#comment_range ⇒ Object
58 59 60 |
# File 'lib/ffi/clang/cursor.rb', line 58 def comment_range SourceRange.new(Lib.cursor_get_comment_range(@cursor)) end |
#completion ⇒ Object
62 63 64 |
# File 'lib/ffi/clang/cursor.rb', line 62 def completion CodeCompletion::String.new Lib.get_cursor_completion_string(@cursor) end |
#const? ⇒ Boolean
507 508 509 |
# File 'lib/ffi/clang/cursor.rb', line 507 def const? Lib.is_const(@cursor) != 0 end |
#converting_constructor? ⇒ Boolean
459 460 461 |
# File 'lib/ffi/clang/cursor.rb', line 459 def converting_constructor? Lib.is_converting_constructor(@cursor) != 0 end |
#copy_assignment_operator? ⇒ Boolean
487 488 489 |
# File 'lib/ffi/clang/cursor.rb', line 487 def copy_assignment_operator? Lib.is_copy_assignment_operator(@cursor) != 0 end |
#copy_constructor? ⇒ Boolean
463 464 465 |
# File 'lib/ffi/clang/cursor.rb', line 463 def copy_constructor? Lib.is_copy_constructor(@cursor) != 0 end |
#declaration? ⇒ Boolean
74 75 76 |
# File 'lib/ffi/clang/cursor.rb', line 74 def declaration? Lib.is_declaration(kind) != 0 end |
#default_constructor? ⇒ Boolean
467 468 469 |
# File 'lib/ffi/clang/cursor.rb', line 467 def default_constructor? Lib.is_default_constructor(@cursor) != 0 end |
#defaulted? ⇒ Boolean
479 480 481 |
# File 'lib/ffi/clang/cursor.rb', line 479 def defaulted? Lib.is_defaulted(@cursor) != 0 end |
#definition ⇒ Object
237 238 239 |
# File 'lib/ffi/clang/cursor.rb', line 237 def definition Cursor.new Lib.get_cursor_definition(@cursor), @translation_unit end |
#definition? ⇒ Boolean
201 202 203 |
# File 'lib/ffi/clang/cursor.rb', line 201 def definition? Lib.is_definition(@cursor) != 0 end |
#deleted? ⇒ Boolean
483 484 485 |
# File 'lib/ffi/clang/cursor.rb', line 483 def deleted? Lib.is_deleted(@cursor) != 0 end |
#display_name ⇒ Object
143 144 145 |
# File 'lib/ffi/clang/cursor.rb', line 143 def display_name Lib.extract_string Lib.get_cursor_display_name(@cursor) end |
#dynamic_call? ⇒ Boolean
193 194 195 |
# File 'lib/ffi/clang/cursor.rb', line 193 def dynamic_call? Lib.is_dynamic_call(@cursor) != 0 end |
#each(recurse = true, &block) ⇒ Object
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/ffi/clang/cursor.rb', line 284 def each(recurse = true, &block) return to_enum(:each, recurse) unless block_given? adapter = Proc.new do |cxcursor, parent_cursor, unused| # Call the block and capture the result. This lets advanced users # modify the recursion on a case by case basis if needed result = block.call Cursor.new(cxcursor, @translation_unit), Cursor.new(parent_cursor, @translation_unit) case result when :continue :continue when :recurse :recurse else recurse ? :recurse : :continue end end Lib.visit_children(@cursor, adapter, nil) end |
#enum_scoped? ⇒ Boolean
503 504 505 |
# File 'lib/ffi/clang/cursor.rb', line 503 def enum_scoped? Lib.is_enum_scoped(@cursor) != 0 end |
#enum_type ⇒ Object
225 226 227 |
# File 'lib/ffi/clang/cursor.rb', line 225 def enum_type Types::Type.create Lib.get_enum_decl_integer_type(@cursor), @translation_unit end |
#enum_unsigned_value ⇒ Object
221 222 223 |
# File 'lib/ffi/clang/cursor.rb', line 221 def enum_unsigned_value Lib.get_enum_unsigned_value @cursor end |
#enum_value ⇒ Object
217 218 219 |
# File 'lib/ffi/clang/cursor.rb', line 217 def enum_value Lib.get_enum_value @cursor end |
#eql?(other) ⇒ Boolean Also known as: ==
437 438 439 |
# File 'lib/ffi/clang/cursor.rb', line 437 def eql?(other) Lib.are_equal(@cursor, other.cursor) != 0 end |
#exception_specification ⇒ Object
351 352 353 |
# File 'lib/ffi/clang/cursor.rb', line 351 def exception_specification Lib.get_cursor_exception_specification_type(@cursor) end |
#expansion_location ⇒ Object Also known as: location
122 123 124 |
# File 'lib/ffi/clang/cursor.rb', line 122 def expansion_location ExpansionLocation.new(Lib.get_cursor_location(@cursor)) end |
#explicit? ⇒ Boolean
495 496 497 |
# File 'lib/ffi/clang/cursor.rb', line 495 def explicit? Lib.is_explicit(@cursor) != 0 end |
#expression? ⇒ Boolean
82 83 84 |
# File 'lib/ffi/clang/cursor.rb', line 82 def expression? Lib.is_expression(kind) != 0 end |
#extent ⇒ Object
139 140 141 |
# File 'lib/ffi/clang/cursor.rb', line 139 def extent SourceRange.new(Lib.get_cursor_extent(@cursor)) end |
#file_location ⇒ Object
135 136 137 |
# File 'lib/ffi/clang/cursor.rb', line 135 def file_location FileLocation.new(Lib.get_cursor_location(@cursor)) end |
#find_by_kind(recurse, *kinds) ⇒ Object
321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/ffi/clang/cursor.rb', line 321 def find_by_kind(recurse, *kinds) unless (recurse == nil || recurse == true || recurse == false) raise("Recurse parameter must be nil or a boolean value. Value was: #{recurse}") end result = Array.new self.each(recurse) do |child, parent| if kinds.include?(child.kind) result << child end end result end |
#find_references_in_file(file = nil, &block) ⇒ Object
335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/ffi/clang/cursor.rb', line 335 def find_references_in_file(file = nil, &block) file ||= Lib.extract_string Lib.get_translation_unit_spelling(@translation_unit) visit_adapter = Proc.new do |unused, cxcursor, cxsource_range| block.call Cursor.new(cxcursor, @translation_unit), SourceRange.new(cxsource_range) end visitor = FFI::Clang::Lib::CXCursorAndRangeVisitor.new visitor[:visit] = visit_adapter Lib.find_references_in_file(@cursor, Lib.get_file(@translation_unit, file), visitor) end |
#forward_declaration? ⇒ Boolean
246 247 248 249 250 251 252 253 254 |
# File 'lib/ffi/clang/cursor.rb', line 246 def forward_declaration? # Is this a forward declaration for a definition contained in the same translation_unit? # https://joshpeterson.github.io/identifying-a-forward-declaration-with-libclang # # Possible alternate implementations? # self.declaration? && !self.definition? && self.definition # !self.definition? && self.definition self.declaration? && !self.eql?(self.definition) && !self.definition.invalid? end |
#hash ⇒ Object
442 443 444 |
# File 'lib/ffi/clang/cursor.rb', line 442 def hash Lib.get_cursor_hash(@cursor) end |
#included_file ⇒ Object
359 360 361 |
# File 'lib/ffi/clang/cursor.rb', line 359 def included_file File.new Lib.get_included_file(@cursor), @translation_unit end |
#invalid? ⇒ Boolean
106 107 108 |
# File 'lib/ffi/clang/cursor.rb', line 106 def invalid? Lib.is_invalid(kind) != 0 end |
#kind ⇒ Object
169 170 171 |
# File 'lib/ffi/clang/cursor.rb', line 169 def kind @cursor ? @cursor[:kind] : nil end |
#kind_spelling ⇒ Object
173 174 175 |
# File 'lib/ffi/clang/cursor.rb', line 173 def kind_spelling Cursor.kind_spelling @cursor[:kind] end |
#language ⇒ Object
276 277 278 |
# File 'lib/ffi/clang/cursor.rb', line 276 def language Lib.get_language @cursor end |
#lexical_parent ⇒ Object
264 265 266 |
# File 'lib/ffi/clang/cursor.rb', line 264 def lexical_parent Cursor.new Lib.get_cursor_lexical_parent(@cursor), @translation_unit end |
#linkage ⇒ Object
347 348 349 |
# File 'lib/ffi/clang/cursor.rb', line 347 def linkage Lib.get_cursor_linkage(@cursor) end |
#move_assignment_operator? ⇒ Boolean
491 492 493 |
# File 'lib/ffi/clang/cursor.rb', line 491 def move_assignment_operator? Lib.is_move_assignment_operator(@cursor) != 0 end |
#move_constructor? ⇒ Boolean
471 472 473 |
# File 'lib/ffi/clang/cursor.rb', line 471 def move_constructor? Lib.is_move_constructor(@cursor) != 0 end |
#mutable? ⇒ Boolean
475 476 477 |
# File 'lib/ffi/clang/cursor.rb', line 475 def mutable? Lib.is_mutable(@cursor) != 0 end |
#null? ⇒ Boolean
46 47 48 |
# File 'lib/ffi/clang/cursor.rb', line 46 def null? Lib.cursor_is_null(@cursor) != 0 end |
#num_args ⇒ Object
280 281 282 |
# File 'lib/ffi/clang/cursor.rb', line 280 def num_args Lib.get_num_args @cursor end |
#num_arguments ⇒ Object
433 434 435 |
# File 'lib/ffi/clang/cursor.rb', line 433 def num_arguments Lib.cursor_get_num_arguments(@cursor) end |
#num_overloaded_decls ⇒ Object
421 422 423 |
# File 'lib/ffi/clang/cursor.rb', line 421 def num_overloaded_decls Lib.get_num_overloaded_decls(@cursor) end |
#objc_type_encoding ⇒ Object
425 426 427 |
# File 'lib/ffi/clang/cursor.rb', line 425 def objc_type_encoding Lib.extract_string Lib.get_decl_objc_type_encoding(@cursor) end |
#opaque_declaration? ⇒ Boolean
241 242 243 244 |
# File 'lib/ffi/clang/cursor.rb', line 241 def opaque_declaration? # Is this a declaration that does not have a definition in the translation unit self.declaration? && !self.definition? && self.definition.invalid? end |
#overloaded_decl(i) ⇒ Object
417 418 419 |
# File 'lib/ffi/clang/cursor.rb', line 417 def overloaded_decl(i) Cursor.new Lib.get_overloaded_decl(@cursor, i), @translation_unit end |
#overriddens ⇒ Object
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/ffi/clang/cursor.rb', line 393 def overriddens cursor_ptr = FFI::MemoryPointer.new :pointer num_ptr = FFI::MemoryPointer.new :uint Lib.get_overridden_cursors(@cursor, cursor_ptr, num_ptr) num = num_ptr.get_uint(0) cur_ptr = cursor_ptr.get_pointer(0) overriddens = [] num.times { overriddens << Cursor.new(cur_ptr, @translation_unit) cur_ptr += Lib::CXCursor.size } Lib.dispose_overridden_cursors(cursor_ptr.get_pointer(0)) if num != 0 overriddens end |
#platform_availability(max_availability_size = 4) ⇒ Object
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/ffi/clang/cursor.rb', line 363 def platform_availability(max_availability_size = 4) availability_ptr = FFI::MemoryPointer.new(Lib::CXPlatformAvailability, max_availability_size) always_deprecated_ptr = FFI::MemoryPointer.new :int always_unavailable_ptr = FFI::MemoryPointer.new :int = FFI::MemoryPointer.new Lib::CXString = FFI::MemoryPointer.new Lib::CXString actual_availability_size = Lib.get_cursor_platform_availability( @cursor, always_deprecated_ptr, , always_unavailable_ptr, , availability_ptr, max_availability_size) availability = [] cur_ptr = availability_ptr [actual_availability_size, max_availability_size].min.times { availability << PlatformAvailability.new(cur_ptr) cur_ptr += Lib::CXPlatformAvailability.size } # return as Hash { always_deprecated: always_deprecated_ptr.get_int(0), always_unavailable: always_unavailable_ptr.get_int(0), deprecated_message: Lib.extract_string(Lib::CXString.new()), unavailable_message: Lib.extract_string(Lib::CXString.new()), availability: availability } end |
#preprocessing? ⇒ Boolean
114 115 116 |
# File 'lib/ffi/clang/cursor.rb', line 114 def preprocessing? Lib.is_preprocessing(kind) != 0 end |
#presumed_location ⇒ Object
127 128 129 |
# File 'lib/ffi/clang/cursor.rb', line 127 def presumed_location PresumedLocation.new(Lib.get_cursor_location(@cursor)) end |
#printing_policy ⇒ Object
161 162 163 |
# File 'lib/ffi/clang/cursor.rb', line 161 def printing_policy PrintingPolicy.new(cursor) end |
#private? ⇒ Boolean
98 99 100 |
# File 'lib/ffi/clang/cursor.rb', line 98 def private? Lib.cxx_get_access_specifier(@cursor) == :private end |
#protected? ⇒ Boolean
102 103 104 |
# File 'lib/ffi/clang/cursor.rb', line 102 def protected? Lib.cxx_get_access_specifier(@cursor) == :protected end |
#public? ⇒ Boolean
94 95 96 |
# File 'lib/ffi/clang/cursor.rb', line 94 def public? Lib.cxx_get_access_specifier(@cursor) == :public end |
#pure_virtual? ⇒ Boolean
213 214 215 |
# File 'lib/ffi/clang/cursor.rb', line 213 def pure_virtual? Lib.cxx_method_is_pure_virtual(@cursor) != 0 end |
#qualified_name ⇒ Object
147 148 149 150 151 152 153 154 155 |
# File 'lib/ffi/clang/cursor.rb', line 147 def qualified_name if self.kind != :cursor_translation_unit if self.semantic_parent.kind == :cursor_invalid_file raise(ArgumentError, "Invalid semantic parent: #{self}") end result = self.semantic_parent.qualified_name result ? "#{result}::#{self.spelling}" : self.spelling end end |
#raw_comment_text ⇒ Object
50 51 52 |
# File 'lib/ffi/clang/cursor.rb', line 50 def raw_comment_text Lib.extract_string Lib.cursor_get_raw_comment_text(@cursor) end |
#reference? ⇒ Boolean
78 79 80 |
# File 'lib/ffi/clang/cursor.rb', line 78 def reference? Lib.is_reference(kind) != 0 end |
#referenced ⇒ Object
256 257 258 |
# File 'lib/ffi/clang/cursor.rb', line 256 def referenced Cursor.new Lib.get_cursor_referenced(@cursor), @translation_unit end |
#references(file = nil) ⇒ Object
450 451 452 453 454 455 456 457 |
# File 'lib/ffi/clang/cursor.rb', line 450 def references(file = nil) refs = [] self.find_references_in_file(file) do |cursor, unused| refs << cursor :continue end refs end |
#result_type ⇒ Object
181 182 183 |
# File 'lib/ffi/clang/cursor.rb', line 181 def result_type Types::Type.create Lib.get_cursor_result_type(@cursor), @translation_unit end |
#semantic_parent ⇒ Object
260 261 262 |
# File 'lib/ffi/clang/cursor.rb', line 260 def semantic_parent Cursor.new Lib.get_cursor_semantic_parent(@cursor), @translation_unit end |
#specialized_template ⇒ Object
229 230 231 |
# File 'lib/ffi/clang/cursor.rb', line 229 def specialized_template Cursor.new Lib.get_specialized_cursor_template(@cursor), @translation_unit end |
#spelling ⇒ Object
157 158 159 |
# File 'lib/ffi/clang/cursor.rb', line 157 def spelling Lib.extract_string Lib.get_cursor_spelling(@cursor) end |
#spelling_location ⇒ Object
131 132 133 |
# File 'lib/ffi/clang/cursor.rb', line 131 def spelling_location SpellingLocation.new(Lib.get_cursor_location(@cursor)) end |
#statement? ⇒ Boolean
86 87 88 |
# File 'lib/ffi/clang/cursor.rb', line 86 def statement? Lib.is_statement(kind) != 0 end |
#static? ⇒ Boolean
205 206 207 |
# File 'lib/ffi/clang/cursor.rb', line 205 def static? Lib.cxx_method_is_static(@cursor) != 0 end |
#template_kind ⇒ Object
268 269 270 |
# File 'lib/ffi/clang/cursor.rb', line 268 def template_kind Lib.get_template_cursor_kind @cursor end |
#to_s ⇒ Object
446 447 448 |
# File 'lib/ffi/clang/cursor.rb', line 446 def to_s "Cursor <#{self.kind.to_s.gsub(/^cursor_/, '')}: #{self.spelling}>" end |
#translation_unit? ⇒ Boolean
110 111 112 |
# File 'lib/ffi/clang/cursor.rb', line 110 def translation_unit? Lib.is_translation_unit(kind) != 0 end |
#type ⇒ Object
177 178 179 |
# File 'lib/ffi/clang/cursor.rb', line 177 def type Types::Type.create Lib.get_cursor_type(@cursor), @translation_unit end |
#underlying_type ⇒ Object
185 186 187 |
# File 'lib/ffi/clang/cursor.rb', line 185 def Types::Type.create Lib.(@cursor), @translation_unit end |
#unexposed? ⇒ Boolean
118 119 120 |
# File 'lib/ffi/clang/cursor.rb', line 118 def unexposed? Lib.is_unexposed(kind) != 0 end |
#usr ⇒ Object
165 166 167 |
# File 'lib/ffi/clang/cursor.rb', line 165 def usr Lib.extract_string Lib.get_cursor_usr(@cursor) end |
#variadic? ⇒ Boolean
197 198 199 |
# File 'lib/ffi/clang/cursor.rb', line 197 def variadic? Lib.is_variadic(@cursor) != 0 end |
#virtual? ⇒ Boolean
209 210 211 |
# File 'lib/ffi/clang/cursor.rb', line 209 def virtual? Lib.cxx_method_is_virtual(@cursor) != 0 end |
#virtual_base? ⇒ Boolean
189 190 191 |
# File 'lib/ffi/clang/cursor.rb', line 189 def virtual_base? Lib.is_virtual_base(@cursor) != 0 end |
#visit_children(&block) ⇒ Object
304 305 306 |
# File 'lib/ffi/clang/cursor.rb', line 304 def visit_children(&block) each(false, &block) end |