Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Refactoring - Move method to implementation file

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.

like image 438
Tsury Avatar asked Jun 15 '11 19:06

Tsury


People also ask

What is Move method in refactoring?

Move Method Refactoring (MMR) refers to moving a method from one class to the class in which the method is used the most often. Manually inspecting and analyzing the source code of the system under consideration to determine the methods in need of MMR is a costly and time-consuming process.

How do I move a method in Intellij?

Open your class in the editor, place a caret at the static method you want to move and press F6 . In the Move Members dialog specify the following options: In the Members to be moved to another class (static only) field, select the checkboxes next to the methods that you want to move to another class.

How do you move a method from one class to another in python?

If you go to each method and right-click on its name, the menu has a "Refactor" option, which leads to a "Move" option. Select that and follow the instructions. The above is especially easy for static methods. For the non-static ones, you may need to do subclassing, or pass references to the appropriate objects around.


2 Answers

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.

like image 106
Patrice Bernassola Avatar answered Oct 06 '22 04:10

Patrice Bernassola


In Eclipse CDT its combination is Alt+Shift+T

like image 43
Sergei Krivonos Avatar answered Oct 06 '22 02:10

Sergei Krivonos