Description Usage Arguments Author(s) See Also
This attempts to find the definitions of literal constants
that are created by the C/C++ pre-processor and not in the
C/C++ language. This finds entries such as
#define FOO 1
or #define STR "my string"
.
It does not handle conditional definitions, i.e. within #ifdef
statements.
This works by making a system call to grep on the files in the
target directory. (It does not work recursively, but could easily do
so if that was useful rather than excessive.)
It discards lines that start with a C++ comment or with #include.
Then it delegates the identification of literal constant definitions
to the internal function processDefines
which looks for
all lines that start with #define.
A "better" approach is to use getCppDefines
which works directly from the output of the pre-processor.
1 2 3 | getDefines(dir = character(), pattern = ".*", files = "*",
class = c("TopLevelConstants", "DefineConstants"),
removeDuplicates = TRUE, getSkipped = FALSE)
|
dir |
the directory containing the header files |
pattern |
pattern for |
files |
shell glob pattern to identify the files to search |
class |
the class of the resulting object. Currently ignored. |
removeDuplicates |
a logical value that controls whether to remove duplicate definitions, leaving the last ones. |
getSkipped |
a logical value. |
Duncan Temple Lang
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.