Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6794267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:12:06+00:00 2026-05-26T18:12:06+00:00

I need to have some of my C++ classes, functions and namespaces renamed as

  • 0

I need to have some of my C++ classes, functions and namespaces renamed as a part of my build script, which is runned by my CI system.

Unfortunatly a simple sad/awk/gsar/… technique is not enough, and I need smart rename refactoring, that carefully analyses my code.

Actually I found out, that CDT C/C++ rename refactoring does, what I need. But it does it from Eclipse IDE. So I need to find a way to start it from command line, and to make it a part of my CI build script.

I know that Eclipse has eclipsec executable, that allowes running some Eclipse functions from command line (see e.g. here).

But I can’t find any suitable documentation for functions, CDT exports to command line. The only thing, I found is the this. But it doesn’t solve my problem.

So, I need help to run CDT rename refactoring from command line (or someway like that). If it is not possible, may be someone will advice another tool, that can do rename refactoring for C++ from command line ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:12:07+00:00Added an answer on May 26, 2026 at 6:12 pm

    Pragmatic Approach

    “I need to have renamed as a part of my build script”

    This sounds a bit like a design problem. However, I remember having been guilty of the same sin once writing a C++ application on AIX/Win32: most notably, I wanted to be able to link ‘conflicting’ versions of shared objects. I solved it using a simple preprocessor hack like this:

    # makefile
    
    #if($(ALTERNATIVE))
        CPPFLAGS+=-DLIBNAMESPACE=MYLIB_ALTERNATIVE
    #else
        CPPFLAGS+=-DLIBNAMESPACE=MYLIB
    #endif
    
    ./obj64/%.o: %cpp
         xlC++ $(CPPFLAGS) $^ -o %@
    

    Sample source/header file:

    namespace MYLIB
    {
         class LibService :
         {
         };
    }
    

    As you can see, this required only a single

    find -iname '*.[hc]pp' -o -iname '*.[hc]' -print0 |
         xargs -0 sed -i 's/OldNamespace/MYLIB/g'
    

    Eclipse Automation

    You could have a look at eclim, which does most, if not all, of what you describe, however it targets the vim editor.

    What eclim boasts, is full eclipse intergration (completion, refactoring, usage search etc.) from an external program. I’m not fully up to speed with the backend of eclim, but I do know that it works with a eclimd server process that exposes the service interface used by the vim plugin.

    I suspect you should be able to reuse the code from eclimd if not just use eclim for your purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some classes which are parameterized via their constructor. I need to provide
I have some functionality that I need in all my classes which derive from
I have an application which has some classes that handle some specific functions, have
I have some classes that, for one reason or another, cannot be or need
I have some NSManagedObject classes created for use with CoreData I need to add
I have a OCaml library with lots of classes I need some translator to
I am trying to create some classes which only contain data members (no functions)
I have some POCO classes which can generally divided into two groups, for example:
Lets say you have some functions in some classes are called together like this
I need to have some object hanging around between two events I'm interested in:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.