Does anyone know of a tool which can beautify C++ code to add brackets to conditional statements? What I need to do is change:
if ( myCondition )
setDateTime( date, time );
to
if ( myCondition )
{
setDateTime( date, time );
}
but I've got to do this hundreds of times. I could probably write something in perl but don't want to go down this road if there's already a tool. I've used AStyle but I couldn't find how to do this with it.
Apart from meeting the clients coding standards, the reason I want to do this is that I have to replace certain calls such as the above call to setDateTime( date, time ) with setDate( date ) and setTime( time ) which I can easily enough do with regular expressions but ends up like this:
if ( myCondition )
setDate( date );
setTime( time );
Obviously not right!!!