Page 1 of 1

A Script or Utility Needed!

PostPosted: Wed May 18, 2005 10:21 am
by mastersquirrel
I'm looking for a utility or script for C++ that will take many different pieces of code and put a function header in each of them. I just want something that will be able to add new parts to the header if a new function is used. Does anyone know of something like that which would be easy to get?

PostPosted: Wed May 18, 2005 4:51 pm
by Mithrandir
Quite a few text editers can do grep style find-and-replace across multiple files which might work. Have you experimented with that?

PostPosted: Thu May 19, 2005 10:31 am
by mastersquirrel
Mithrandir wrote:Quite a few text editers can do grep style find-and-replace across multiple files which might work. Have you experimented with that?

No, I haven't but I'm not sure if it could do what I want.

This is the basic setup for what I want:

//////////////////////////////////////////////////////////////////////////////
//
// Function: FunctionName
//
// Parameters: para1 - *Space here for quick definition*
// para2 - *Space here for quick definition*
// para3 - *Space here for quick definition*
//
// Description: *Area here for programmer to enter a*
// *description of what the function does*
//
//////////////////////////////////////////////////////////////////////////////

FunctionName ( para1, para2, para3 )


Something along those lines. A utility or script that will insert the function block in comment form a space above the actual function so that the programmers can easily enter the information needed to basically explain what the function does and what it needs.
Thank you.


Edit: Great, my text is all centered so I can't tell if you're seeing what I want you to see. If yours looks all wierd tell me.

PostPosted: Thu May 19, 2005 11:28 am
by Kaligraphic
Put that in a file, and when you go to program, copy it to your clipboard. Above each function, paste it in.

On the other hand, if you really need this kind of block, you might want to check your naming conventions.

PostPosted: Thu May 19, 2005 11:40 am
by mastersquirrel
The thing is that most of the code is already made, and there are lots different function names and lots of C++ code. Even if I were to paste this above every function it would take a good while to go and change all the function names and parameters. I'd like to just get a program that could actually do that itself.

Anything come to mind?

PostPosted: Thu May 19, 2005 12:09 pm
by Kaligraphic
You'd have to go to each one to edit the description, anyway, so it's not much more work. Unless you want the program to figure out what the function does for you.