Function list

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
anubis@chez.com

Function list

Post by anubis@chez.com »

I am looking for a functionality to list the functions of a C++ file (as in Ultraedit). I found the java add-on to list the functions of a java file. But does anybody know a way to do that ? Thanks.
Nathan

Re: Function list

Post by Nathan »

A properly structured (if large) regular expression can handle the task.
I use a couple of macros to accomplish something like this. First, one to bookmark all lines matching with "^function " or "^sub ". Once bookmarked, I have another macro that append-copies each line and un-bookmarks it, running to the end of the file.
Of course, C++ function declarations are a lot more complex than perl, vb, or jscript functions, but the same technique should work just fine. Now, one difficulty might be in marking functions returning user data types or pointers to such. Another would be when arguments are placed on more than one line.
I hope this will help some.
anubis@chez.com

Re: Function list

Post by anubis@chez.com »

Thanks Nathan.

Finally I use the "ctags" program (http://darren.hiebert.com/ctags/) as a tool in Textpad.
With "-x -u --c++-types=f $file" as parameters, I have all the functions of the c++ file and by capturing the output I can jump to the right line of the file.

Regards.
Post Reply