code conform

L

Lars Schouw

I would like to rename a bunch of function names and variables in my
source code from my_fun to MyFun
and the soure code files from my_fun.cpp to MyFun.cpp

What is the easiest wat to do this for aound 500 files?

Lars
 
I

Ian Collins

Lars said:
I would like to rename a bunch of function names and variables in my
source code from my_fun to MyFun
and the soure code files from my_fun.cpp to MyFun.cpp

What is the easiest wat to do this for aound 500 files?
That all depends on your platform, ask on a platform specific group as
this is more of an OS question than a C++ one.
 
K

Kai-Uwe Bux

Lars said:
I would like to rename a bunch of function names and variables in my
source code from my_fun to MyFun
and the soure code files from my_fun.cpp to MyFun.cpp

What is the easiest wat to do this for aound 500 files?

Probably a script in sed / awk / perl / ..., (all of which are off-topic in
this group).


Best

Kai-Uwe Bux
 
J

James Kanze

That all depends on your platform, ask on a platform specific
group as this is more of an OS question than a C++ one.

The "Unix" toolkit is pretty universal now adays (there are at
least three packagings for Windows), so it doesn't really depend
on the OS. But the answer (which is relatively simple based on
find, xargs and sed) still isn't on topic here.

More interesting would be if he has a name like foo_bar, which
is used in some contexts as a function, and in others as a data
type, and he wants to change it into FooBar when it's a
function, and fooBar when it is data. That would probably
require a full C++ front end.
 
O

osmium

:

That all depends on your platform, ask on a platform specific
group as this is more of an OS question than a C++ one.

The "Unix" toolkit is pretty universal now adays (there are at
least three packagings for Windows), so it doesn't really depend
on the OS. But the answer (which is relatively simple based on
find, xargs and sed) still isn't on topic here.

<Internet Explorer had one of it's periodic hissy fits and didn't provide
proper > >.

You seem to be using Windows, as do I. If I had to do that I would think
seriously about doing it one of the Unix ways mentioned upstream, Windows
does very little to provide a nice environment for a serious programmer. I
guess the Windows way would start with a DOS batch file, and learning to do
that in this day and age seems as useful as studying calculus with roman
numerals.
 
G

Guest

I would like to rename a bunch of function names and variables in my
source code from my_fun to MyFun
and the soure code files from my_fun.cpp to MyFun.cpp

What is the easiest wat to do this for aound 500 files?

Look in you IDE if it has any refactoring functionality.
 
L

Lars Schouw

Look in you IDE if it has any refactoring functionality.

Do you know any IDE that has a refactoring tool that can do this on a
regular expression basis like this?

Lars
 
J

James Kanze

"James Kanze" wrote:
<Internet Explorer had one of it's periodic hissy fits and
didn't provide proper > >.

No problem. My editor has no trouble inserting them.
You seem to be using Windows, as do I. If I had to do that I
would think seriously about doing it one of the Unix ways
mentioned upstream, Windows does very little to provide a nice
environment for a serious programmer.

It doesn't claim to, at least out of the box. You buy a PC with
Windows, you have to add a lot of extra software if you want to
develope on it. Which is fair enough: most people who buy a PC
with Windows don't use it for program development.

One of the things you'll have to add for professional
programming is some sort of tool kit. I don't know of any that
aren't Unix-like today, so the choice really isn't there.
(Although I don't know: maybe just perl would be enough. Or
maybe even just Python. I've never had enough time to give them
a thorough try-out.)
I guess the Windows way would start with a DOS batch file, and
learning to do that in this day and age seems as useful as
studying calculus with roman numerals.

I think that the Windows way would be to install the proper tool
kit for what you want to do. It happens that much of this tool
kit comes bundled with Unix, for whatever reasons. (The market
traders where I work may use Sparc's with Solaris, but they
certainly never use sed or awk, even though it's bundled.)
 
L

Lars Schouw

No problem. My editor has no trouble inserting them.


It doesn't claim to, at least out of the box. You buy a PC with
Windows, you have to add a lot of extra software if you want to
develope on it. Which is fair enough: most people who buy a PC
with Windows don't use it for program development.

One of the things you'll have to add for professional
programming is some sort of tool kit. I don't know of any that
aren't Unix-like today, so the choice really isn't there.
(Although I don't know: maybe just perl would be enough. Or
maybe even just Python. I've never had enough time to give them
a thorough try-out.)


I think that the Windows way would be to install the proper tool
kit for what you want to do. It happens that much of this tool
kit comes bundled with Unix, for whatever reasons. (The market
traders where I work may use Sparc's with Solaris, but they
certainly never use sed or awk, even though it's bundled.)

--
James Kanze (GABI Software) email:[email protected]
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

I am using cygwin under Windows.. but also have access to Linux,
Solaris, HPUX etc.. so OS not a problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,197
Messages
2,571,038
Members
47,633
Latest member
BriannaLyk

Latest Threads

Top