learnvst
learnvst

Reputation: 16195

Is there a tool for automatic conversion of header into cpp and hpp files?

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

Answers (2)

Pete Becker
Pete Becker

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

Synxis
Synxis

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

Related Questions