c++ - 在大型项目中按名称查找函数的最佳方法是什么?

标签 c++ c function find

假设我们有一个包含 100 个文件的项目(例如一个库),每个文件包含大约 1000 行代码。 你想找到函数 awesome_foo(...) 你怎么做呢?老实说,我发现 grepping 它令人毛骨悚然且无效......

编辑:我主要寻找函数定义

最佳答案

grep -irnw "awesome_foo"* 肯定会给你结果。

参数是:

-i, --ignore-case

Ignore case distinctions in both the PATTERN and the input files.

-n, --line-number

Prefix each line of output with the line number within its input file.

-R, -r, --recursive

Read all files under each directory, recursively; this is equivalent to the -d recurse option.

-w, --word-regexp

Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word con- stituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word- constituent characters are letters, digits, and the underscore.

关于c++ - 在大型项目中按名称查找函数的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16234116/

相关文章:

c++ - 为什么在C++阶乘函数中出现编译错误?

python - 相当于 Python 或 MYSQL 中的 Excel Goal Seek 函数

c - 查找字符串中的公共(public)字符

c++ - DirectX 11 - 如何创建非常简单的 2D 纹理

c++ - goto 跨越初始化

将通用指针转换为 int 指针以进行优化

C: 链表节点的malloc (struct within struct)

c++ - 这段代码中的 ~0 是什么意思?

c++ - 使用递归而不是循环

c - 如何在 Gstreamer 中修改音频流的播放速度?