Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Counting the number of methods defined in a C++ header

Tags:

c++

Is there a tool to count the number of methods defined in a header? This seems like something that people would want to do from time to time, but I've never heard of such a utility. I could roll my own (and it'd be quite easy to come up with something that works for me in this particular case), but I thought I'd try stackoverflow first :)

Thanks, Yi

like image 852
Yi. Avatar asked Nov 17 '25 13:11

Yi.


1 Answers

Try this:

ctags --c++-kinds=f -x myfile.h

To list all functions in the file myfile.h . To count the number of functions in deque.tcc:

$ ctags --c++-kinds=f --language-force=c++ -x deque.tcc | wc -l
24
like image 83
Johannes Schaub - litb Avatar answered Nov 19 '25 02:11

Johannes Schaub - litb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!