7

I have lots of header files with long method implementation inside.

Is there An automatic way of doing that?

One-by-one can take a lot of time...

Thanks.

2
  • 4
    You can easily create a script in some other language (or even use C++ if you want to do that). I am unaware of anything that does that automatically for you though. Commented Jun 15, 2011 at 19:16
  • 4
    @Peter R.: I don't think that creating a script that parses C++ good enough to do this job is done easily! Commented Jun 15, 2011 at 20:43

4 Answers 4

4

If you are using Visual Studio, there's an add-in called Visual Assist that can help you to do this. I'm using it at work and it is really helpful.

Unfortunately this add-in is not free but you can install the trial to do your stuff and test it.

Sign up to request clarification or add additional context in comments.

3 Comments

I know about Visual Assist. It does require me to review all the header files and click a lot... You can't even set a hotkey...
@Tsury: Most Visual Assist commands can be bound to any keybinding you want via Tools | Options | Environment | Keyboard. Show commands containing: VAssistX.Refactor
Visual Studio can also do it without Visual Assist. The feature is marked as experimental though. You can use it by pressing Ctrl + . and then choosing Move definition location.
2

In Eclipse CDT its combination is Alt+Shift+T

1 Comment

:s Im getting: Cannot work without declarator...
1

KDevelop has such ability too:

Right click to the method -> Refactoring -> Move to cpp

Comments

0

There's a free version of DevExpress Refactor! for C++ that has two automatic 'refactorings' that may suit your needs:

  • Move Method to Source File
  • Move Method to Header

Refactorings Reference link

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.