c++code-formattingastyle

formatting functions parameter


Are you aware of any tool or program that is able to beautify the function input parameters making the variable left-aligned like the example below?

I am having a look at A-Style right now. Do you know if it can do that job for me?

I would like to change from this code

      void foo(
         int a
         ,my_long_parameter b
         ,anotgher_type c
      );

to these one.

      void foo(
         int                 a
         ,my_long_parameter  b
         ,anotgher_type      c 
      );

Solution

  • Take a look into astyle. It does what you want (and more), but you have to set parameters.