473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

code conform

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

Nov 9 '07 #1
8 1276
Lars Schouw wrote:
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.

--
Ian Collins.
Nov 9 '07 #2
Lars Schouw wrote:
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
Nov 9 '07 #3
On Nov 9, 7:30 am, Ian Collins <ian-n...@hotmail.comwrote:
Lars Schouw wrote:
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.
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.

--
James Kanze (GABI Software) email:ja*********@gmail.com
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

Nov 9 '07 #4
"James Kanze" wrote:

On Nov 9, 7:30 am, Ian Collins <ian-n...@hotmail.comwrote:
Lars Schouw wrote:
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.
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.
Nov 9 '07 #5
On 2007-11-09 07:25, Lars Schouw wrote:
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.

--
Erik Wikström
Nov 9 '07 #6
On Nov 10, 2:01 am, Erik Wikström <Erik-wikst...@telia.comwrote:
On 2007-11-09 07:25, Lars Schouw wrote:
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.

--
Erik Wikström
Do you know any IDE that has a refactoring tool that can do this on a
regular expression basis like this?

Lars

Nov 10 '07 #7
On Nov 9, 3:55 pm, "osmium" <r124c4u...@comcast.netwrote:
"James Kanze" wrote:
On Nov 9, 7:30 am, Ian Collins <ian-n...@hotmail.comwrote:
Lars Schouw wrote:
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.
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 >.
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.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
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

Nov 10 '07 #8
On Nov 10, 9:47 pm, James Kanze <james.ka...@gmail.comwrote:
On Nov 9, 3:55 pm, "osmium" <r124c4u...@comcast.netwrote:
"James Kanze" wrote:
On Nov 9, 7:30 am, Ian Collins <ian-n...@hotmail.comwrote:
Lars Schouw wrote:
I would like to rename a bunch of function names and variables inmy
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.
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 >.

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.)

--
James Kanze (GABI Software) email:james.ka...@gmail.com
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.

Nov 10 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aleksandr Dubinskiy | last post by:
Hello folks, This question is a bit involved, so I am posting the code on the web, instead of cutting and pasting it on the email. http://www.cis.ohio-state.edu/~dubinski/Code/ I think the code...
0
by: Uday Deo | last post by:
Hi everyone, I have a .NET app invoking from the ASP page. It has to load bunch of data during first visit. The app works fine on the Staging and Prod server. This is the first time the company...
2
by: Cowboy (Gregory A. Beamer) - MVP | last post by:
We have an application right now that determines if an XML document sent in conforms to schema. What we have now been asked to do is add functionality that creates an exception report for all...
0
by: Gaurav | last post by:
Hi, I have a connection string "Data Source=db1.mynet;DATABASE=test;User ID=testuser;Password=test;" , when i use the connection string to get a dataset of all the tables of a database it...
1
by: openleren | last post by:
Hi all, with a little help from my friends, I am trying to construct a connectionstring from a relative path in web.config. It contains <add key="conAccess" value="microsoft.jet.oledb.4.0;data...
0
by: andy | last post by:
Hi all, Any help much appreciated - Andy I am trying to connect to a SQL Server DB using c#, ADO.Net mySqlConnection = new...
41
by: Jordan | last post by:
While writing some code, I realized I had never developed a consistent pattern for checking errors from a method. I have two styles I jump back and forth between, but I'm wondering which is...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
239
by: Eigenvector | last post by:
My question is more generic, but it involves what I consider ANSI standard C and portability. I happen to be a system admin for multiple platforms and as such a lot of the applications that my...
1
by: dalh | last post by:
Hi all, I'm developing an asp.net app that connect to a webservice. - I've installed an P7k certificate in the IIS-website configuration. When running my code, I have following error:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.