Module: Clangc

Defined in:
ext/clangc/clangc.c,
lib/clangc.rb

Defined Under Namespace

Classes: Cursor, Diagnostic, File, Index, SourceLocation, SourceRange, TranslationUnit, Type

Class Method Summary (collapse)

Class Method Details

+ (Object) default_code_complete_options

+ (Object) default_diagnostic_display_options

+ (Object) default_editing_translation_unit_options

+ (Object) null_cursor

+ (Object) null_source_location

+ (Object) null_source_range

+ (Object) version

+ (Object) visit_children(args)

:call-seq: Clangc.visit_children(Hash)

This is a convenient method that call Clangc.visit_children_with_proc or Clangc.visit_children_with_block. the Hash arguments can accept two keys:

  • cursor

  • visitor

    Clangc.visit_children(cursor: acursor, visitor: aproc)
    
    Clangc.visit_children(cursor: acursor) do |cursor, parent|
      #do your stuf
      return Clangc::ChildVisitResult::Recurse
      #return Clangc::ChildVisitResult::Break
    end
    


21
22
23
24
25
26
27
28
29
30
31
# File 'lib/clangc.rb', line 21

def self.visit_children(args)
  cursor = args[:cursor]
  callback = args[:visitor] || nil
  if(callback)
    visit_children_with_proc(cursor, callback)
  else
    visit_children_with_block(cursor) do |cursor, parent|
      yield(cursor, parent)
    end
  end
end

+ (Object) visit_children_with_block

+ (Object) visit_children_with_proc