getFileName: CXCursor class and related methods

getFileNameR Documentation

CXCursor class and related methods

Description

These functions operate on CXCursor objects and allow us to query the type and content of the generic cursor.

A CXCursor object is a reference to a C data structure. While it is an opaque data type, we can treat it as a list to access some of its attributes/elements. The $ operator applied to a CXCursor allows us to access the "kind", "type", "language", "linkage", and "cxxSpecifier".

Usage

getFileName(x, ...)
getFileTime(SFile) 

Arguments

x, SFile

a CXFile object or something that can be coerced to that class, e.g. a cursor, a translation unit.

...

additional arguments for methods

Value

A string (character vector of length 1) giving the name of the file.

Author(s)

Duncan Temple Lang

References

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

See Also

getLocation

Examples

f = system.file("exampleCode", "fib.c", package = "RCIndex")
tu = createTU(f)
getFileName(tu)
getFileName(as(tu, "CXCursor"))

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