Yi.
Yi.

Reputation: 322

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

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

Upvotes: 3

Views: 1713

Answers (3)

fmsf
fmsf

Reputation: 37137

I dunno if doxygen --> http://www.doxygen.nl/ does it, but I wouldn't be surprised if it also does that.

It generates documentation from the header files + javadoc like comments.

It will find the functions also so that kinda is counting.

Upvotes: 0

Vinay
Vinay

Reputation: 4783

You can write the Visual Studio plugin. In which you can access each class, and each methods in it. This uses COM technology and Visual studio extensibility feature.

EDIT: I have never seen the tag cocoa in question. This answer applies only to Visual studio

Upvotes: 0

Johannes Schaub - litb
Johannes Schaub - litb

Reputation: 506905

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

Upvotes: 8

Related Questions