C++ files from a package

cpp_files(pkg = ".")

Arguments

pkg

The path to a package's root directory.

Value

A character vector of C++ files found in the package.

Examples

# Setup pkg <- tempfile() dir.create(file.path(pkg, "src"), recursive = TRUE) file.create(file.path(pkg, "src", "code.c"))
#> [1] TRUE
file.create(file.path(pkg, "src", "code.cpp"))
#> [1] TRUE
# List the files, only the C++ file will be listed cpp_files(pkg)
#> [1] "/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpJ3FHMn/file8995e83073/src/code.cpp"
# Cleanup unlink(pkg, recursive = TRUE)