getFunctions: Get descriptions of the routines in a translation unit

getFunctionsR Documentation

Get descriptions of the routines in a translation unit

Description

These synonomous functions retrieve a description of each top-level native routine in the target source code, i.e. the translation unit.

Usage

getFunctions(src, fileFilter = character(), expectedNum = 500, ...)

Arguments

src

the already created CXTranslationUnit object, or the name of the source file

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.

expectedNum

the expected number of routines. This should be at least as larger than the

...

any additional arguments passed to createTU if src is not already a CXTranslationUnit.

Value

A named list of objects describing a native routine. Each element is currently of class FunctionDecl.

Author(s)

Duncan Temple Lang

References

libclang

See Also

createTU, parseTU, getEnums, getDataStructures, visitCursor

Examples

src = system.file("exampleCode", "func.c", package = "RCIndex")
r = getRoutines(src)
r
names(r)

omegahat/RClangSimple documentation built on April 25, 2024, 4:18 a.m.