How to rename a class

Is their a better way to rename a c++ class then:

  • create a new class
  • copy the old one in there
  • rename all (in solution)
  • remove the old class
  • then clean build?

Actually you don’t need to create a new file and delete the old one, just rename it.
As for updating all solution I honestly don’t know if there’s like an automation tool to do it.

My worry is that deleting a class has to be manually done as we know.

It supposed to be cumbersome to implement a delete functionality. In my logic the same must be true for renaming the class (not file).

Haven’t tried it yet due to the fact UE is a bit overwelming, too much to take into account at once.
(Okay, admitted I am new to UE but not to coding in general or c++)

editted for readability, oeps

I’ve had to do this a few times, its not that bad. Something like Visual Assist helps in these situations.

if you have VA installed, it goes something like this:

  • Right Click on Class name in the class header file -> Refactor(VA) -> Rename
  • Double click on file in the Solution explorer, and rename the file there.
  • Close solution, Regenerate Project Solution, and Re-open.

If you have source control installed you’ll need to obviously check out the files that changed (and the ones that were renamed may need special attention), but besides that it’s pretty simple.