getEnums: Get the top-level enumeration definitions in a translation...

View source: R/enums.R

getEnumsR Documentation

Get the top-level enumeration definitions in a translation unit

Description

This function processes a source file or translation unit and returns the enumerated constant definitions it contains.

Usage

getEnums(src, fileFilter = character(), visitor = genEnumCollector(), ...)

Arguments

src

either the name of a source file or an already parsed translation unit object

fileFilter

a character vector. This is used to identify the files/directories of interest and to identify the cursors we want in the results. This can be a single string that is a regular expression. Alternatively, it can be a vector of directory or file names. For a vector of values, we check which correspond to actual file or directory names. For these, we filter the cursors based on whether they are in the specified file names, within files in the specified directories. For elements that are not files or directories, we use these as regular expressions. This mechanism allows us to include cursors by explicit file name, explicit directory, or by regular expression.

visitor

a function or S4/reference class object used as the visitor function passed to visitCursor to collect the enumeration definitions.

...

arguments passed createTU if src is the name of source file.

Value

A list of enumeration definition objects.

Author(s)

Duncan Temple Lang

References

libclang http://clang.llvm.org/doxygen/group__CINDEX.html

See Also

getRoutines, getDataStructures, getCppClasses

Examples

f = system.file("exampleCode", "enums.c",  package = "RCIndex")
getEnums(f)

omegahat/RClangSimple documentation built on May 10, 2024, 5:32 a.m.