lines of code (LOC)?

Hello,

Is there a way to measure the source code lines of a certain CXXRecordDecl object (counting also redeclarations of methods)? I mean if you know if someone has implemented something similar or there is a method in the Clang APÎ to this end.

This would be really useful to me.

Thanks.