module RbGCCXML

RbGCCXML, the library to parse and query C++ header code.

Public Class Methods

parse(files, options = {}) click to toggle source

Starting point to any RbGCCXML parsing project.

This method must be called after any calls to RbGCCXML.gccxml_path= or RbGCCXML.add_include_paths. Files can be one of many formats (and should always be full directory paths):

"/path/to/file.h"

"/dir/glob /*.h"

or an array of either of the above.

options can be any of:

includes: A single string, or an array of strings of directory includes (-I directives)
cxxflags: A single string, or an array of strings of other command line flags

Returns the Namespace Node linked to the global namespace “::”.

# File lib/rbgccxml/rbgccxml.rb, line 24
def parse(files, options = {})
  options.merge!(:files => files)
  @parser = Parser.new options
  @parser.parse
end
parse_xml(filename) click to toggle source

Use this call to parse a pregenerated GCC-XML file.

Returns the Namespace Node linked to the global namespace “::”.

# File lib/rbgccxml/rbgccxml.rb, line 33
def parse_xml(filename)
  @parser = Parser.new :pregenerated => filename
  @parser.parse
end