A Script or Utility Needed!

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

A Script or Utility Needed!

Postby mastersquirrel » Wed May 18, 2005 10:21 am

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?
User avatar
mastersquirrel
 
Posts: 696
Joined: Thu Oct 07, 2004 10:55 am
Location: I saw a squirrel! ...... It was going like this!!!

Postby Mithrandir » Wed May 18, 2005 4:51 pm

Quite a few text editers can do grep style find-and-replace across multiple files which might work. Have you experimented with that?
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby mastersquirrel » Thu May 19, 2005 10:31 am

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.
User avatar
mastersquirrel
 
Posts: 696
Joined: Thu Oct 07, 2004 10:55 am
Location: I saw a squirrel! ...... It was going like this!!!

Postby Kaligraphic » Thu May 19, 2005 11:28 am

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.
The cake used to be a lie like you, but then it took a portal to the deception core.
User avatar
Kaligraphic
 
Posts: 2002
Joined: Wed Jul 21, 2004 12:00 pm
Location: The catbox of DOOM!

Postby mastersquirrel » Thu May 19, 2005 11:40 am

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?
User avatar
mastersquirrel
 
Posts: 696
Joined: Thu Oct 07, 2004 10:55 am
Location: I saw a squirrel! ...... It was going like this!!!

Postby Kaligraphic » Thu May 19, 2005 12:09 pm

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.
The cake used to be a lie like you, but then it took a portal to the deception core.
User avatar
Kaligraphic
 
Posts: 2002
Joined: Wed Jul 21, 2004 12:00 pm
Location: The catbox of DOOM!


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 188 guests