Reputation: 16195
I have a (possibly bad) habit of coding everything into a monolithic header file when trying out ideas, placing all implementation code with the class definitions. As the code expands, it becomes difficult to navigate the file. Therefore, I refactor the code into separate files and split the implementation details (cpp files) from the interface (hpp files).
The laborious copy / pasting involved seems like a job for a machine. Are there any simple tools available for this task?
Upvotes: 3
Views: 4032
Reputation: 76305
This kind of thing is quite common. My approach is to only cut and paste once: make a copy of the original file, then chop stuff from the header and chop other stuff from the source file.
Upvotes: 0
Reputation: 9388
You can try Lazy C++, as stated in this question.
You can also use a standard IDE, and move each function from header to source (for Visual Studio you can use Visual Assist, I think Eclipse can do it straight), generally it's like right click > refactor > move to source or something like that.
Upvotes: 5