This is in reply to the OP and other posters: I work under Windows and was looking for an indent as well. This is what I learned:
I tried bcpp. It seems to be quite old (more or less from 1996) and you need to find a windows exe. I found one here: http://www.zeusedit.com/zforum/viewtopic.php?t=1067. Still I think it's not really worth the bother, since it can only do space/tab, indentation level and brace conversion.
Then there is Artistic Style, which is newer and on sourceforge. It seems to be quite capable, but it can not, for example, reformat spaces around function names and parameters (like, turn if ( a ( b ) )
into if (a(b))
.
I like Cygwin indent ( http://www.cygwin.com/ ) best, but it works only well on newline separated files, so you have to use it like "dos2unix < infile | indent ...". But indent will not reformat boxed comments... :)
Maybe a combi of Artistic Style and Cygwin indent works best. Now I use this command line: astyle --style=kr -s3 --break-closing-brackets < infile.cpp | dos2unix | indent --no-tabs --k-and-r-style --indent-level 3 --dont-cuddle-else | unix2dos
. I bit long, I agree, but apart from that it produces a very good result. :)