getCppClasses: Retrieve information about C++ classes

View source: R/cppClass.R View source: R/cppClass.R

getCppClassesR Documentation

Retrieve information about C++ classes

Description

These functions obtain information about C++ classes in a source file or translation unit.

Usage

getCppClasses(tu, fileFilter = character(), nodesOnly = FALSE, numClasses = 100,
                 ...)

Arguments

tu

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.

nodesOnly

a logical value that controls whether we just want the cursors for the C++ class definitions or whether we want full descriptions of the classes.

numClasses

a guess as to the number of classes that are in the translation unit. This is only used to pre-allocate space to store them and is available only for efficiency.

...

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

Value

A named list of C++Class objects.

Author(s)

Duncan Temple Lang

References

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

See Also

getRoutines, getGlobalVariables, getDataStructures, getEnums, getInclusions

Examples

f = system.file("exampleCode", "simpleClass.cpp", package = "RCIndex")
kl = getCppClasses(f)
names(kl)

omegahat/RClangSimple documentation built on Aug. 17, 2024, 10:23 a.m.