Is it possible to change the formatting of generated code? I'm thinking specifically of C++ and the placement of { and }.
I've looked at the Code Generation templates and left in a hurry
Good afternoon, Paolo.
I don't blame you, I'm pretty intimidated by the Code Generation templates myself.
I have managed to figure out a few things, with the help of the folks on this forum.
You mentioned specifically the placement of { and }. I had the same problem, in that our coding standard requires the Allman / ANSI style (opening brace on the next line) whereas EA by default supports the K&R style (opening brace on the same line as the controlling statement).
I fixed that by going to the Operation Body code generation template. On the very first line is the following:
{\n
I changed that by adding a "\n" at the beginning, i.e. "\n{\n" and that moved the opening brace to where I needed it.
I'm pretty sure that there is a safeguard against irretrievably messing up the code generation templates. SOMEBODY PLEASE CORRECT ME IF I'M WRONG ON THIS, but I believe the "Delete" button at the bottom deletes ONLY YOUR CHANGES and restores the template to its default contents. Like I said, I hope someone will correct me if I'm wrong on that... it seems like "Delete" is a bit of a misnomer in that case.
I'm still using version 7.1 (I don't like to change versions of my tools in the middle of a project unless there is a good reason to do it), and I don't know if what I described above is directly applicable to 7.5.
Hope this is helpful...