+ Line endings in the formatted file will be the same as the input file. If there are mixed line endings the most
+ frequent occurrence will be used. There is also an option to specify or change the line endings.
+
+
+
File Type
+
+
+ Artistic Style will determine the file type from the file extension. The extension ".java" indicates a Java file,
+ and ".cs" indicates a C# file. Everything else is a C type file (C, C++, C++/CLI, or Objective-C). If you are
+ using a non-standard file extension for Java or C#, use one of the --mode= options.
+
+
+
Wildcards and Recursion
+
+
+ Artistic Style can process directories recursively. Wildcards (such as "*.cpp" or "*.c??") are processed internally.
+ If a shell is used it should pass the wildcards to Artistic Style instead of resolving them first. For Linux use
+ double quotes around paths whose file name contains wildcards. For Windows use double quotes around paths whose
+ file name contains spaces. The recursive option in the
+ Other Options section contains information on recursive processing.
+
+
+
File Names
+
+
+ When a file is formatted, the newly indented file retains the original file name. A copy of the original file
+ is created with an .orig appended to the original file name. (This can be set to
+ a different string by the option --suffix=, or suppressed altogether by the options -n
+ or --suffix=none). Thus, after indenting SourceFile.cpp the indented file will
+ be named SourceFile.cpp, while the original pre-indented file will be renamed to SourceFile.cpp.orig.
+
+
+
Internationalization
+
+
+ Artistic Style has been internationalized to process files and directories in any language.
+
+
+ It has also been translated into several languages. The translation to use is determined from the User Locale
+ for Windows and the LANG environment variable for other systems. The translation will be done automatically from
+ these settings. If no translation is available it will default to English. There is an ascii option to use English
+ instead of the system language.
+
+
+ The source code for the translations is at the end of ASLocalizer.cpp in the form of an English‑Translation
+ pair. If you make corrections to a translation, send the source as a bug report and it will be included in the
+ next release.
+
+
+ To add a new language, add a new translation class to ASLocalizer.h. Add the English‑Translation pair to
+ the constructor in ASLocalizer.cpp. Update the WinLangCode array and add the language code to the function setTranslationClass().
+ The ASLocalizer.cpp program contains comments that give web pages for obtaining the LCIDs and language codes.
+ Send the source code as a bug report and it will be included in the next release.
+
+
+
Other Considerations
+
+
+ The names of special characters used in programming vary by region. The terminology used by Artistic Style,
+ followed by other common names, is:
+
+
+ brackets { } ‑ also called braces, curly brackets, or curly braces.
+ parens ( ) ‑ also called parentheses, brackets, round brackets, circle brackets, or soft brackets.
+ block parens [ ] ‑ also called brackets, square brackets, closed brackets, or hard brackets.
+ angle brackets < > ‑ also called brackets, pointy brackets, triangular brackets, diamond brackets, tuples,
+ or chevrons.
+
+
+ Artistic Style can format standard class library statements such as Open GL, wxWidgets, Qt, and MFC.
+
+
+ Embedded assembler language is formatted correctly. This includes extended assembly and Microsoft specific assembler
+ lines and blocks.
+
+
+ Artistic Style can format embedded SQL statements. The SQL formatting will be maintained as long as the standard
+ hanging indent format is used. If the "exec sql" statement is indented more than the following statements, the
+ SQL will be aligned in a single column.
+
+
+ Unicode files encoded as UTF‑16, both big and little endian, will be formatted. The files must begin with
+ a byte order mark (BOM) to be recognized. Files encoded as UTF‑32 will be rejected. Some compilers do not
+ support these encodings. These files can be converted to UTF‑8 encoding with the program "iconv". There
+ are Linux and Windows versions available (the Windows version does not seem to work for all encodings). A sample
+ command line is "iconv ‑f UTF‑16 ‑t UTF‑8 < filein.cpp > fileout.cpp. Visual
+ Studio can convert the files from the "File > Advanced Save Options" menu. Then select encoding "Unicode (UTF‑8
+ with signature) - Codepage 65001". There are other development environments and text editors, such as SciTE, that
+ can convert files to UTF‑8.
+
+
+ Embedded statements that are multiple-line and are NOT in a C-type format, such as Python, are usually mal-formatted
+ (a C-type format has blocks enclosed by brackets and statements terminated by a semi-colon). Macros that define
+ functions may cause the following code to be mal-formatted because the macro is missing the brackets and semi-colons
+ from the definition. If you have source code with these types of statements, exclude them with the
+ exclude=#### option described in the Other Options section.
+
+
+
+
+
+
+
+
+
Quick Start
+
+
+ If you have never used Artistic Style there are a couple of ways to start.
+
+
+ One is to run it with no options at all. This will use the default bracket
+ style, 4 spaces per indent, and no formatting changes. This will break the brackets for one
+ line blocks and will break one line statements. To change this use the option
+ keep-one-line-blocks and/or
+ keep-one-line-statements described in the
+ Formatting Options section
+
+
+ Another way is to use one of the bracket styles described in the Bracket Style
+ Options section. Select one with a bracket formatting style you like. If no indentation option is set,
+ the default option of 4 spaces will be used. These options also break one line blocks and one line statements
+ as described above.
+
+
+ Once you are familiar with the options you can customize the format to your personal preference.
+
+
+
+
+
+
+
+
+
Usage
+
+
+ Artistic style is a console program that receives information from the command line. The format of the command
+ line is:
+
+ The block parens [ ] indicate that more than one option or more than one file name can be entered. They are NOT
+ actually included in the command. For the options format see the following Options section.
+
+ This option can be used to display the formatted file without updating:
+
+
astyle [OPTIONS] < OriginalSourceFile | less
+
+
+ The < and > characters are used
+ to redirect the files into standard input (cin) and out of standard output (cout) - don't forget them! With this
+ option only one file at a time can be formatted. Wildcards are not recognized, there are no console messages,
+ and a backup is not created. On Windows the output will always have Windows line ends.
+
+
+
+
+
+
+
+
+
Options
+
+
+ Not specifying any options will result in the default bracket style,
+ 4 spaces per indent, and no formatting changes.
+
+
+ Options may be written in two different ways.
+
+
+
Long options
+
+
+ These options start with '--', and must be written one at a time.
+ (Example: '--style=allman --indent=spaces=4')
+
+
+
Short Options
+
+
+ These options start with a single '-', and may be concatenated together.
+ (Example: '-bps4' is the same as writing '-b -p -s4'.)
+
+
+
+
+
+
+
+
+
Options File
+
+
+ An OPTIONAL default options file may be used to supplement or replace the command line options.
+
+
+
The command line options have precedence. If there is a conflict between a command line option and an option in
+ the default options file, the command line option will be used.
+
+
Artistic Style looks for this file in the following locations (in order):
+
+
the file indicated by the --options= command line option;
+
the file and directory indicated by the environment variable ARTISTIC_STYLE_OPTIONS (if it exists);
+
the file named .astylerc in the directory pointed to by the HOME environment variable (e.g. "$HOME/.astylerc"
+ on Linux);
+
+
the file named astylerc in the directory pointed to by the USERPROFILE environment variable (e.g. "%USERPROFILE%\astylerc"
+ on Windows).
+
+
+
+
This option file lookup can be disabled by specifying --options=none on the command line.
+
Options may be set apart by new-lines, tabs, commas, or spaces.
+
Long options in the options file may be written without the preceding '--'.
+
Lines within the options file that begin with '#' are considered line-comments.
+
+
+ Example of a default options file:
+
+
+
# this line is a comment
+--style=allman # this is a line-end comment
+# long options can be written without the preceding '--'
+indent-switches # cannot do this on the command line
+# short options must have the preceding '-'
+-t -p
+# short options can be concatenated together
+-M60Ucv
+
+
+
+
+
+
+
+
+
+
+ Disable Formatting
+
+
+
+ Formatting and indenting can be disabled with comment tags inserted in the source code.
+
+
+
+ Disable Block
+
+
+
+ Blocks of code can be disabled using "off" and "on" tags. The tags are included in the source
+ file as comments. The comment may be a C comment (/* ... */) or a C++ line comment (//). The tag must be included
+ in a single line comment. If the comment exceeds one line the indent tag will be ignored. Additional information
+ can be included with the tag.
+
+
+ The beginning tag is "*INDENT-OFF*" and the ending tag is "*INDENT-ON*".
+ They may be used anywhere in the program with the following condition; parsing is partially disabled between the
+ tags. Disabling partial statements may result in incorrect formatting after the ending tag. If this happens expand
+ the tags to include additional code.
+
+
+
+ The following retains the format of a preprocessor define:
+
+ Artistic Style cannot always determine the usage of symbols with more than one meaning. For example an asterisk
+ (*) can be multiplication, a pointer, or a pointer dereference. The "&" and "&&"
+ symbols are a similar
+ problem.
+
+
+ If a symbol is being padded incorrectly, padding it manually may fix the problem. If it is still being
+ padded incorrectly, then disabling the formatting may be necessary. To avoid having to use the "disable block"
+ tags above, a single line disable is available.
+
+
+ A line-end comment tag "*NOPAD* will disable the "pad-oper", "align-pointer", and "align-reference"
+ options. Parsing does NOT stop and all other formatting will be applied to the line. The tag applies to the
+ one line only.
+
+
+
+ The following prevents the operator padding from changing:
+
+
size_t foo = (unsigned int) -1; // *NOPAD*
+
+
+
+
+
+
+
+
+
Bracket Style Options
+
+
+ Bracket Style options define the bracket style to use. All options default to 4 spaces per indent, indented with
+ spaces.
+ By default, none of the styles indent namespaces. Other indentations are indicated in the individual style
+ description. All options will break the brackets for one line blocks and will break one line statements. To change
+ this
+ use the option keep-one-line-blocks and/or
+ keep-one-line-statements described in the Formatting Options section
+
+
+
+
+
+ default bracket style
+ If no bracket style is requested, the default bracket style will be used. The opening brackets are not changed
+ and the closing brackets will be broken from the preceding line. There are a few exceptions to this.
+
+ --style=kr / --style=k&r / --style=k/r / -A3
+ Kernighan & Ritchie style uses linux brackets. Opening brackets are broken from namespaces, classes, and function
+ definitions. Brackets are attached to everything else including statements within a function, arrays, structs,
+ and enums.
+
+
+ Using the k&r option may cause problems because of the &. This can be resolved by enclosing the k&r
+ in quotes (e.g. ‑‑style="k&r") or by using one of the alternates ‑‑style=kr or ‑‑style=k/r.
+
+ --style=stroustrup / -A4
+ Stroustrup style uses stroustrup brackets. Brackets are broken from function definitions only. Brackets are attached
+ to everything else including namespaces, classes, and statements within a function, arrays, structs, and enums.
+ This style frequently is used with an indent of 5 spaces.
+
+ --style=whitesmith / -A5
+ Whitesmith style uses broken, indented brackets. Switch blocks and class blocks are indented to prevent a 'hanging
+ indent' with following case statements and C++ class modifiers (public, private, protected).
+
+ --style=vtk / -A15
+ VTK (Visualization Toolkit) style uses broken, indented brackets, except for the opening bracket. Switch blocks
+ are indented to prevent a 'hanging indent' with following case statements.
+
+ --style=banner / -A6
+ Banner style uses attached, indented brackets. Switch blocks and class blocks are indented to prevent a 'hanging
+ indent' with following case statements and C++ class modifiers (public, private, protected).
+
+ --style=linux / --style=knf / -A8
+ Linux style uses linux brackets. Opening brackets are broken from namespace, class, and function
+ definitions. Brackets are attached to everything else including statements within a function, arrays, structs,
+ and enums. Minimum conditional indent is one-half indent. If you want a different minimum conditional
+ indent use the K&R style instead. This style works best with a large indent. It frequently is used with an
+ indent of 8 spaces.
+
+
+ Also known as Kernel Normal Form (KNF) style, this is the style used in the Linux kernel.
+
+ --style=horstmann / -A9
+ Horstmann style uses run-in brackets. Brackets are broken and allow run-in statements.
+ Switches are indented to allow a run-in to the opening switch block. This style frequently is used with an indent
+ of 3 spaces.
+
+ --style=1tbs / --style=otbs / -A10
+ "One True Brace Style" uses linux brackets and adds brackets to unbracketed one line conditional
+ statements. Opening brackets are broken from namespaces, classes, and function definitions. Brackets are attached
+ to everything else including statements within a function, arrays, structs, and enums.
+
+
+ In the following example brackets have been added to the "return 0;" statement. The option
+ ‑‑add‑one‑line‑brackets can also be used with this style.
+
+ --style=google / -A14
+ Google style uses attached brackets and indented class access modifiers. See the indent-modifiers
+ option for an example of the indented modifiers format. This style frequently is used with an indent of 2 spaces.
+
+ --style=pico / -A11
+ Pico style uses run-in brackets and attached closing brackets. Opening brackets are broken
+ and allow run-in statements. The closing bracket is attached to the last line in the block. Switches are indented
+ to allow a run-in to the opening switch block. The style implies keep-one-line-blocks and keep-one-line-statements.
+ If add-brackets is used they will be added as one-line brackets. This style frequently is used with an indent
+ of 2 spaces.
+
+
+
int Foo(bool isBar)
+{ if (isBar)
+ { bar();
+ return 1; }
+ else
+ return 0; }
+
+
+
+
+
+
+ --style=lisp / --style=python / -A12
+ Lisp style uses attached opening and closing brackets. Opening brackets are attached at the
+ end of the statement. The closing bracket is attached to the last line in the block. The style implies keep-one-line-statements
+ but NOT keep-one-line-blocks. This style does not support one-line brackets. If add-one-line-brackets is used
+ they will be added as multiple-line brackets.
+
+ The following examples show whitespace characters. A space is indicated with a . (dot), a tab
+ is indicated by a > (greater than).
+
+
+ default indent
+ If no indentation option is set, the default option of 4 spaces will be used (e.g. -s4
+ --indent=spaces=4
+ ).
+
+
+
+ with default values:
+
+
void Foo() {
+....if (isBar1
+............&& isBar2) // indent of this line can be changed with min-conditional-indent
+........bar();
+}
+
+
+
+
+
+
+ --indent=spaces / --indent=spaces=# / -s#
+ Indent using # spaces per indent (e.g. -s3--indent=spaces=3
+ ). # must be between 2 and 20. Not specifying # will result in a default of
+ 4 spaces per indent.
+
+
+
+ with indent=spaces=3
+
+
void Foo() {
+...if (isBar1
+.........&& isBar2) // indent of this line can be changed with min-conditional-indent
+......bar();
+}
+
+
+
+
+
+
+ --indent=tab / --indent=tab=# / -t / -t#
+ Indent using tabs for indentation, and spaces for continuation line alignment. This ensures that
+ the code is displayed correctly regardless of the viewer’s tab size. Treat each indent as # spaces
+ (e.g. -t6 / --indent=tab=6).
+ # must be between 2 and 20. If no # is set, treats indents as 4 spaces.
+
+
+
+ with indent=tab:
+
+
void Foo() {
+> if (isBar1
+> ........&& isBar2) // indent of this line can be changed with min-conditional-indent
+> > bar();
+}
+
+
+ with style=linux, indent=tab=8:
+
+
void Foo()
+{
+> if (isBar1
+> ....&& isBar2) // indent of this line can NOT be changed with style=linux
+> > bar();
+}
+
+
+
+
+
+
+ --indent=force-tab / --indent=force-tab=# / -T / -T#
+ Indent using all tab characters, if possible. If a continuation line is not an even number of
+ tabs, spaces will be added at the end. Treat each tab as # spaces (e.g. -T6
+ / --indent=force-tab=6). # must be between
+ 2 and 20. If no # is set, treats tabs as 4 spaces.
+
+
+
+ with indent=force-tab:
+
+
void Foo() {
+> if (isBar1
+> > > && isBar2) // indent of this line can be changed with min-conditional-indent
+> > bar();
+}
+
+
+
+
+
+
+ --indent=force-tab-x / --indent=force-tab-x=# / -xT / -xT#
+
+ This force-tab option allows the tab length to be set to a length that is different than the indent length. This
+ may cause the indentation to be a mix of both tabs and spaces. Tabs will be used to indent, if
+ possible. If a tab indent cannot be used, spaces will be used instead.
+
+
+ This option sets the tab length. Treat each tab as # spaces (e.g. -xT6
+ / --indent=force-tab-x=6). # must be between
+ 2 and 20. If no # is set, treats tabs as 8 spaces. To change the indent length from the default
+ of 4 spaces the option "indent=force-tab" must also be used.
+
+
+
+ with indent=force-tab-x (default tab length of 8 and default indent length of 4):
+
+
void Foo() {
+....if (isBar1
+> ....&& isBar2) // indent of this line can be changed with min-conditional-indent
+> bar();
+}
+
+
+
+
+
+
+
+
+
+
Bracket Modify Options
+
+
+ --attach-namespaces / -xn
+ Attach brackets to a namespace statement. This is done regardless of the bracket style being used.
+
+
+
+ the bracket is always attached to a namespace statement:
+
+
namespace FooName {
+...
+}
+
+
+
+
+
+
+ --attach-classes / -xc
+ Attach brackets to a class statement. This is done regardless of the bracket style being used.
+
+
+
+ the bracket is always attached to a class statement:
+
+
class FooClass {
+...
+};
+
+
+
+
+
+
+ --attach-inlines / -xl
+ Attach brackets to class and struct inline function definitions. This is not done for run-in type brackets (Horstmann
+ and Pico styles). This option is effective for C++ files only.
+
+
+
+ all brackets are always attached to class and struct inline function definitions:
+
+
class FooClass
+{
+ void Foo() {
+ ...
+ }
+};
+
+
+
+
+
+
+ --attach-extern-c / -xk
+ Attach brackets to a bracketed extern "C" statement. This is done regardless of the bracket style being used.
+ This option is effective for C++ files only.
+
+
+ An extern "C" statement that is part of a function definition is formatted according to the requested bracket
+ style. Bracketed extern "C" statements are unaffected by the bracket style and this option is the only way to
+ change them.
+
+
+
+ this option attaches brackets to a bracketed extern "C" statement:
+
+
#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ but function definitions are formatted according to the requested bracket style:
+
+
extern "C" EXPORT void STDCALL Foo()
+{}
+
+
+
+
+
+
+
+
+
+
Indentation Options
+
+
+ --indent-classes / -C
+ Indent 'class' and 'struct' blocks so that the entire block is indented. The struct
+ blocks are indented only if an access modifier, 'public:', 'protected:' or 'private:',
+ is declared somewhere in the struct. This option is effective for C++ files only.
+
+ --indent-modifiers / -xG
+ Indent 'class' and 'struct' access modifiers, 'public:', 'protected:'
+ and 'private:', one half indent. The rest of the class is not indented. This option is effective
+ for C++ files only. If used with indent‑classes this option will be ignored.
+
+ --indent-switches / -S
+ Indent 'switch' blocks so that the 'case X:' statements are indented in the switch
+ block. The entire case block is indented.
+
+ --indent-labels / -L
+ Add extra indentation to labels so they appear 1 indent less than the current indentation, rather than being flushed
+ to the left (the default).
+
+ --indent-preproc-block / -xW
+ Indent preprocessor blocks at bracket level zero, and immediately within a namespace. There are restrictions on
+ what will be indented. Blocks within methods, classes, arrays, etc, will not be indented. Blocks containing brackets
+ or multi-line define statements will not be indented. Without this option the preprocessor block is not indented.
+
+ --indent-preproc-define / -w
+ Indent multi-line preprocessor definitions ending with a backslash. Should be used with --convert-tabs for proper
+ results. Does a pretty good job, but cannot perform miracles in obfuscated preprocessor definitions. Without this
+ option the preprocessor statements remain unchanged.
+
+ --indent-preproc-cond / -xw
+ Indent preprocessor conditional statements to the same level as the source code.
+
+
+
isFoo = true;
+#ifdef UNICODE
+ text = wideBuff;
+#else
+ text = buff;
+#endif
+
+ becomes:
+
+
isFoo = true;
+ #ifdef UNICODE
+ text = wideBuff;
+ #else
+ text = buff;
+ #endif
+
+
+
+
+
+
+ --indent-col1-comments / -Y
+ Indent C++ comments beginning in column one. By default C++ comments beginning in column one are
+ assumed to be commented‑out code and not indented. This option will allow the comments to be indented with
+ the code.
+
+ --min-conditional-indent=# / -m#
+ Set the minimal indent that is added when a header is built of multiple lines. This indent helps to easily separate
+ the header from the command statements that follow. The value for #
+ indicates a number of indents and is a minimum value. The indent may be greater to align with
+ the data on the previous line.
+ The valid values are:
+ 0 - no minimal indent. The lines will be aligned with the paren on the preceding line.
+ 1 - indent at least one additional indent.
+ 2 - indent at least two additional indents.
+ 3 - indent at least one-half an additional indent. This is intended for large indents (e.g. 8).
+ The default value is 2, two additional indents.
+
+
+
// default setting makes this non-bracketed code clear
+if (a < b
+ || c > d)
+ foo++;
+
+// but creates an exaggerated indent in this bracketed code
+if (a < b
+ || c > d)
+{
+ foo++;
+}
+
// setting makes this non-bracketed code less clear
+if (a < b
+ || c > d)
+ foo++;
+
+// but makes this bracketed code clearer
+if (a < b
+ || c > d)
+{
+ foo++;
+}
+
+
+
+
+
+
+ --max-instatement-indent=# / -M#
+ Set the maximum of # spaces to indent a continuation line. The
+ # indicates a number of columns and must not be less than 40 nor greater than 120.
+ If no value is set, the default value of 40 will be
+ used. This option will prevent continuation lines from
+ extending too far to the right. Setting a larger value will allow the code to be extended further to the right.
+
+ --pad-oper / -p
+ Insert space padding around operators. This will also pad commas. Any end of line comments will remain in the
+ original column, if possible. Note that there is no option to unpad. Once padded, they stay padded.
+
+
+
if (foo==2)
+ a=bar((b-c)*a,d--);
+
+
+ becomes:
+
+
if (foo == 2)
+ a = bar((b - c) * a, d--);
+
+
+
+
+
+
+ --pad-comma / -xg
+ Insert space padding after commas. This is not needed if pad-oper is used. Any end of line comments will remain
+ in the original column, if possible. Note that there is no option to unpad. Once padded, they stay padded.
+
+
+
if (isFoo(a,b)
+ bar(a,b);
+
+
+ becomes:
+
+
if (isFoo(a, b)
+ bar(a, b);
+
+
+
+
+
+
+ --pad-paren / -P
+
+ Insert space padding around parenthesis on both the outside and the inside.
+ Any end of line comments will remain in the original column, if possible.
+
+
+
if (isFoo((a+2), b))
+ bar(a, b);
+
+
+ becomes:
+
+
if ( isFoo ( ( a+2 ), b ) )
+ bar ( a, b );
+
+
+
+
+
+
+ --pad-paren-out / -d
+
+ Insert space padding around parenthesis on the outside only. Parentheses that are empty will
+ not be padded. Any end of line comments will remain in the original column, if possible. This can be used with
+ unpad-paren below to remove unwanted spaces.
+
+
+
if (isFoo((a+2), b))
+ bar(a, b);
+
+
+ becomes:
+
+
if (isFoo ( (a+2), b) )
+ bar (a, b);
+
+
+
+
+
+
+ --pad-first-paren-out / -xd
+
+ Insert space padding around the first parenthesis in a series on the outside
+ only. Parentheses that are empty will not be padded. Any end of line comments will remain in the original column,
+ if possible. This can be used with unpad-paren below to remove unwanted spaces. If used with pad‑paren or
+ pad‑paren‑out, this option will be ignored. If used with pad‑paren‑in, the result will
+ be the same as pad‑paren.
+
+
+
if (isFoo((a+2), b))
+ bar(a, b);
+
+
+ becomes:
+
+
if (isFoo ((a+2), b))
+ bar (a, b);
+
+
+
+
+
+
+ --pad-paren-in / -D
+
+ Insert space padding around parenthesis on the inside only. Any end of line comments will remain
+ in the original column, if possible. This can be used with unpad-paren below to remove unwanted spaces.
+
+
+
if (isFoo((a+2), b))
+ bar(a, b);
+
+
+ becomes:
+
+
if ( isFoo( ( a+2 ), b ) )
+ bar( a, b );
+
+
+
+
+
+
+ --pad-header / -H
+
+ Insert space padding between a header (e.g. 'if', 'for', 'while'...)
+ and the following paren. Any end of line comments will remain in the original column, if possible. This can
+ be used with unpad-paren to remove unwanted spaces.
+
+
+
if(isFoo((a+2), b))
+ bar(a, b);
+
+ becomes:
+
+
if (isFoo((a+2), b))
+ bar(a, b);
+
+
+
+
+
+
+ --unpad-paren / -U
+
+ Remove extra space padding around parenthesis on the inside and outside. Any end of line comments will remain
+ in the original column, if possible. This option can be used in combination with the paren padding options pad‑paren,
+ pad‑paren‑out, pad‑paren‑in, and pad‑header
+ above. Only padding that has not been requested by other options will be removed.
+
+
+ For example, if a source has parens padded on both the inside and outside, and you want inside only. You need
+ to use unpad-paren to remove the outside padding, and pad‑paren‑in to retain
+ the inside padding. Using only pad‑paren‑in would not remove the outside padding.
+
+
+
if ( isFoo( ( a+2 ), b ) )
+ bar ( a, b );
+
+
+ becomes (with no padding option requested):
+
+
if(isFoo((a+2), b))
+ bar(a, b);
+
+
+
+
+
+
+ --delete-empty-lines / -xe
+ Delete empty lines within a function or method. Empty lines outside of functions or methods are NOT deleted. If
+ used with break-blocks or break-blocks=all it will delete all lines EXCEPT the lines added by the break-blocks
+ options.
+
+
+
void Foo()
+{
+
+ foo1 = 1;
+
+ foo2 = 2;
+
+}
+
+
+ becomes:
+
+
void Foo()
+{
+ foo1 = 1;
+ foo2 = 2;
+}
+
+
+
+
+
+
+ --fill-empty-lines / -E
+ Fill empty lines with the white space of the previous line.
+
+
+
+
+
+ --align-pointer=type / -k1
+ --align-pointer=middle / -k2
+ --align-pointer=name / -k3
+
+ Attach a pointer or reference operator (*, &, or ^) to either the variable type (left) or variable name (right),
+ or place it between the type and name (middle). The spacing between the type and name will be preserved, if possible.
+ This option is for C/C++, C++/CLI, and C# files. To format references separately use the following align-reference
+ option.
+
+
+
char* foo1;
+char & foo2;
+String ^s1;
+
+ becomes (with align-pointer=type):
+
+
char* foo1;
+char& foo2;
+String^ s1;
+
+
+
char* foo1;
+char & foo2;
+String ^s1;
+
+ becomes (with align-pointer=middle):
+
+
char * foo1;
+char & foo2;
+String ^ s1;
+
+
+
char* foo1;
+char & foo2;
+String ^s1;
+
+ becomes (with align-pointer=name):
+
+
char *foo1;
+char &foo2;
+String ^s1;
+
+
+
+
+
+ --align-reference=none / -W0
+ --align-reference=type / -W1
+ --align-reference=middle / -W2
+ --align-reference=name / -W3
+
+ This option will align references separate from pointers. Pointers are not changed by this option. If pointers
+ and references are to be aligned the same, use the previous align-pointer option. The option align-reference=none
+ will not change the reference alignment. The other options are the same as for align-pointer. This option is for
+ C/C++, C++/CLI, and C# files.
+
+
+
char &foo1;
+
+ becomes (with align-reference=type):
+
+
char& foo1;
+
+
+
char& foo2;
+
+ becomes (with align-reference=middle):
+
+
char & foo2;
+
+
+
char& foo3;
+
+ becomes (with align-reference=name):
+
+
char &foo3;
+
+
+
+
+
+
+
+
+
Formatting Options
+
+
+ --break-closing-brackets / -y
+
+ When used with --style=java, --style=kr, --style=stroustrup, --style=linux, or --style=1tbs, this breaks closing
+ headers (e.g. 'else', 'catch', ...) from their immediately preceding closing brackets. Closing header brackets
+ are always broken with the other styles.
+
+ --break-elseifs / -e
+ Break "else if" header combinations into separate lines. This option has no effect if keep-one-line-statements
+ is used, the "else if" statements will remain as they are.
+
+
+ If this option is NOT used, "else if" header combinations will be placed on a single line.
+
+
+
if (isFoo) {
+ bar();
+}
+else if (isFoo1()) {
+ bar1();
+}
+else if (isFoo2()) {
+ bar2;
+}
+
+
+ becomes:
+
+
if (isFoo) {
+ bar();
+}
+else
+ if (isFoo1()) {
+ bar1();
+ }
+ else
+ if (isFoo2()) {
+ bar2();
+ }
+
+
+
+
+
+
+ --add-brackets / -j
+
+ Add brackets to unbracketed one line conditional statements (e.g. 'if', 'for',
+ 'while'...). The statement must be on a single line. The brackets will be added according to
+ the currently requested predefined style or bracket type. If no style or bracket type is requested the brackets
+ will be attached. If --add-one-line-brackets is also used the result will be one line brackets.
+
+
+
if (isFoo)
+ isFoo = false;
+
+
+ becomes:
+
+
if (isFoo) {
+ isFoo = false;
+}
+
+
+
+
+
+
+ --add-one-line-brackets / -J
+
+ Add one line brackets to unbracketed one line conditional statements (e.g. 'if', 'for',
+ 'while'...). The statement must be on a single line. The option implies --keep-one-line-blocks and
+ will not break the one line blocks.
+
+
+
if (isFoo)
+ isFoo = false;
+
+
+ becomes:
+
+
if (isFoo)
+ { isFoo = false; }
+
+
+
+
+
+
+ --remove-brackets / -xj
+ Remove brackets from conditional statements (e.g. 'if', 'for', 'while'...).
+ The statement must be a single statement on a single line. If --add-brackets or --add-one-line-brackets is also
+ used the result will be to add brackets. Brackets will not be removed from "One True Brace Style", --style=1tbs.
+
+ --convert-tabs / -c
+ Converts tabs into spaces in the non-indentation part of the
+ line. The number of spaces inserted will maintain the spacing of the tab. The current setting for spaces per tab
+ is used. It may not produce the expected results if convert-tabs is used when changing spaces per tab. Tabs are
+ not replaced in quotes.
+
+
+
+
+
+ --close-templates / -xy
+ Closes whitespace in the angle brackets of template definitions. Closing the ending angle brackets is now allowed
+ by the C++11 standard. Be sure your compiler supports this before making the changes.
+
+
+
Stack< int,List< int > > stack1;
+
+ becomes:
+
+
Stack<int,List<int>> stack1;
+
+
+
+
+
+ --remove-comment-prefix / -xp
+ Remove the preceding '*' in a multi-line comment that begins a line. A trailing '*', if present, is also removed.
+ Text that is less than one indent is indented to one indent. Text greater than one indent is not changed. Multi-line
+ comments that begin a line but without the preceding '*' are indented to one indent for consistency. This can
+ slightly modify the indentation of commented out blocks of code. Lines containing all '*' are left unchanged.
+ Extra spacing is removed from the comment close '*/'.
+
+
+
/*
+ * comment line 1
+ * comment line 2
+ */
+
+ becomes:
+
+
/*
+ comment line 1
+ comment line 2
+*/
+
+
+
+
+
+ --max-code-length=# / -xC#
+
+ --break-after-logical / -xL
+ The option max‑code‑length will break a line if the code exceeds #
+ characters. The valid values are 50 thru 200. Lines without logical conditionals will break on a logical conditional
+ (||, &&, ...), comma, paren, semicolon, or space.
+
+
+ Some code will not be broken, such as comments, quotes, and arrays. If used with keep‑one‑line‑blocks
+ or add-one-line-brackets the blocks will NOT be broken. If used with keep‑one‑line‑statements
+ the statements will be broken at a semicolon if the line goes over the maximum length. If there is no available
+ break point within the max code length, the line will be broken at the first available break point after the max
+ code length.
+
+
+ By default logical conditionals will be placed first on the new line. The option break‑after‑logical
+ will cause the logical conditionals to be placed last on the previous line. This option has no effect without
+ max‑code‑length.
+
+ --mode=c
+ --mode=cs
+ --mode=java
+ Indent a C type, C#, or Java file. C type files are C, C++, C++/CLI, and Objective-C. The option is usually
+ set from the file extension for each file. You can override the setting with this entry. It will be used for all
+ files regardless of the file extension. It allows the formatter to identify language specific syntax such as C++
+ classes, templates, and keywords.
+
+
+
+
+
+
+
+
+
Objective‑C Options
+
+
+ These options are effective for Objective‑C files only. The paren padding options will still apply to the
+ Objective-C method prefix and return type unless overridden by the following options.
+
+
+ Because of the longer indents sometimes needed for Objective‑C, the option "max-instatement-indent" may
+ need to be increased. If you are not getting the paren and square bracket alignment you want try increasing this
+ value. The option is described in the "Indentation Options" section.
+
+
+ --pad-method-prefix / -xQ
+ Insert space padding after the '-' or '+' Objective‑C method prefix. This will add exactly
+ one space. Any additional spaces will be deleted. This option takes precedence over the pad-paren options.
+
+
+
-(void)foo1;
++(void)foo2;
+
+ becomes:
+
+
- (void)foo1;
++ (void)foo2;
+
+
+
+
+
+ --unpad-method-prefix / -xR
+ Remove all space padding after the '-' or '+' Objective‑C method prefix.
+ This option will be ignored if used with pad‑method‑prefix. It takes precedence over the pad-paren
+ options.
+
+
+
- (void)foo1;
++ (void)foo2;
+
+ becomes:
+
+
-(void)foo1;
++(void)foo2;
+
+
+
+
+
+ --pad-return-type / -xq
+ Insert space padding after the Objective‑C return type. This will add exactly one
+ space. Any additional spaces will be deleted. This option takes precedence over the pad-paren options.
+
+
+
-(void)foo1;
++(void)foo2;
+
+ becomes:
+
+
-(void) foo1;
++(void) foo2;
+
+
+
+
+
+ --unpad-return-type / -xr
+ Remove all space padding after the Objective‑C return type. This option
+ will be ignored if used with pad‑return‑type. It takes precedence over the pad-paren options.
+
+
+
-(void) foo1;
++(void) foo2;
+
+ becomes:
+
+
-(void)foo1;
++(void)foo2;
+
+
+
+
+
+ --align-method-colon / -xM
+ Align the colons in Objective‑C method declarations.
+
+ --pad-method-colon=none / -xP0
+ --pad-method-colon=all / -xP1
+ --pad-method-colon=after / -xP2
+ --pad-method-colon=before / -xP3
+
+ Add or remove space padding before or after the colons in an Objective‑C method call. These options will
+ pad exactly one space. Any additional spaces will be deleted.
+
+
+
+ with pad-method-colon=none:
+
+
[node insertKey:key];
+
+ with pad-method-colon=all:
+
+
[node insertKey : key];
+
+ with pad-method-colon=after:
+
+
[node insertKey: key];
+
+ with pad-method-colon=before:
+
+
[node insertKey :key];
+
+
+
+
+
+
+
+
+
Other Options
+
+
+ These are non-formatting options available for the command-line. They can also be included in an options file.
+
+
+
+ --suffix=####
+ Append the suffix #### instead of '.orig' to original file name (e.g. --suffix=.bak).
+ If this is to be a file extension, the dot '.' must be included. Otherwise the suffix will be appended to the
+ current file extension.
+
+
+ --suffix=none / -n
+ Do not retain a backup of the original file. The original file is purged after it is formatted.
+
+
+ --recursive / -r / -R
+ For each directory in the command line, process all subdirectories recursively. When using the recursive option
+ the file name statement should contain a wildcard. Linux users should place the file path and name in double quotes
+ so the shell will not resolve the wildcards (e.g. "$HOME/src/*.cpp"). Windows users should place the file path
+ and name in double quotes if the path or name contains spaces.
+
+
+ --dry-run
+ Perform a trial run with no changes made to the files. The report will be output as usual.
+
+
+ --exclude=####
+ Specify a file or sub directory #### to be excluded from processing.
+
+
+ Excludes are matched from the end of the file path. An exclude option of "templates" will exclude ALL directories
+ named "templates". An exclude option of "cpp/templates" will exclude ALL "cpp/templates" directories. You may
+ proceed backwards in the directory tree to exclude only the required directories.
+
+
+ Specific files may be excluded in the same manner. An exclude option of "default.cpp" will exclude ALL files named
+ "default.cpp". An exclude option of "python/default.cpp" will exclude ALL files named "default.cpp" contained
+ in a "python" subdirectory. You may proceed backwards in the directory tree to exclude only the required files.
+
+
+ Wildcards are NOT allowed. There may be more than one exclude statement. The file path and name may be placed
+ in double quotes (e.g. ‑‑exclude="foo bar.cpp").
+
+
+ --ignore-exclude-errors / -i
+ Allow processing to continue if there are errors in the "exclude=###" options.
+ This option lets the excludes for several projects be entered in a single option file. This option may be placed
+ in the same option file as the excludes. It will display the unmatched excludes. The following option will not
+ display the unmatched excludes.
+
+
+ --ignore-exclude-errors-x / -xi
+ Allow processing to continue if there are errors in the "exclude=###" options.
+ This option lets the excludes for several projects be entered in a single option file. This option may be placed
+ in the same option file as the excludes. It will NOT display the unmatched excludes. The preceding option will
+ display the unmatched excludes.
+
+
+ --errors-to-stdout / -X
+ Print errors to standard-output rather than to standard-error.
+ This option should be helpful for systems/shells that do not have a separate output to standard-error, such as
+ in Windows95.
+
+
+ --preserve-date / -Z
+ Preserve the original file's date and time modified. The time modified will be changed a few micro seconds to
+ force the changed files to compile. This option is not effective if redirection is used to rename the input file.
+
+
+ --verbose / -v
+ Verbose display mode. Display optional information, such as release number, date, and statistical data.
+
+
+ --formatted / -Q
+ Formatted files display mode. Display only the files that have been formatted. Do not display files that
+ are unchanged.
+
+ --lineend=windows / -z1
+ --lineend=linux / -z2
+ --lineend=macold / -z3
+
+ Force use of the specified line end style. Valid options are windows (CRLF), linux (LF), and macold (CR). MacOld
+ style is the format for Mac OS 9 and earlier. OS X uses the Linux style. If one of these options
+ is not used the line ends will be determined automatically from the input file.
+
+
+ When redirection is used on Windows the output will always have Windows line ends. This option
+ will be ignored.
+
+
+
+
+
+
+
+
+
Command Line Only
+
+
These options are available for the command-line only. They are NOT available in an options file.
+
+ --options=####
+ Specify an options file #### to read and use. It must contain a file path for the file. This will allow the file
+ name to be changed from astylerc or .astylerc.
+
+
+ --options=none
+ Disable the default options file. Only the command-line parameters will be used.
+
+
+ --ascii / -I
+ The displayed output will be ascii characters only. The text will be displayed in English and numbers will not
+ be formatted. The short option must be by itself, it cannot be concatenated with other options.
+
+
+ --version / -V
+ Print version number and quit. The short option must be by itself, it cannot be concatenated with other options.
+
+
+ --help / -h / -?
+ Print a help message and quit. The short option must be by itself, it cannot be concatenated with other options.
+
+
+ --html / -!
+ Open the HTML help
+ file "astyle.html" in the default browser and quit. The short option must be by itself, it
+ cannot be concatenated with other options. The documentation must be installed in the standard install path (/usr/share/doc/astyle/html
+ for Linux or %PROGRAMFILES%\AStyle\doc for Windows). If installed to a different path use html=###.
+
+
+ --html=####
+ Open a HTML help file in the default browser using the file path #### and quit. A HTML file other than "astyle.help"
+ may be specified. The path may include a directory path and a file name, or a file name only (e.g. html=install.html).
+ If only a file name is used it is assumed to be in the standard install path (/usr/share/doc/astyle/html
+ for Linux or %PROGRAMFILES%\AStyle\doc for Windows). In both cases the file name must include the html extension.
+ File paths containing spaces must be enclosed in quotes.
+
+
+ On Linux the HTML file is opened using the script "xdg-open" from the install package "xdg-utils". This should
+ be installed
+ by default on most distributions.
+
+
+ Any HTML file can be opened by this option. The files you are likely to need are astyle.html (the default), install.html,
+ and index.html.
+
+ Artistic Style is a source code indenter, formatter, and beautifier for the C, C++, C++/CLI, Objective‑C,
+ C# and Java programming languages.
+
+
+ When indenting source code, we as programmers have a tendency to use both spaces and tab characters to create
+ the wanted indentation. Moreover, some editors by default insert spaces instead of tabs when pressing the tab
+ key, and other editors (Emacs for example) have the ability to "pretty up" lines by automatically setting up the
+ white space before the code on the line, possibly inserting spaces in a code that up to now used only tabs for
+ indentation.
+
+
+ Since the NUMBER of space characters showed on screen for each tab character in the source code changes between
+ editors (unless the user sets up the number to his liking...), one of the standard problems programmers are facing
+ when moving from one editor to another is that code containing both spaces and tabs that was up to now perfectly
+ indented, suddenly becomes a mess to look at when changing to another editor. Even if you as a programmer take
+ care to ONLY use spaces or tabs, looking at other people's source code can still be problematic.
+
+
+ To address this problem, Artistic Style was created – a filter written in C++ that automatically re-indents
+ and re-formats C / C++ / Objective‑C / C++/CLI / C# / Java source files. It can be used from a command line,
+ or it can be incorporated as classes in another C++ program.
+
+ There is complete documentation for using Artistic Style. The documentation needed to install and run Artistic
+ Style is included in the distribution package. It does not need an Internet connection.
+
+ These contain information on the changes in the current release. The News contains information on major changes
+ and how they might affect the use of Artistic Style. The Release Notes contains a list of all changes made to
+ the program. Information on old releases is also listed.
+
+ The latest release can be downloaded from the SourceForge file releases page. A link to the "latest version" near
+ the top of the page will download the correct package for your platform. Or you can select the appropriate
+ package from the "astyle" release folders. The Windows package contains a compiled binary. Other platforms
+ will need to compile the source code. Makefiles are included for the most popular compilers. Follow the install
+ instructions for the appropriate platform as described in the "Install" documentation.
+
+ This containd information on compiling and installing Artistic Style. The Windows platform comes with a precompiled
+ executable. Other platforms must compile the project. Follow the instructions for the appropriate platform (Linux,
+ Mac, or Windows).
+
+ Artistic Style may be used and distributed under the
+ MIT license. The MIT is a permiissive license with a minimum of restrictions on software use. It is compatable
+ with the GNU General Public License (GPL) and most other licenses. You can use Artistic Style in free or commercial
+ software without charge. Projects that use Artistic Style do NOT have to make the Artistic Style source code available.
+
+ This page contains scripts to support the Artistic Style program. They are in various script languages and work
+ on different platforms. It includes scripts to clean the directories of backup files created by Artistic Style.
+
+ There are several applications that use Artistic Style as contributed software. It is either embedded in the application
+ or called as a command line program. The applications include Graphical User Interfaces to view the effect of
+ formatting on the source code, development environments for various platforms, and other software. There
+ are also links to style information and various style guides.
+ Artistic Style has compile options for creating a shared library (DLL) or static library for use with a Graphical
+ User Interface (GUI). With the Java Development Kit (JDK) installed it can be compiled as a Java Native Interface
+ (JNI) and called from a Java program. The Developer Information documents the calling procedure and has example
+ programs for C++, C++/CLI, Objective‑C, Java, C#, and Python.
+
+ Bug reports and change requests should be submitted to the bug tracker
+ page. You must be logged in to SourceForge to submit a report. If possible include an example
+ that shows the problem. It does not need to be functional code. Note that code copied and pasted into the bug
+ report will not be indented after the data is submitted. You must indicate the indentation when
+ you submit the request (e.g. replace leading spaces with periods).
+
+
+ The best way to subscribe to update notifications is using the
+ SourceForge Project Page "Update Notifications" button. The option to subscribe is also displayed
+ during a file download. The subscription options for a project can be modified using the "Me", "Account
+ Settings" option on the SourceForge bar at the top of the page. Select the "Subscriptions" tab
+ and check the notifications you want. Usually only the "files" option is needed.
+
+
+ You can also subscribe to change notifications using an RSS feed. There is an RSS symbol on the
+ SourceForge Files page. Or you can use the "subscriptions"
+ or "add content" option available in your RSS reader.
+
+
+ To contact the project by email use the address jimp03@email.com.
+
+
+
Maintainers
+
+
+ Artistic Style is maintained and updated by Jim Pattee. The original author
+ was Tal Davidson, Israel.
+
+
+
Acknowledgments
+
+
+ Thanks to Jim Watson, Fred Shwartz, W. Nathaniel Mills III, Danny Deschenes, Andre Houde,
+ Richard Bullington, Paul-Michael Agapow, Daryn Adler, Dieter Bayer, Sam Cooler, Jim Duff,
+ Emilio Guijarro, Jens Krinke, Eran Ifrah, Travis Robinson, Max Horn, Ettl Martin,
+ Mario Gleichmann, J P Nurmi, Colin D Bennett, Christian Stimming, MrTact, Wim Rosseel,
+ Matthew Woehlke, Chris Schwarz, Chang Jiang, Arseny Solokha, Milian Wolff, Johannes Martin,
+ Arne F?rlie, Marvin Humphrey, J, Christopher Sean Morrison, Keith OHara, louis6g, Evmenov Georgiy,
+ beta100100, Ruzzz, Peter A. Bigot, HyungKi Jeong, David Faure, Carl Moore, Mofi, Travis Vitek
+ for their patches and contributions to Artistic Style.
+
+
+ Thanks to SourceForge for giving Artistic Style its home.
+
+
+ Thanks to all the dedicated beta-testers and bug notifiers!
+
+ astyle_x.x_linux.tar.gz is the Linux version of Artistic Style. It contains the source code,
+ documentation, and makefiles. The Linux Version compile instructions below give information for compiling the
+ source code.
+
+
+ astyle_x.x_macosx.tar.gz is the Mac OS X version of Artistic Style. It contains the source code,
+ documentation, Xcode project files, and a makefile. The Mac OS X Version compile instructions below give information
+ for compiling the source code.
+
+
+ astyle_x.x_windows.zip is the Windows version of Artistic Style. It contains the source code,
+ documentation, Visual C project files, and an executable. The Windows Version compile instructions below give
+ information for compiling the source code.
+
+
+ Only one platform is supported in each distribution package. If you use Artistic Style on more than one platform
+ you will need to download packages for each platform. The main difference in platforms is the build directories
+ and the line endings. Most compilers and development packages will accept any type of line ending. The source
+ code and documentation are the same for all distributions.
+
+
+
+ Linux Version
+
+
+
+ GCC Compiler
+
+
+
+ To compile using the GCC compiler you must have GCC (3.1 or better) installed.
+
+
+ The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
+ astyle/build/gcc directory. The executables will be in the astyle/build/gcc/bin directory. To build the command
+ line configuration enter the following:
+
+
cd astyle/build/gcc make
+
+
+ To build the other astyle configurations you can enter the file name or a symbolic name. Entering "make astyle"
+ or "make release" will build the command line configuration. Following are the symbolic names and file names (in
+ parens) of the various configurations:
+
+
+
release builds the Artistic Style command line program (astyle). This is the default option.
+
+
shared builds the Artistic Style program as a shared library (libastyle.so).
+
static builds the Artistic Style program as a static library (libastyle.a).
+
debug builds the Artistic Style command line program with debugging information (astyled).
+
+
shareddebug builds the Artistic Style program as a shared library with debugging information
+ (libastyled.so).
+
+
staticdebug builds the Artistic Style program as a static library with debugging information
+ (libastyled.a).
+
+
all builds all the above configurations.
+
+ The following Java shared library builds are separate from the above. They include a Java Native Interface (JNI)
+ and require that the Java Development Kit (JDK) be installed. The environment variable JAVA_HOME should be defined.
+ It defines the install directory for the JDK. The makefile also has default install directories for Java 5 and
+ 6. If the compile cannot find the file jni.h, either set the variable or change the value in the makefile.
+
+
+
java builds the Artistic Style program as a shared library which includes the JNI (libastylej.so).
+
+
javadebug builds the Artistic Style program as a shared library which includes the JNI and debugging
+ information
+ (libastylejd.so).
+
javaall builds all the above java configurations.
+
+
+ More than one configuration can be built at the same time. For example, to build all the release configurations
+ enter:
+
+ Clang has a static analyzer that finds potential bugs in C/C++ and Objective-C programs. It can be run as a standalone
+ tool from the command-line, and runs in tandem with a build. There is a script file, analyze.sh, that will run
+ the analysis on Artistic Style.
+
+
+ The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
+ astyle/build/clang directory. The executables will be in the astyle/build/clang/bin directory. To build the command
+ line configuration enter the following:
+
+
cd astyle/build/clang make
+
+
+ To build the other astyle configurations you can enter the file name or a symbolic name. The configurations for
+ Clang are the same as for the GCC compiler. More than one configuration can be
+ built at the same time. For example, to build all the release configurations enter:
+
+
cd astyle/build/clang make release shared static
+
+ These procedures and the makefile are for recent versions of the compiler. They may not work for earlier versions.
+ Instructions for your compiler are in the compiler documentation file "get_started_lc.htm".
+
+
+ To compile the source there are environment variables that must be set by running the compiler environment script
+ compilervars.sh (or compilervars.csh) with an argument that specifies the target architecture. If this has not
+ been done already enter: "source <install-dir>/bin/compilervars.sh <arg>",
+ where <install-dir> is the directory where the compiler is installed and <arg> is ia32
+ or intel64. If this is not done "make" will display an error message "*** The compiler environment
+ variables are not set." On an Intel x64 platform installed in the default directory the instruction would be
+
+ The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
+ astyle/build/intel directory. The output executables will be in the astyle/build/intel/bin directory. To build
+ the command line configuration enter the following:
+
+
cd astyle/build/intel make
+
+ To build the other astyle configurations you can enter the file name or a symbolic name. The configuration names
+ for Intel are the same as for the GCC compiler. More than one configuration can be
+ built at the same time. For example, to build the entire debug configurations enter:
+
+
cd astyle/build/intel make debug shareddebug staticdebug
+ The following makefile targets are available for GCC, Clang, Intel, and Mac.
+
+
+
+ clean
+
+
+
+ Removes the object and executable files for all configurations.
+
+
+ To remove the files for all configurations:
+
+
make clean
+
+
+
+ cleanobj
+
+
+
+ Removes the object files for all configurations. The executables will not be removed.
+
+
+ To remove only the object files for all configurations:
+
+
make cleanobj
+
+
+
+ install
+
+
+
+ Installs the
+ astyle executable and documentation files. The default is /usr/bin for the executable and /usr/share/doc/astyle
+ for the documentation. You must have the appropriate permissions to use install.
+
+
+ To install the astyle to the default directories:
+
+
sudo make install
+
+
+ To install astyle to a different bin directory set a value for the macro $(prefix). For example to install the
+ executable to a user's home directory (/home/user/bin):
+
+
sudo make prefix=$HOME install
+
+
+
+ uninstall
+
+
+
+ Uninstalls the executable and documentation. You must have the appropriate permissions to use uninstall.
+
+
+ To uninstall astyle from the default directories:
+
+
sudo make uninstall
+
+
+ To uninstall the files from a different directory set a value for the macro $(prefix). For example to uninstall
+ the files from a user's home directory (/home/user):
+
+
sudo make prefix=$HOME uninstall
+
+
+ NOTE: The uninstall option will NOT remove the .astylerc files from the users home directories. The files must
+ be removed individually for each user.
+
+
+
+ Mac OS X Version
+
+
+
Xcode
+
+
+ Artistic Style workspace and project files for the Xcode development environment are available in the "build/xcode"
+ directory. A workspace can be used to build a single project or all the projects. The project files have Debug
+ and Release configurations. The following projects are available.
+
+
+
AStyle builds the Artistic Style command line program (astyle).
+
AStyleA builds the Artistic Style program as a Static Library (libastyle.a). This can be statically
+ linked with an executable.
+
AStyleDylib builds the Artistic Style program as a Dynamic Library (libastyle.dylib). It can
+ be used with C/C++, Objective C, C#, and Python programs.
+
AStyleJava builds the Artistic Style program as a Dynamic Library (libastylej.dylib) that can
+ be called from a Java program. The Java Development (JDK) is required for the project to compile. The Project
+ Properties must have an include path to the JDK include directory. The output dylib can also be called from a
+ C++ or C# program.
+
+
+
install
+
+
+ Only the astyle executable is installed. The library project installs are sent to UninstalledProjects in
+ the Build directory. The following instructions are for the astyle executable and documentation files. The default
+ install directory is /usr/bin for the executable and /usr/share/doc/astyle
+ for the documentation. You must have the appropriate permissions to use install.
+ If sudo is not used for the install an error will occur during the build.
+
+
+ To install the astyle executable to the default directory:
+
+
cd astyle/build/xcode
+sudo xcodebuild install -project AStyle.xcodeproj
+
+
+ A script is used to install the documentation
+ from the same directory.
+
+
sudo bash install.sh
+
+
+
+ uninstall
+
+
+
+ Uninstalls the executable and documentation. You must have the appropriate permissions to use uninstall.
+
+
+ A script is used to uninstall astyle and the documentation:
+
+
sudo bash uninstall.sh
+
+
+ NOTE: The uninstall option will NOT remove the .astylerc files from the users home directories. The files must
+ be removed individually for each user.
+
+
+
Makefile
+
+
+ The Artistic Style makefile compile uses the OS X "Command Line Tools". If you have Xcode 4.3 or newer
+ the command line tools, such as "make", are NOT installed by default. They must be downloaded and installed
+ separately. Once everything is successfully installed you should see "make" and other command line developer
+ tools in /usr/bin.
+
+
+ The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
+ astyle/build/mac directory. The executables will be in the astyle/build/mac/bin directory. To build the command
+ line configuration enter the following:
+
+
cd astyle/build/mac make
+
+
+ To build the other astyle configurations you can enter the file name or a symbolic name. The configurations for
+ Mac are the same as for the Linux GCC compiler. More than one configuration can be
+ built at the same time. For example, to build all the release configurations enter:
+
+ In addition to the source files, the Windows distribution package contains an Artistic Style Win32 executable
+ (AStyle.exe). If you prefer to compile the executable yourself follow the following instructions.
+
+
+
+ Visual C++ Compiler
+
+
+
+ There are
+ solution and project files for
+ several versions of the Visual C compiler. Open an Artistic Style solution
+ file in the appropriate "build" directory. All projects have Debug, Release and Static configurations.
+ Debug file output will be in the "debug" directory. Release file output will be in the "bin"
+ directory. Static file output will be in the "binstatic" directory. The following solution files are available.
+
+
+
All AStyle ll AStyle builds the release and the debug configurations for all the following.
+
+
AStyle builds the Artistic Style command line program (AStyle.exe). This project has an extra
+ "Static" option. It is the same as the "Release" build except that it is linked with a static runtime library.
+ This is needed if the executable is to be run on a system without Visual Studio installed. The builds for this
+ configuration are placed in a separate "binstatic" directory.
+
AStyleDll builds the Artistic Style program as a Dynamic Link Library (AStyle.dll). This will
+ also build an exports library and a static library for linking the dll.
+
AStyleJava builds the Artistic Style program as a Dynamic Link Library (AStylej.dll) that can
+ be called from a Java program. The Java Development (JDK) is required for the project to compile. The Project
+ Properties must have an include path to the JDK include and include/win32 directories. This is set in "Project
+ > Properties > C/C++ > General > Additional Include Directories". The default setting
+ is for the JDK to be installed in the default directory, but it may not be the most current release. The output
+ DLL can also be called from a C++ or C# program.
+
AStyleLib builds the Artistic Style program as a Static Library (libAStyle.lib). This can be
+ statically linked to a calling program.
+
+
+
+ Other Compilers
+
+
+
+ To use other compilers a project file must be built using a development environment.
+
+
+
Create a project using the compiler's development environment.
+
Add to the project all the .cpp and .h files in the "src" directory.
+
The Compiler Options section discusses the compiler options to use.
+
Compile.
+
+
+
+ Compiler Options
+
+
+
+ No macro definitions are required to compile the executable. To compile as a static or shared (dynamic) library
+ define the macro ASTYLE_LIB. To compile a Java shared (dynamic) library define the macro ASTYLE_JNI. The
+ option ASTYLE_NO_EXPORTS is sometimes needed for static libraries to prevent compiler error and warning
+ messages. Use the appropriate compiler and linker options to compile the static or shared library. Add debug
+ options to compile the debug versions.
+
+
+ Artistic Style is a small program and it is best to optimize for speed. The debug configurations are not usually
+ optimized. To optimize for speed in the release configurations use the macro NDEBUG to remove asserts. If
+ necessary, use an option to activate the C++11 standards (--std=c++0x on GCC and MinGW). Use an
+ option that allows inline function expansion. Runtime Type Information (RTTI) is NOT needed. Exceptions are
+ NOT
+ used. Use whole program optimization if your compiler supports it. There may be other options you can use depending
+ on the compiler.
+
+ The following development environments use Artistic Style as a contributed add-on. It is either embedded in the
+ application or called as a command line program.
+
+
+ Dev-Cpp
+ is a new and improved fork of the original Bloodshed Dev-C++. It is a free IDE for programming in C and C++. It
+ is bundled with, and uses, the MinGW or TDM-GCC port of the GCC as its compiler. It is currently Windows only.
+ The Artictic Style interface includes a live Preview window.
+
+
+ CodeBender is a
+ browser-based IDE for programming and uploading to Arduino boards. It includes built-in libraries for code sharing.
+ Artistic Style is used as the code formatter.
+
+
+ CodeBlocks is
+ a multi-platform, open source, C++ development environment based on wxWidgets. It has support for multiple compilers and plug-ins for wxWidgets development.
+
+
+ CodeLite is an
+ open source, free, cross platform IDE specialized in C, C++, PHP and JavaScript. It supports all major
+ compilers. Threr is support for wxWidgets and includes a class
+ generator and a unit test program generator. Code completion is based on Ctags.
+
+
+ KDevelop is a
+ multi-platform, integrated development environment for building
+ KDE applications. It supports many programming languages and can be used to develop applications other
+ than KDE.
+
+
+ Monkey Studio
+ is a cross platform IDE written in C++/Qt. Its primary goal was to be a Qt only IDE, but it evolved into a way to support Qt development and any kind
+ of project.
+
+
+ Qt
+ Creator is a cross-platform integrated development environment tailored to the needs of Qt developers. An Artistic Style Plugin is available as an integrated plugin.
+ It can format source code within the editor or format an entire project. There is a help display available to
+ show the effect of each option.
+
+
+ SciTE
+ is a Scintilla based source code editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building
+ and running programs. It is currently available for Windows, Linux, and Mac OS X operating systems. The Linux
+ and Mac versions are based on GTK+.
+
+
+ Sublime Text
+ is a is a sophisticated text editor for code, markup and prose that includes Artistic Style as a plug-in. Nearly
+ everything in Sublime Text is customizable with simple JSON files.The plug-ins are Python based.
+ Sublime Text is available for OS X, Windows and Linux.
+
+
+ tIDE is
+ a full featured open source
+ Java integrated development environment. It is a small, powerful, quick, efficient, easy and open framework
+ to create 100% Java applications.
+
+
+ UltraEdit is a commercial programmer's text editor for Microsoft
+ Windows, Linux and Mac OS X. It can be evaluated for free for 30 days. Artistic Style is included in the Tools
+ Toolbar. It includes an options dialog. The number of indent spaces is passed to Artistic Style is based on
+ the Indent Spaces value defined under Word Wrap/Tab Settings in Configuration based on the file extension of
+ the active file.
+
+
+ Visual Studio
+ is an integrated development environment from Microsoft.
+ AStyle Extension is an extension written in C# and formats C/C++
+ and C#
+ source code using Artistic Style. It can be installed in Visual Studio (except Express editions)
+ using the "Tools" > "Extensions and Updates" menu. Search the "Online" entry
+ for "astyle". The source code is available on GitHub.
+
+
+
Graphical User Interfaces
+
+
+ Artistic Style is a command line program and, as such, does not give you a chance to review the effect of different
+ options before formatting the source code. The following Graphical User Interface program will allow you to review
+ the changes before the code is updated. They allow you to select the options you want without actually updating
+ the source.
+
+
+ Artistic Style for Windows
+ is an Artistic Style GUI program for Windows. It uses an unmodified Artistic Style program in a Windows GUI. It
+ will work under Linux using WINE. Everything done in the editor is undo-able, including formatting of the entire
+ document. Documents can be reviewed and reformatted using different options. It can be executed from most development
+ environments and will open the currently selected document.
+ Here are the links for downloading version 2.05.1 of
+
+ AStyleWin and
+
+ AStyleWinD. The website has been having problems and I have not been able to update it.
+ The downloads contain Windows executables and documentation.
+
+
+ Universal Indent
+ Gui is a cross platform GUI that supports several code formatters. The main feature is a live
+ preview to show how the selected formatting options affect the source code. This allows review and testing of
+ the various options before formatting a file. It can be used with a sample file or with your actual source code.
+ It is a good way to try out the options from various indentation programs. This program is not always kept up
+ to date. Be sure to check the AStyle release before relying on the results.
+
+
+
Other Programs
+
+
+ These programs were mentioned in previous versions of the News
+ or other documentation. They are included here for reference.
+
+
+ Google Test
+ and Google Mock
+ are frameworks for writing C++ tests on a variety of platforms. Based on the xUnit architecture it supports automatic
+ test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures,
+ value- and type-parameterized tests, various options for running the tests, and XML test report generation. Google
+ Mock is a library for writing and using C++ mock methods.
+
+
+ Highlight converts
+ source code to formatted text with syntax highlighting. Output is in several formats including HTML. It supports
+ over 160 programming languages and includes 80 color themes. Highlight is used for the examples in the "Developer
+ Information" section.
+
+
+ Python Tools for Visual Studio
+ is a free, open source plug-in that turns Visual Studio into a Python IDE. It can be switched between Python versions
+ or different Python interpreters. It uses the Visual Studio integrated debugger that enables you to set break
+ points, step through functions, change the current statement, inspect local variables, and perform other operations
+ while debugging.
+
+
+
Information
+
+
The following links contain general information on coding and coding styles.
+
+
+ Indent Style
+ at Wikipedia discusses the common indent styles used in programming. The basic criteria for most Artistic Style
+ predefined styles were taken from this discussion.
+
+
+ Programming
+ style at Wikipedia is a set of rules or guidelines used when writing the source code for a computer
+ program. It is often claimed that following a particular programming style will help programmers to read and understand
+ source code conforming to the style, and help to avoid introducing errors.
+
+
+ Programming with Style
+ describes popular indent styles. Its purpose is to provide enough information to help people decide on which indent
+ style to use.
+
+
+
Style Guides
+
+
+ Chromium
+ style guide generally follows the Google Style Guide but has extensions beyond the Google style
+ guide. There is interesting information on common C++ Dos and Don'ts.
+
+
+ Google style
+ guides have Google's standards for several programming languages along with a python program
+ to verify the style and an Emacs script for using the style.
+
+
+
+ Kdelibs
+ Coding Style describes the recommended coding style for kdelibs. It follows the Qt 4 coding style,
+ with one main difference.
+
+
+ LLVM coding standards
+ describes a few coding standards that are being used in the LLVM source tree.
+
+
+
+ Mozilla’s style guide explains the basic styles and patterns that are used in the
+ Mozilla codebase.
+
+
+ Qt Coding Style
+ is an overview of the coding conventions used when writing Qt code.
+
+
+
Other Links
+
+
+ These links were mentioned in previous versions of the News. They are included here for reference.
+
+
+ Install Instructions for .NET Framework SDK
+ are instructions for adding x64 platforms to Visual Studio Express 2010. Express editions after 2010 have the
+ x64 platforms already installed. Visual Studio 2010 is the last edition that will work on Windows XP (platform
+ toolset v100). Visual Studio 2012 (platform toolset v110) and higher contains dependencies on Windows API functions
+ that exist only on Windows Vista, Windows 7, and Windows 8. This means that applications built with Visual Studio
+ 2012 and higher would fail to load and execute on Windows XP.
+
+
+ Survey
+ General Information and Survey Options are the results of an Artistic Style survey
+ from May 2011. There is a commentary on the survey in the May 2011 News under the heading "Survey Results".
+
+ A new option, "pad‑comma", will add a space following a comma. The option "pad‑oper"
+ has not been changed and will also add a space following a comma.
+
+
+ All spaces before a comma are now removed. Use the disable block comments if there are arrays with vertical alignment
+ where this is not wanted.
+
+
+ New Objective‑C options "pad‑return‑type" and "unpad‑return‑type" will
+ add or remove space padding after the Objective‑C return type. It is described in the "Objective‑C"
+ section of the documentation.
+
+
+ The Objective‑C align‑method‑colon has been changed for method declarations and definitions.
+ For multi‑line arguments when the first keyword is shorter than the others the colons are aligned on the
+ longest line instead of the first line. The alignment includes room for the indentation. This aligns all colons
+ after the first line for a better appaerance. Arguments that do not have a short keyword in the first line will
+ remain the same. This style conforms to the Google Objective‑C Style Guide.
+
+
+ The Objective‑C align‑method‑colon option is now applied to Objective‑C method calls in
+ addition to method declarations and definitions.
+
+
+ Processing for c++14 single‑quote digit separators has been added.
+
+
+
+ New
+ Software License
+
+
+
+ The Artisic Style software license has changed. It is now under the MIT license. This is a permissive license
+ which can be used in proprietory software and does NOT require modified Artistic Style source code be made available.
+ It is compatable with the GNU General Public License (GPL) and most other software licenses. The change was made
+ to remove restrictions on using the software and to make it available for any project that wants to use it.
+
+
+ If there are problems with the license change send an email to Artistic Style and its use will be approved on
+ a individual basis.
+
+
+
+ Assignment Operator Alignment
+
+
+
+ Visual Studio 2013 and 2015 have an Edit option "Align Assignments" that will align assignment operators
+ across multiple lines. There is also an extension named "Code alignment" that will align the code on
+ other items as well. Other development environments may have something similar. These will selectively align the
+ data and allow for customization of the format.
+
+
+ These options and extensions can be used with Artistic Style. If you choose to do this, the space padding will
+ be maintained and the alignment will be preserved.
+
+
+
+ Microsoft Clang Compiler
+
+
+
+
+ The Microsoft Clang Compiler is available with Visual Studio 2015 Update 1. It is usually
+ used for Android or iOS
+ support but the CodeGen support can be used with Windows. The Clang Update 1 version is a preview and is
+ incomplete, but can be used if you want. It will require modification of the Visual Studio 2015 project files.
+
+
+ The Clang compiler can be installed from the Visual Studio 2015 install program by selecting the "Clang
+ with Microsoft CodeGen" option. If Visual Studio 2015 Update 1 is already installed, Clang can be installed
+ by selecting File > New > Project > Visual C++ > Cross Platform, select CodeGen support option.
+
+
+ To use Clang open a Visual Studio 2015 AStyle Solution. Make the following change to all configurations:
+
+
+
General > Platform Toolset, select "Clang 3.7 with Microsoft CodeGen".
+
+
+ Make sure to hit "Apply" before editing other properties to let the project system load the corresponding
+ toolset definition.
+
+
+ The Update 1 preview release does not provide any support for automatic migration of values between Visual Studio
+ 2015 and Clang 3.7. The invalid properties must be fixed manually manually. These may change with subsequent Visual
+ Studio updates.
+
+
+ The properties that need changing in Visual Studio Update 1 are:
+
+
+
C/C++ > General > Debug Information Format, select "Full Debug Information (DWARF2)" for Debug
+ or "None" for Release.
+
C/C++ > General > Warning Level, select "Enable All Warnings".
+
C/C++ > Code Generation > Enable C++ Exceptions, select "Yes" for Debug or "No" for
+ Release.
+ The following is needed if you are building an executable instead of a static or dynamic library:
+
+
+
C/C++ > Preprocessor > Preprocessor Definitions, add " __STDC__=0". To remove the warnings
+ this causes, C/C++ > Command Line > Additional Options, enter "-Wno-macro-redefined".
+
+
+
+ The project should now compile and run.
+
+
+
+ Windows XP
+
+
+
+ The executable in the Windows distribution package is now compiled with a Visual Studio version that will no
+ longer work on Windows XP. Beginning with Visual Studio 2012, auto‑vectorization tries to make loops run
+ faster by automatically vectorizing the code. Auto‑vectorization is on by default, there are no compiler
+ switches, #pragmas, or hints. But it uses SSE instructions not available in Windows XP. Microsoft ended
+ support and updates for XP on April 8, 2014, and the usage share percentage continues to decrease.
+
+
+ If you are using XP, Artistic Style should be compiled on the XP machine. Compiling on XP with any
+ compiler should produce an XP executable.
+
+
+ To compile on a non‑XP machine for use on XP, using a compiler other than Visaul Studio should always
+ produce an XP executable. Using Vusual Studio 2010 or earlier should always produce an XP executable. If
+ you are using Visual Studio 2012, 2013, or 2015 on a non‑XP machine, do the following for the Artistic Style
+ configuration you want to use:
+
+
+
"Windows XP Support for C++" must be installed. It is available as an option in the Visual Studio install
+ and can be installed as a modification to the original install.
+
In the Artistic Style Properties, change General > Platform Toolset, to "Windows XP".
+
In the Artistic Style Properties, change C/C++ > Preprocessor > Preprocessor Definitions to include
+ _USING_V110_SDK71_.
+
Change other Properties if you want, such as Output Directory or Target Name.
+
Compile. The output should be executable on Windows XP. It will also execute on the later versions of Windows.
+
+
+
+
+ SourceForge
+
+
+
+ Recently, SourceForge began adding potentially unwanted programs (PUPs), also known as "crapware", to
+ software installers of certain applications. Some large projects have already left the site. Artistic Style does
+ not use installer downloads and therefore was not affected by this. Downloads are in the form
+ of .zip or .tar.gz files. However, having the PUPs available on the host site affects the integrity of every
+ application that uses the site.
+
+
+ What is even more troubling is that the uBlock browser add‑on, and all of its spin‑offs, is now blocking
+ access to the site by default. Even though Artistic Style has never used PUPs, the site is prevented from loading.
+ The block can be easily removed, but may discourage some people from using the software. are.
+
+
+ SourceForge is apparently taking steps to correct the situation. If this is not resolved fairly soon, Artistic
+ Style will be relocated to another site. If this happens, I will give notification of the new site at the
+ current SourceForge address.
+ ess.
+
+
+
+ Acknowledgments
+
+
+
+ Thanks to David Faure for their contributions.
+
+
+
Artistic Style 2.05 (November 2014)
+
+
+ Release 2.05.1 (December 2014) is a maintenance release and no new features were added. A list of changes is in
+ the Release Notes. The following information is for the original 2.05 release.
+
+
+
+ A new bracket style option, "style=vtk", has been added. It uses indented brackets, like Whitesmith,
+ except opening brackets for classes, functions, and methods are not indented. A complete description of the VTK
+ style is available at the "Visualization Toolkit" website (http://www.vtk.org/).
+
+
+ A new preprocessor indent option "indent-preproc-block" will indent preprocessor block statements one additional
+ indent. The block must be top-level, or included within a namespace, and there are restrictions on what can be
+ indented.
+ The option is described in the "Indentation Options" section of the documentation.
+
+
+ A new option, "dry-run", will run Artistic Style without updating the files. The report will be output as usual.
+
+
+ Formatting of source code may now be disabled for portions of a program by embedding special comment tags in the
+ program. These are described in a new "Disable Formatting" section of the documentation. They work the
+ same as in other formatters. There are tags to disable formatting for a block of code, and a tag to disable formatting
+ of a single line. This should allow any custom formatting to be retained.
+
+
+ The product version number has been added to the filename of shared library (DLL) compiles. This will allow multiple
+ versions of a shared library on the same system without conflicts.
+
+
+ An attribute '__attribute__ ((visibility ("default")))' has been added to exported functions
+ on Linux shared libraries. This allows the option "-fvisibility=hidden" to be used on dynamic library
+ compiles. According to the GNU documentation, "Using this feature can very substantially improve linking
+ and load times of shared object libraries, produce more optimized code, provide near-perfect API export and prevent
+ symbol clashes. It is strongly recommended that you use this in any shared objects you distribute."
+
+
+ Improvements have been made in the formatting of C++11 uniform initializers (enclosed by brackets). The opening
+ bracket will not be space padded unless it is padded initially. The closing bracket will not be broken from the
+ final line unless it is broken initially. And the known problems with uniform initializers in class constructors
+ have been fixed.
+
+
+ The Windows compiler definition ASTYLE_NO_VCX (no Visual Studio exports) has been changed to ASTYLE_NO_EXPORTS.
+ It is sometimes needed for static libraries on other compilers to prevent error and warning messages.
+
+
+ Qt and Boost macros foreach, forever, Q_FOREACH, and Q_FOREVER will now be recognized as headers.
+
+
+ The main documentation for Artistic Style is in HTML format. Until now there has not been a way to display it
+ from the astyle console program. A new option, "html" or "-!" will display the help documentation in the default
+ browser. This documentation is more complete than the astyle "help" option. It includes examples, and has an index
+ for easier navigation. Since astyle is typically run from a script this should allow an easy way to access the
+ documentation. The option is available only from the command line.
+
+
+ The new "html" option assumes the documentation is installed in the standard install path. This is /usr/share/doc/astyle/html
+ for Linux and the path %programfiles%\AStyle\doc for Windows. If it is installed to a different directory, use
+ the variation "html=<actual_install_path>astyle.html. This option can also be used to open other HTML files.
+ More information is in the "Command Line Only" section of the documentation.
+
+
+ The "html" option on Linux uses the script "xdg-open" from the install package "xdg-utils" to find the default
+ browser. This should be available on most systems. If it is not available on your system you can file a
+ bug report requesting a change. It would be helpful if you could determine how it is done before filing the report.
+ You can also file a bug report if the documentation is not installed to the above "default" directories. The HTML
+ documentation takes quite a bit of effort to maintain and I would like to make it easily available.
+
+
+ The "help" option has been changed to send the output to stdout instead of stderr. This will allow piping and
+ redirection of the output. A common way to use the option on Linux is "astyle --help | less", which
+ will page the display. The "version" option has also been changed to stdout.
+
+
+ A shared library error handler argument has been changed from "char*" to "const char*". In
+ some cases this may cause compile errors in a user program until the references have been changed.
+
+
+ The "Indent Style" topic on Wikipedia states that the "ANSI" style refers to K&R style brackets
+ and not Allman style as used by Artistic Style. The option "style=ansi" is therefore being depreciated and will
+ be removed in a future release. Use one of the other long options instead (style=allman, style=bsd, or style=break).
+
+
+ Some of the documentation has been removed from the distribution package. It still contains all files needed to
+ install and run Artistic Style. The included files can be used without an Internet connection.
+
+
+ There are now build files available for Xcode on Mac. The makefile is still available for those who want it. Both
+ now use the LLVM Clang compiler. There has been a
+ change to the makefile debug locations to make them similar to Xcode. The "Install Instructions" have
+ been updated for both.
+
+
+ The Python Example in the Developer Information now supports Iron Python. The
+ programming instructions are sometimes different since the ctypes module works differently. The example script
+ documents the differences. If you use Python Tools for Visual Studio, it now installs in the Express editions
+ (beginning with release 2.1). Node.js can also be installed in Visual Studio Express.
+
+
+ The executable in the Windows distribution package is now compiled with Visual Studio 2013 and will no longer
+ work on XP. If you are using XP, Artistic Style will need to be recompiled on the XP machine.
+
+
+ A new Visual
+ Studio Community Edition has been released. It is free, combines all of the Express editions into a single
+ development environment, and allows the addition of Visual Studio extensions. There is an
+
+ AStyle Extension available for installation. It has a graphic interface, adds menu entries, and can be
+ used from within Visual Studio. To install it search the "Extensions and Updates", "Online"
+ entry for "astyle".
+
+
+ Thanks to Peter A. Bigot, HyungKi Jeong, David Faure, and Carl Moore for their contributions.
+
+
+
Artistic Style 2.04 (November 2013)
+
+
+ With a new Artistic Style release some unchanged source files will be formatted because of changes to Artistic
+ Style. You may want to format your source before making program changes in order to bring it up to date.
+
+
+ A new programming language, Objective‑C, has been added to Artistic Style. Four new options, "align‑method‑colon",
+ "pad‑method‑colon=", "pad‑method‑prefix", and "unpad‑method‑prefix" have been
+ added to format the methods. The options are described in a new "Objective‑C" section in the documentation.
+ These new options affect only Objective‑C source code. They have no effect on the other programming languages.
+
+
+ Because of the longer continuation indents sometimes needed for Objective‑C, the option "max-instatement-indent"
+ may need to be increased. If you are not getting the paren and square bracket alignment you want, try increasing
+ this value. The default minimum is 40 and the maximum is 120.
+
+
+ A new bracket style option, "style=google", has been added. It uses attached brackets and indents the class access
+ modifiers one-half indent. A complete description of the Google style is available at the google‑styleguide
+ website (https://code.google.com/p/google-styleguide/). The website has standards for several programming languages
+ along with a python program to verify the style and an emacs script for using the style.
+
+
+ A new indent option "indent-modifiers" will indent class access modifiers (public, protected, or 'private) one-half
+ indent. The rest of the class is not indented. It is described in the "Indentation Options" section of the documentation.
+
+
+ Four new bracket modify options, "attach-namespaces", "attach-classes", "attach-inlines", and "attach-extern-c",
+ can be used to modify your selected bracket style. They are described in a new "Bracket Modify Options" section
+ of the documentation.
+
+
+ A new option, "remove-brackets", will remove brackets from conditional statements. The statement must be a single
+ statement on a single line. It is described in the "Formatting Options" section of the documentation.
+
+
+ A new option, "indent-preproc-cond", will indent preprocessor conditional statements (#if #elif, #else, #endif).
+ It is described in the "Indentation Options" section of the documentation. The option "indent-preprocessor" has
+ been deprecated and will be removed in a future release. Use "indent-preproc-define" instead. The processing of
+ preprocessor #define statements has not changed.
+
+
+ A new option, "remove-comment-prefix", will remove a leading '*' from multi-line comments. It is described in
+ the "Formatting Options" section of the documentation. With the syntax coloring of modern editors a leading '*'
+ for comment lines is not as useful as it once was. The current trend is toward code that is easier to maintain.
+ The idea is that a style that is hard to maintain will discourage modification and updating. The converted style
+ should retain most of the formatting within the comment and result in a comment that is easier to maintain. For
+ consistency the option also indents multi-line comments that are not preceded by the '*'. This may slightly modify
+ the indentation of any commented-out code.
+
+
+ The option "pad-first-paren-out" was fixed to not pad if the following paren is empty. This makes the option consistent
+ with "pad-paren-out". To fix empty parens that have been padded run with the option "unpad-paren" in addition
+ to "pad-first-paren-out". This needs to be done only once.
+
+
+ Processing of C++11 raw string literals has been added.
+
+
+ The compiler definition ASTYLE_NO_VCX (no Visual Studio exports) has been changed to ASTYLE_NO_EXPORTS and can
+ be used with any Windows compiler. The Clang compiler needs this option to avoid errors on dynamic libraries.
+ It removes the "__declspec(dllexport)"
+ definition from exported functions. Linux compilers do not use this.
+
+
+ A new shared object (DLL) entry point, AStyleMainUtf16, has been added for processing C# UTF-16 strings. C# does
+ not have built in functions for converting the UTF-16 strings to UTF-8. This entry point will accept UTF-16 strings,
+ format the source code, and return UTF-16 strings. The error handling function and version number still use UTF-8
+ strings. The C# example program in the "Developer Information" shows the new calling procedure. Changes from the
+ previous release are marked in the example.
+
+
+ C# strings are UTF-16 on both Windows and Linux. C# does not use the UTF-32 wchar_t strings on Linux. Qt also
+ uses UTF-16 on both Windows and Linux, but has built in UTF-8 conversion functions. Qt strings can be converted
+ to UTF-8 by Qt, or the new entry point can be used. There may be other "managed code" applications on Linux that
+ use UTF-16.
+
+
+ The "Links" page has two new sections for links mentioned in previous versions of Artistic Style. It links to
+ free software and other information.
+
+
+ The "Developer Information" section has a new example and download for calling Artistic Style from an Objective‑C
+ program. Since it is another "C" language the only thing needed is to link the program with a library build of
+ Artistic Style. The example was developed on Windows and Linux using the GNUstep project. Since the example is
+ a console program the problems with the GNUstep GUI have been avoided. It has not been tested on a Mac, but should
+ be close to working. The "Developer Information" section also has new page for "Objective‑C on Windows and
+ Linux" which has information on compiling and running the example on those systems.
+
+
+ The executable included in the Windows distribution was compiled with Visual Studio 2010 (platform toolset v100).
+ Higher releases contain dependencies on Windows API functions that exist only on Windows Vista, Windows 7, and
+ Windows 8. This means that applications built with a Visual Studio 2012 C++ compiler would fail to load and execute
+ on Windows XP.
+
+
+ If you are using Windows Vista or higher, and have a Visual Studio 2012 or higher compiler available, recompiling
+ will probably result in faster execution. If you use a compiler other than Visual Studio, you can probably get
+ better execution by compiling using the C++11 standards. Artistic Style uses a lot of string vectors and the new
+ move semantics will probably result in faster execution.
+
+
+ Thanks to Evmenov Georgiy, Matthew Woehlke, Jiang, Ruzzz, and beta100100 for their contributions.
+
+
+
Artistic Style 2.03 (April 2013)
+
+
+ With a new Artistic Style release some unchanged source files will be formatted because of changes to Artistic
+ Style. You may want to format your source before making program changes in order to bring it up to date.
+
+
+ A new option, "max-code-length=#" or "xC#", will limit the length of code on a line. A new option "break‑after‑logical",
+ or "xL", will modify a line break for conditionals. See the documentation for details.
+
+
+ A new option, "pad-first-paren-out" or "xd", will pad only the first paren in a series on the outside. See the
+ documentation for details.
+
+
+ A new option, "indent=force-tab-tab=#" or "xT#", will allow force tab indents with a tab length that is different
+ than the indent length. See the documentation for details.
+
+
+ The short option for delete-empty-lines has changed from "xd" to "xe".
+
+
+ The C++11 standard for range-based "for" loops, "enum" with a base type, and rvalue references is now supported.
+ The formatting of rvalue references is determined from the existing "align-pointer" and "align-reference"
+ options.
+
+
+ Closing the ending angle brackets of templates is now allowed by the C++11 standard. A new option, "close-templates"
+ or "xy", will close the whitespace in the angle brackets of template definitions. Be sure your compiler supports
+ this before making the changes.
+
+
+ The C/C++ keyword 'extern "C"' in a preprocessor no longer causes an extra indent.
+
+
+ Formatting of C++/CLI managed pointers (the '^' character) has been added to the "align-pointer"
+ option.
+
+
+ The breaking of switch "default" statements has been fixed. The "default" statements
+ that have been incorrectly broken will be fixed in this release.
+
+
+ The byte order mark (BOM) has been removed from ASLocalizer.cpp for all platforms. The encoding of the file is
+ UTF-8. Many Windows editors can now recognize UTF-8 encoding without the BOM. Visual Studio has an option that
+ needs to be set. With others. such as CodeBlocks, identification is automatic. On Linux, UTF-8 is the default
+ encoding.
+
+
+ Translations have been added for Dutch, Finnish, Italian, Japanese, Korean, Polish, Portuguese, Russian, Swedish,
+ and Ukrainian. The translations were done with an automated translation program, Google Translate, so they may
+ not be the best translation possible. The translations are at the end of ASLocalizer.cpp in the form of an English‑Translation
+ pair. If you correct a translation, send the source as a bug report and it will be included in the next release.
+ To add a language, see "Internationalization" in the "General Information" section of the documentation. Send
+ the addition as a bug report and it will be included in the next release.
+
+
+ There is a new Linux makefile for the Clang Compiler. Clang is a free compiler can be installed as a package on
+ many Linux distributions. Some of its features are fast compiles, low memory use, expressive diagnostic messages,
+ and GCC compatibility. It includes a static analyzer tool that finds potential bugs in your source code. An experimental
+ version can be installed on a Windows platform. There is more information in the Install Information documentation.
+
+
+ Visual Studio automatically creates an import library and an export file when you link a program that contains
+ exports. It will do this for even a static library if it contains a __declspec(dllexport) definition. The Artistic
+ Style library (ASTYLE_LIB) build contains such exports which causes an import library and export file to be created
+ when they may not be needed. A new preprocessor definition, ASTYLE_NO_VCX (no Visual Studio exports) can be declared
+ to eliminate the files from the output. Use this only for static libraries or when the AStyle source is included
+ in the compile. Do NOT use this when compiled as a shared (dynamic) library. It is effective only for Visual Studio
+ 2012. It will NOT work with previous versions. It has no effect with other compilers since they require a separate
+ option to create the import library and export files.
+
+
+ The executable included in the Windows distribution was compiled with Visual Studio 2010 (platform toolset v100).
+ Visual Studio 2012 (platform toolset v110) contains dependencies on Windows API functions that exist only on Windows
+ Vista, Windows 7, and Windows 8. This means that applications built with a Visual Studio 2012 C++ compiler would
+ fail to load and execute on Windows XP. Artistic Style was therefore compiled with Visual Studio 2010 to work
+ on computers using Windows XP.
+
+
+ If you are using Windows Vista or higher, and have the Visual Studio 2012 compiler available, recompiling with
+ Visual Studio 2012 will probably result in faster execution. The Windows distribution has Visual Studio 2012 project
+ files available.
+
+
+ If you use a compiler other than Visual Studio, you can probably get better execution by compiling using the C++11
+ standards. Artistic Style uses a lot of string vectors and the new move semantics will probably result in faster
+ execution. (To use C++11 on GCC and MinGW use the option --std=c++0x). This may change on future compiler releases.).
+
+
+ The "Developer Information" page has a new example and download for calling Artistic Style from a Python script.
+ It will run with both Python 2 and Python 3. Using Python 3 shows an example of formatting a Unicode string with
+ Artistic Style. Unicode strings must be encoded to UTF-8 before formatting and decoded back to Unicode afterward.
+ The example script shows the technique for doing this. It also shows how to set up the function pointers and allocate
+ memory in Python.
+
+
+ If you use Visual Studio on Windows, it can now be used for Python development. Python Tools for Visual Studio
+ (PTVS) is a free and open source plug-in for Visual Studio 2010 that supports Python and Iron Python. Other interpreters
+ such Jython can be added. It can be easily switched between Python versions or different interpreters. But the
+ best thing is the Visual Studio debugging support using the .NET debugger and the normal Visual Studio debugger.
+ It enables you to set break points, step through functions, change the current statement, inspect local variables,
+ and perform other operations while debugging. It is best to use it with a project file, a minor irritation for
+ single page scripts. And there are some minor bugs. But overall it works quite well.
+
+
+ Thanks to Christopher Sean Morrison, Keith OHara, louis6g, and J for their contributions.
+
+
+
+
+
+ Previous releases are available in the News Archives.
+
+ With a new Artistic Style release some unchanged source files will be formatted because of changes to Artistic
+ Style. You may want to format your source before making program changes in order to bring it up to date.
+
+
+
Release 2.02.1 - November 2011
+
+
+ This bug fix release is issued because of the length of time required for the some of the changes in the next
+ release (2.03). Bugs with the breaking of "case" statements and a crash with pointer to pointer (**) in align-pointer=type
+ have been fixed. The "case" statements that have been incorrectly broken will be fixed in this release. Pointers
+ and references are now processed for C# files. See the "Release Notes" for more information and additional changes.
+
+
+
The following information is for the original 2.02 release.
+
+
Translations
+
+
+ A new program module and header, ASLocalizer.cpp and ASLocalizer.h, have been added. These are required for the
+ console build and are optional for the library builds. It contains language translations for several of the most
+ common users of Artistic Style. The method used was adapted from the Gnu "gettext" method.
+
+
+ The translation to use is determined from the User Locale for Windows and the LANG environment variable for other
+ systems. The translation will be done automatically from these settings. If no translation is available it will
+ default to English.
+
+
+ A new option, "ascii" or "I", will display the text in English regardless of your system settings. This option
+ must be input from the command line and not an option file. See the documentation for details.
+
+
+ The translations were mostly done with an automated translation program, Google Translate, so they may not be
+ the best translation possible. The translations are at the end of ASLocalizer.cpp in the form of an English‑Translation
+ pair. If you correct a translation, send the source as a bug report and it will be included in the next release.
+
+
+ To add a language, add a new translation class to ASLocalizer.h. Add the English‑Translation pair to the
+ constructor in ASLocalizer.cpp. Update the WinLangCode array, if necessary, and add the language code to the function
+ setTranslationClass(). The ASLocalizer.cpp program contains comments that give web pages for obtaining the LCIDs
+ and language codes. Send the source code as a bug report and it will be included in the next release.
+
+
+
Brackets
+
+
+ Since release 1.22 (April 2008) the predefined styles have increased from 5 to 12 and the bracket types have increased
+ from 4 to 6. Having two different ways of defining bracket styles has resulted in some confusion and unnecessary
+ duplication. This release starts a redesign of the bracket definitions to simplify the user interface. The predefined
+ styles and bracket types will be combined into a single option category.
+
+
+ The "Predefined Style" options have been renamed "Bracket Style" options. The "Bracket Options" have been depreciated
+ and will be removed in a future release. If you are using a "brackets=" option, you should start changing to one
+ of the "style=" options. There is a "style" option available for every "brackets" option.
+
+
+ All "Bracket Style" options now default to 4 spaces per indent. If you were using a "Predefined Style" with a
+ default indent other than 4, you will need to add one of the "Tab Options" to maintain the same indentation. The
+ styles which used indents other than 4 were:
+
+
+
Stroustrup - 5 spaces per indent.
+
Gnu - 2 spaces per indent.
+
Linux - 8 spaces per indent.
+
Horstmann - 3 spaces per indent.
+
+
+ There is a new "Bracket Style" option "style=pico" or "A11". It uses run-in brackets, like Horstmann style, and
+ attaches the closing bracket to the last line in the block. It sets the options "keep one line blocks" and "keep
+ one line statements". This is a very compact style and is a good style for small monitors.
+
+
+ Another new "Bracket Style" option is "style=lisp" or "style=python" or "A12". It uses attached brackets, like
+ Java style, and attaches the closing bracket to the last line in the block. It sets the option "keep one line
+ statements". This style makes indentation the only way of distinguishing blocks of code, but has the advantage
+ of containing no uninformative lines. Like Pico, it is also a very compact style.
+
+
+ The option "brackets=horstmann" has been removed. Instead use "style=horstmann" or "A9". The short option "g"
+ is now equivalent to the new "brackets=run-in". Run-in brackets are used for both Horstmann and Pico styles.
+
+
+ The option "indent-brackets" and short option "B" have been removed. Instead use "style=whitesmith" or "style=banner".
+
+
+ The option "indent-blocks" and short option "G" have been removed. Instead use "style=gnu".
+
+
+ Two new options, "style=break" and "style=attach", have been added for Allman and Java bracket styles respectively.
+
+
+
Other Changes
+
+
+ To allow for future expansion the short options will now allow an "x" prefix to be used. New short options may
+ start with an "x" and will be followed by another character (e.g. "xa", "xb", "xc" ...). The current options,
+ with one exception, will still be valid.
+
+
+ The short option for "delete-empty-lines" has been changed from "x" to "xd" to allow for the expansion of short
+ options.
+
+
+ A new option "align-reference=" (-W#) allows references to be aligned separate from pointers. See the documentation
+ for details.
+
+
+ Since computer screens are getting wider the maximum value for "max-instatement-indent" has been increased from
+ 80 to 120.
+
+
+ New options ignore‑exclude‑errors (‑i) and ignore‑exclude‑errors‑x (‑xi)
+ will allow processing to continue if there are errors in the "exclude" options. This lets the excludes for several
+ projects to be entered in a single option file. The "ignore" options may be placed in the same option file as
+ the excludes. The ignore‑exclude‑errors option will display the unmatched excludes, ignore‑exclude‑errors‑x
+ will not display them.
+
+
+ Artistic Style can now format UTF-16 encoded files, both little and big endian. This encoding is the default for
+ Visual Studio Unicode files. The file is formatted by converting it to UTF‑8 and then back to UTF‑16.
+ The conversion process does not add a significant amount of time to the formatting. The UTF-16 file must be encoded
+ with a byte-order-mark (BOM) to be recognized. Again, this is the Visual Studio default.
+
+
+ The Visual Studio project files now have a solution for both Win32 and x64 compiles. The x64 version will be needed
+ if you are using an Artistic Style DLL for Java or C# on a Windows 7 platform. Or you may just prefer an
+ x64 console program. The executable included in the Windows distribution is still Win32. It will work on both
+ Win32 and x64 systems.
+
+
+ If you use Visual Studio C++ Express the 2010 release has the ability to compile x64 code. But you must use Vista
+ or Windows 7 and need to install the .NET Framework SDK. I have created a brief instruction page here. Note
+ that a fix is required if you apply Service Pack 1 after installing the .NET Framework SDK.
+
+
+ The documentation contains a new section "Command-line Only" which lists commands that are not available from
+ an options file. The options were transferred from the "Other Options" section.
+
+
+ Thanks to Milian Wolff, Johannes Martin, and Arne F?rlie, and Marvin Humphrey for their contributions. The UTF‑8
+ and UTF‑16 conversions were obtained from the SciTE source code editor.
+
+
+
Survey Results
+
+
+ The results of the survey posted last release are available at General Information and Artistic Style Options.
+ Thanks to everyone who took the time to complete it.
+
+
+ Surveys give an indication of how many people are using an option or want certain features. This is information
+ that is not available in the bug reports.
+
+
+ In the "Enhancements" group there were three items with multiple requests. The most frequent request by far was
+ to enforce a maximum line length. This is also the oldest request in the bug reports. Another item with multiple
+ requests was to disable/enable Artistic Style formatting on request within source files. This is the second oldest
+ request in the bug reports. A third item with multiple requests was to customize namespace brackets independent
+ of the requested bracket style. I will try to address these in the next release.
+
+
+ Things that stand out to me in the multiple‑choice sections:
+
+
+
The predefined styles and brackets options were each used about 50% each. That will change with this release.
+
+
Over 50% of the survey uses Artistic Style for Windows. I have been working for a couple of years on a new program
+ based on wxWidgets. I will try to give this more priority in the future.
+
Over 75% of the survey uses Artistic Style to format entire projects.
+
About one‑third of the Windows C++ users use Artistic Style for Managed C++.
+
The most popular option is add‑brackets (60%), which was just recently added.
+
The attach‑pointer options, in total (70%), are even more popular than add-brackets. They were also recently
+ added.
+
The preserve-date option is used by nearly one-third of the survey.
+
All of the options are used by someone in the survey, even the ones I thought were outdated. The bracket styles
+ that are not used are probably a result of not having enough response.
+
+
+
Developers
+
+
+ The Artistic Style for Windows program contains a sample GUI using the new bracket style options. The old predefined
+ styles are now the bracket styles. The bracket options have been removed along with the indent‑brackets
+ and indent‑blocks options. The new bracket styles all use the same default indent of 4 spaces, therefore
+ it is not necessary to set an indentation from the bracket style. The new format is available for use with this
+ release.
+
+
+
+
+
+
Artistic Style 2.01 (November 2010)
+
+
+ With a new Artistic Style release some unchanged source files will be formatted because of changes to Artistic
+ Style. You may want to format your source before making program changes in order to bring it up to date.
+
+
+ A new feature at SourceForge is download maps that show a list of downloads by country. It is available from the
+ top menu at Develop > Download Stats (Beta), and clicking on the "top country" area. The list of downloads
+ shows about 75% of Artistic Style downloads are from non English speaking countries. This release is the start
+ of the internationalization of Artistic Style.
+
+
+ Artistic Style now sets the native local so that characters from the user’s native language will be recognized
+ in directory names and file names. Artistic Style for Windows has also been changed to use the native locale.
+ For Linux systems using UTF-8 locales, characters from any language will be recognized and any combination of
+ languages can be used. For Windows, only languages recognized by the native codepage can be used. For example,
+ the English locale (codepage 1252) also has French, German, Italian, Portuguese, Spanish, plus several other languages.
+ Other locals, such as Chinese and Japanese, only support one language. Unicode was not used due to the varying
+ degree of support by different compilers for console applications.
+
+
+ The locale setting also affects the way numbers are displayed. Language translations may be provided in a future
+ release.
+
+
+ This is a major release (2.01) because of the internationalization and changes that will occur in the next couple
+ of releases. Future releases will contain a major change to the bracket options and a rewrite of the file access
+ method. Some of the requested changes require looking at blocks of code instead of single lines. The current program
+ has been patched to do this but a rewrite of the file input is needed. These are both major changes but with the
+ new test framework in place they should be manageable.
+
+
+ There has been a change to the ‑‑min‑conditional‑indent option. Instead of using the number
+ of spaces it now uses a code expressed in number of indents. This will allow the option to be set independently
+ of the spaces per indent. If you are using the default setting of two indents, or a setting of zero indents, there
+ is no change necessary to the input. Otherwise, check the documentation for the new codes.
+
+
+ The --style=linux has been changed to ALWAYS use a minimum conditional indent of one-half the indent length. This
+ is in the style definition and cannot be changed. If you do not want this setting use the K&R style instead.
+
+
+ The MFC macros BEGIN_DISPATCH_MAP, BEGIN_EVENT_MAP, and BEGIN_PROPPAGEIDS are now formatted.
+
+
+ Checksum verification has been added to source file output that will help assure that no code has been duplicated
+ or omitted. This is effective only in the debug configuration used for testing.
+
+
+ The test framework has been changed from UnitTest++ to Google Test, which is actively maintained, has a mock object
+ framework (Google Mock), and good documentation. Regression and system testing have been automated with Python
+ scripts. Python has also been used for class verification checks and other repetitive procedures.
+
+
+ If you use Visual Studio C++ Express the 2010 release has the ability to create x64 code. But you must use Vista
+ or Windows 7 and need to install the .NET Framework SDK. I have created a brief instruction page here.
+
+
+ Thanks to Matthew Woehlke, Chris Schwarz, Chang Jiang, and Arseny Solokha for their contributions.
+
+
+
Developers
+
+
+ On the library build of Artistic Style, the second argument of the fpError typedef and the javaErrorHandler declaration
+ has been changed from "char*" to "const char*". This could cause a compile error if not changed in the source
+ statements.
+
+
+ There has been a change in the ‑‑min‑conditional‑indent option. Instead of using number
+ of spaces to indent it now uses a code expressed in number of indents. In the past this option was a problem because
+ it was also affected by changes in indent length. With this release there is only one variable affected. The option
+ is not affected by changes in indent length. The minimum conditional indent length is computed automatically by
+ ASFormatter after all the options have been processed. Refer to the code in astyle_main.cpp to see how the option
+ is processed.
+
+
+ The --style=linux has been changed to ALWAYS use a minimum conditional indent of one-half the indent length. The
+ option is set in the function fixOptionVariableConflicts.
+
+
+ The use of locales affects only the command line build.
+
+
+
Artistic Style 1.24 (February 2010)
+
+
+ With a new Artistic Style release some unchanged source files will be formatted because of changes to Artistic
+ Style. You may want to format your source before making program changes in order to bring it up to date.
+
+
+ A new bracket type option, ‑‑brackets=horstmann (-g), uses broken brackets and places run-in statements
+ on the same line as an opening bracket. This bracket type has about the same vertical compression as attached
+ brackets and in addition provides bracket alignment. It is the only style that combines the advantages of saving
+ space and aligning brackets. The "Tab and Bracket Options" section in the documentation contains the
+ details. To accommodate Hostmann brackets the "none mode" brackets will now allow run-in statements.
+ Array formatting has been changed to format run-in statements when required. There have been some general improvements
+ to array formatting. The minimum value for spaces per tab was changed from one to two. The example programs in
+ the "Developer Information" section have been changed to Horstmann brackets.
+
+
+ Two new options, ‑‑add‑brackets (-j) and ‑‑add‑one‑line‑brackets
+ (-J), will add brackets to unbracketed one line conditional statements. The ‑‑add-brackets will add
+ the brackets according to the currently requested predefined style or bracket type. If no style or bracket type
+ is requested the brackets will be the attached type. The ‑‑add‑one‑line‑brackets
+ will add the brackets as single line brackets. This option implies ‑‑keep‑one‑line‑blocks
+ and will not break single line blocks.
+
+
+ The above options allow two new predefined styles. Horstmann style, ‑‑style=horstmann (-A9), uses
+ Horstmann brackets and three spaces per indent. The so called "One True Brace Style", ‑‑style=1tbs
+ or ‑‑style=otbs (-A10), uses linux brackets and the option ‑‑add‑brackets. The basic
+ criteria for most predefined styles were obtained from the Indent Style discussion at Wikipedia. The "Predefined
+ Style Options" section in the documentation contains the details.
+
+
+ The spaces per indent can now be changed for any of the predefined styles. In previous releases the option would
+ be ignored. This will allow any of the ‑‑indent options to be used with a predefined style. If the
+ spaces per indent is not specified, the default for the style will be used.
+
+
+ A new option, ‑‑pad‑header (‑H), will insert space padding after headers ('if', 'for',
+ 'while'...). To remove any unwanted current space padding, use the option ‑‑unpad‑paren (‑U).
+ If both ‑‑pad‑header and ‑‑unpad‑paren are used, the headers will be padded
+ and the padding will be removed from other parens. This has required a change to the default formatting of paren
+ headers. They will now be left unchanged instead of automatically inserting space padding, unless the new option
+ is requested.
+
+
+ New options --align-pointer=type (-k1), ‑‑align‑pointer=middle (-k2), and ‑‑align‑pointer=name
+ (-k3) will attach a pointer or reference operator (* or &) to either the operator type (left), operator name
+ (right), or align it between the type and name. The spacing between the type and name will be preserved, if possible.
+ The recognition of pointers and references has been improved. This resulted in an improvement of the ‑‑pad‑oper
+ (-p) option.
+
+
+ A new option, ‑‑indent‑col1‑comments (-Y), will indent C++ comments beginning in column
+ one. By default C++ comments beginning in column one are not indented. This option will allow the comments to
+ be indented with the code.
+
+
+ New options --lineend=windows (-z1), --lineend=linux (-z2), and --lineend=macold (-z3) will force
+ use of the specified line end style. Valid options are windows (CRLF), linux (LF), and macold (CR). MacOld style
+ is the format for OS 9 and earlier. Mac OS X uses the Linux style. Changes in line ends will cause the file to
+ be updated, even if no other changes occur. If one of these options is not used the line ends will be determined
+ automatically from the input file.
+
+
+ Default line end processing has been improved to always output consistent line ends. It will use the line ends
+ that are most frequently used in the input.
+
+
+ The Stroustrup predefined style has been changed to use 5 spaces per indent. This is the indentation used in the
+ book "The C++ Programming Language" by Bjarne Stroustrup.
+
+
+ The minimum conditional indent for the Linux predefined style has been changed to 4, or one-half the indent-length.
+ The previous minimum conditional indent was 16 (2 indents). The new value corresponds to the soft tab in the style
+ description at Wikipedia and gives a better conformance to the definition of the style. And it gives a better
+ appearance to the continuation lines.
+
+
+ Embedded SQL statements are now formatted correctly. The formatting of the SQL statements will be maintained as
+ long as the standard hanging indent format is used. If the "exec sql" statement is indented more than the following
+ statements, the SQL will be aligned in a single column.
+
+
+ Assembler statement processing has been improved to include extended assembly and Microsoft specific assembler
+ lines and blocks.
+
+
+ The --indent-classes (-C) option has been fixed to indent C++ struct blocks containing access modifiers (public,
+ protected, and private). The struct block is not indented if there are no access modifiers in the block.
+
+
+ The formatting for C++ class initializer statements has been changed from two indents to one and an in-statement
+ indent added for continuation lines.
+
+
+ The intermediate .tmp file used in formatting has been eliminated and memory is used instead. In most cases this
+ should result in a noticeable speed improvement.
+
+
+ Checks for the maximum in-statement indent have been fixed. The indent for some long continuation lines may be
+ decreased. If you want the previous indentation, increase the ‑‑max‑in‑statement option.
+
+
+ Occasionally, someone will use Artistic Style to format a file encoded with UTF-16 or UTF-32 bit encoding. These
+ files contain many nul bytes are incompatible with the 8 bit encoding assumed by Artistic Style. Since this rarely
+ happens, Artistic Style has been changed to list these files as "unformatted" and display a warning message. The
+ files must have a Byte Order Mark (BOM) for the encoding to be recognized. These files can be changed with the
+ program iconv and with some text editors such as SciTE. For more information see the Wikipedia discussion on "Comparison
+ of Unicode encodings", "Compatibility issues".
+
+
+ The Artistic Style documentation has been changed to include a new "Padding Options" section. The padding options
+ were previously in the "Formatting Options" section. This was done to allow space for additional options in GUIs.
+
+
+ The Scripts page has a couple of new scripts, including a "clean" script in python.
+
+
+ There are new configuration and project files for Visual Studio, and additional files for Visual Studio 2010.
+ There are instructions in the "Install Information".
+
+
+ The Intel compiler for Linux, release 11.1, has a new procedure for compiles. Read the new "Install Information"
+ before using this compiler release.
+
+
+ There is now a Subversion repository for Artistic Style. A new Subversion web page describes how to check-out
+ the files. The source code is under development and some changes take several weeks to complete. And the intermediate
+ source files have not been through the extensive system tests that are done before each release. Use reasonable
+ precautions when using source code from the repository.
+
+
+ SourceForge recently made changes to their website which caused a few problems. The web page links should be fixed
+ with this release. It seems that some bug reports may have been lost. If you have submitted a report that has
+ not been addressed please check to be sure it is still there. In addition Yahoo closed their GeoCities site which
+ made the AStyleWin programs temporarily unavailable. The new site is jimp03.zxq.net/.
+
+
+ The release announcements mailing list was discontinued with the new SourceForge system. There is a new astyle-announce
+ mailing list that will be used instead. This is a low volume list that will be used for new release announcements
+ and notification of important repository commits. Member postings will not be accepted. Membership in the old
+ list was not retained so you will need to register for the new list. There is information for subscribing on the
+ "Bug Reports, Change Requests, Notification" section of the Home page.
+
+
+ Thanks to J P Nurmi (align-pointer), Mario Gleichmann (pad-header), MrTact (lineend), Christian Stimming (<<
+ and >> operators), Wim Rosseel (Perl script), Colin D Bennett (64-bit code), and Ettl Martin (cppcheck)
+ for their contributions.
+
+
+ The OpenVMS distribution is prepared by Jim Duff, an OpenVMS Systems Specialist living in Sydney, Australia. His
+ website is eight‑cubed.com.
+
+
+
Developers
+
+
+ The Artistic Style for Windows program has been updated to support the current release and can be used for an
+ example GUI. It will run on Linux under WINE. It is available at jimp03.zxq.net
+
+
+ The options --lineend=windows (-z1), --lineend=linux (-z2), and --lineend=macold (-z3) apply only
+ to the console build. It was not included in the developer builds because developers usually have their own method
+ for handling line ends.
+
+
+ The option --break-closing-brackets has been moved from Bracket Options to Formatting Options. It was being mistaken
+ for a bracket type, which it is not.
+
+
+ Rejecting a file for UTF-16 or UTF-32 bit encoding apply only to the console build. Some class libraries,
+ such as wxWidgets (and probably Qt), have the methods to convert the files to UTF-8. The handling for these types
+ of files must be determined by the individual applications.
+
+
+ There has been an additional variable, formattingStyle, added to the ASFormatter class. This is now the ONLY option
+ that needs to be set to define the style. Setting the individual options is no longer necessary. The individual
+ options are now set in the fixOptionVariableConflicts function in ASFormatter. The predefined style options will
+ now override all other options. The order of entry does not matter as in previous versions.
+
+
+
+
+
+
Artistic Style 1.23 (February 2009)
+
+
+ With a new Artistic Style release some unchanged source files will be formatted because of changes to Artistic
+ Style. You may want to format your source before making program changes in order to bring it up to date.
+
+
+ In the last few years the names of indent styles have been somewhat standardized. A typical example is the Indent
+ Style discussion at Wikipedia. To keep up to date with the industry, changes have been made to the names of two
+ of the styles. The ANSI style can now also be Allman or BSD, and for the KR or Java style you should now use only
+ Java. The KR style has always been basically the same as the Java style. The KR style is depreciated and will
+ be removed sometime in the future.
+
+
+ Four new predefined styles have been added, K&R (with an &), Stroustrup, Whitesmith, and Banner. K&R
+ style uses Linux type brackets where the depreciated KR style uses attached brackets. Notice that K&R and
+ KR are two different styles. Stroustrup style uses the new stroustrup brackets described below. Whitesmith has
+ broken brackets that are indented. Banner has attached brackets that are indented. The following table summarizes
+ the changes:
+
+
+
+
+
+
old style
+
+
new style
+
+
+
ansi
+
+
allman or ansi or bsd
+
+
+
java or kr
+
+
java
+
+
+
gnu
+
+
gnu
+
+
+
linux
+
+
linux
+
+
+
none
+
+
k&r or k/r
+
+
+
none
+
+
stroustrup
+
+
+
none
+
+
whitesmith
+
+
+
none
+
+
banner
+
+
+
+
+
+
+
+
+ There is a new Stroustrup style and bracket type. It is similar to the Linux bracket type except that the brackets
+ are attached to namespaces and classes instead of being broken. It is the style used by Bjarne Stroustrup, the
+ founding father of C++, in his book "The C++ Programming Language".
+
+
+ Indenting brackets in the Whitesmith and Banner styles causes a 'hanging indent' with switch statements and C++
+ class modifiers (public, private, protected). Microsoft Visual Studio avoids this by giving class and switch blocks
+ an extra indent when brackets are broken (Whitesmith style). Gnu Emacs gives switch blocks an extra indent but
+ not class blocks. With indented, attached brackets (Banner style), Visual Studio does not use an extra indent
+ and Emacs does not have the style. Artistic Style uses an extra indent for switch blocks and C++ class blocks
+ for both Whitesmith and Banner styles. This provides the best appearance in defining the style. If
+ a different format is wanted, use the individual options instead of the predefined style. You can try indent‑brackets,
+ indent‑classes, and indent‑swiches on a class or switch block to see the results.
+
+
+ The GNU style and indent‑blocks option have been changed to indent only the blocks within a function body.
+ The opening bracket for namespaces and classes is no longer indented. The opening bracket for functions remains
+ not indented. This is the same formatting used by the Emacs editor and is in compliance with the GNU standard.
+ The GNU style has also been changed to NOT indent namespaces by default. Namespaces can be indented by using the
+ indent‑namespaces option. This is consistent with the other predefined style options.
+
+
+ The predefined style options will now override all other options. It does not depend on order of entry as in previous
+ versions. Using a predefined style will give that style regardless of other conflicting entries. The predefined
+ styles options now define only the bracket placement and sometimes the spaces per tab. This will give users the
+ option to define the other details according to their preference. The 'Predefined Style Options' section in the
+ documentation contains the details.
+
+
+ Changes have been made to some of the long options. Most configuration files will NOT allow options to have duplicate
+ keys (e.g. the Windows registry and wxWidgets). The key is the value before the first '=' sign. If there is no
+ '=' sign then the entire option is the key. The options were changed to eliminate duplicate keys when
+ more than one option is allowed. The old options are depreciated but will still be valid until at least the next
+ release. The short options remain the same. The following options have changed:
+
+
+
+
+
+
old option
+
+
new option
+
+
+
force-indent=tab=#
+
+
indent=force-tab=#
+
+
+
brackets=break-closing
+
+
break-closing-brackets
+
+
+
pad=oper
+
+
pad-oper
+
+
+
pad=paren
+
+
pad-paren
+
+
+
pad=paren-out
+
+
pad-paren-out
+
+
+
pad=paren-in
+
+
pad-paren-in
+
+
+
unpad=paren
+
+
unpad-paren
+
+
+
one-line=keep-statements
+
+
keep-one-line-statements
+
+
+
one-line=keep-blocks
+
+
keep-one-line-blocks
+
+
+
+
+
+
+
+
+ The "else if" statements will now be placed on a single line by default. This is described as a 'fix' since it
+ was apparently always supposed to do this. The headers will be broken only if the option 'break‑elseifs'
+ is specified. Most users want the statements joined since breaking them requires an extra indent.
+
+
+ The convert‑tabs option has been changed to maintain the correct spacing according to the current tab setting.
+ Previously a tab was replaced by a single space. The current option for spaces per tab is used. It may NOT produce
+ the expected results if convert‑tabs is used when changing the spaces per tab. The tabs are NOT replaced
+ in quotes.
+
+
+ The break‑blocks and break‑blocks=all options have finally been fixed. They will no longer break statements
+ following the block and will keep preceding comments with the block. Many other fixes were required for the options
+ to work correctly. The "Release Notes" page has the details.
+
+
+ A new delete‑empty‑lines option will delete empty lines within a function or method. If used with
+ break‑blocks or break‑blocks=all it will delete all lines EXCEPT the lines added by the break‑blocks
+ options.
+
+
+ There is a new 'formatted' (‑Q) option that displays only the files that have been formatted. Files that
+ are unchanged are not displayed.
+
+
+ Short options have been added for the predefined styles.
+
+
+ Semi‑colons are now always space padded. All commas are space padded if pad‑oper is used.
+
+
+ The C/C++ keyword 'extern' no longer causes an extra indent.
+
+
+ There have been several important fixes to the indent‑brackets and indent‑blocks options.
+
+
+ There have been several important fixes to C# formatting.
+
+
+ The scripts page has a new Emacs script containing hooks that will set the Emacs style options to the default
+ options used by Artistic Style. It also defines a Banner style. It can be used to compare output from the two
+ programs. The files will not be exact but it should be reasonably close. If you can improve the Emacs script I
+ would like to have the changes.
+
+
+ There are two new projects on the Links page. CodeLite is a C++ development environment with
+ some useful features, including a template to generate a test program using the excellent tool UnitTest++. target="astyle"
+ title="open new window">Highlight converts source code to formatted text with syntax highlighting.
+ It was used it for the source code in the Developer Information section.
+
+
+ I need a Mac OS X user to do testing on new releases. The test usually take 30 minutes at the most. They may need
+ to be repeated two or three times depending on the results. Programming knowledge is not necessary but will probably
+ be helpful. Reply to the project email address if you would like to volunteer.
+
+
+ The OpenVMS distribution is prepared by Jim Duff, an OpenVMS Systems Specialist living in Sydney, Australia. His
+ website is eight‑cubed.com.
+
+
+ Thanks to Eran Ifrah and Max Horn for their contributions. Travis Robinson wrote the original C# interface program.
+
+
+
Developers
+
+
+ There is a new page in the Developer Information that has an example of calling Artistic Style from a C# program.
+
+
+ There was an omission in the peekNextLine function added in the last release which causes it to bypass empty lines.
+ If you copied the function into a program, the change is at the end of peekNextLine in astyle_main. The line containing
+ the change is marked with comments. Not correcting it may cause an infrequent line break if the option break‑blocks
+ or break‑blocks=all is used. The break will occur only if there are empty lines within comment lines that
+ precede a header.
+
+
+ There has been an additional variable, formattingStyle, added to the ASFormatter class. This is now the ONLY option
+ that needs to be set to define the style. Setting the individual options is no longer necessary. The individual
+ options are now set in the fixOptionVariableConflicts function in ASFormatter.
+
+
+ The predefined style options will now override all other options. The order of entry does not matter as in previous
+ versions. This will be done even if astyle_main is not used by your system. This was done by moving the checks
+ from astyle_main to ASFormatter. The procedure is in the function fixOptionVariableConflicts in ASFormatter.
+
+
+ The predefined style options now define only the bracket placement and sometimes the spaces per tab. This will
+ give users the option to define the other details according to their preference. It is best if the other options
+ are NOT disabled when a predefined style is selected. All options should be left available to modify the style.
+ The conflicts will be resolved by the fixOptionVariableConflicts function which is called after all options have
+ been processed. All you need to do is set the options selected by the user.
+
+
+ The Artistic Style for Windows program has been updated to support the current release. It is available at jimp03.zxq.net
+
+
+ I apologize for the unplanned changes this may add to your system. But Artistic Style is starting to mature as
+ an application and the changes are needed to bring it up to date. If you have any questions or problems, email
+ me and I will do my best to help you resolve them.
+
+
+
+
+
+
Artistic Style 1.22 (April 2008)
+
+
+ This release contains many bug fixes. The emphasis was on formatting fixes for C# files. In the last two releases
+ there have been over 80 items removed from the bug report. There have been many more fixes which were not reported
+ but were discovered while testing. The new options in this release exposed many unreported formatting problems.
+ I will try to fix the ones remaining in the next two or three releases. Some of them will be difficult to fix.
+ See the Release Notes for a complete list of changes.
+
+
+ Starting with this release, if a file is not changed by Artistic Style a new file and a backup
+ file are not created. A "make" will not recompile the unchanged file and it will not be committed to a revision
+ control system. A console message will indicate that the file is unchanged. Note that this is different from using
+ the ‑‑preserve‑date option. This option retains the date on files that have
+ changed. In this case the changed files will still be recompiled and committed to revision control. (‑‑preserve‑date
+ actually changes the time by one unit).
+
+
+ In the rare case when Artistic Style aborts, the file being formatted will no longer be deleted. This is done
+ by using a temporary output file (.tmp). It should now be safe to manually abort Artistic Style and restart at
+ any time. The backup of files that were previously formatted will not be replaced.
+
+
+ The console display has been changed. The default now displays one line per file. This will be useful if only
+ one file is being formatted, such as when Artistic Style is called from a text editor or development environment.
+ A new ‑‑verbose (‑v) option will display optional information, such as release number and statistical
+ data. A new ‑‑quiet (-q) option will suppress all output except error messages. Some short options
+ have changed to accommodate the new options. The short option for ‑‑version is now -V (old -v) and
+ for ‑‑convert‑tabs is ‑c (old ‑V).
+
+
+ A new ‑‑recursive (-r, or -R) option will process subdirectories recursively. The filename should
+ contain a wildcard (e.g. "$HOME/astyle/src/*.cpp"). Linux users should place the filename in double quotes so
+ the shell will not resolve the wildcards. Windows users should not include wildcard object files,
+ like setargv (Visual C) or wildargs (Borland), in the compiles. Wildcard processing in MinGW was excluded by adding
+ "int _CRT_glob = 0" as a global variable. (It could also be excluded by linking to CRT_noglob.o).
+ Artistic Style now does the wildcard processing internally.
+
+
+ When processing directories recursively it is sometimes necessary to exclude certain files or directories. This
+ can be done using a new exclude (‑‑exclude=file‑or‑directory) option. There is no short
+ option. Multiple exclude statements are allowed. The Other Options section of the documentation contains the details.
+
+
+ It is always a good idea to create a backup for files that have been formatted. This can cause a problem in that
+ it creates a lot of excess files in your source directories. There are now new script files available that will
+ move the files to a backup directory. The original directory structure will be maintained the in the backup. There
+ is a batch file for Windows and a shell script for everyone else. They are available in the Scripts section of
+ the home page.
+
+
+ There is a new Links page that lists programs using Artistic Style. In general, they seem to be good quality software.
+
+
+ If you are using a development environment to compile Artistic Style, be sure to read the Compiler Options section
+ in the Install Information. In particular, you should define NDEBUG in the Release compile to remove the assert
+ statements. There are quite a few of these and they will slow down processing if NDEBUG is not used. The assert
+ statements are necessary due to the nature of the program. Also, when reporting bugs it is a good idea to log
+ in first. Occasionally, more information is needed on a problem. If the poster did not log in there is no way
+ to contact them.
+
+
+ A Java Native Interface has been added for Java developers. This will allow an Artistic Style shared library (DLL)
+ to be called from a Java program. A shared library (Dll) using the Java interface can still be called from C,
+ C++, or C# programs. There is a sample program in the Developer Information.
+
+
+ Developers using Artistic Style in another project should be aware that there are two new functions
+ that have been added to the ASStreamIterator class (peekNextLine() and peekReset()). These will have to be coded
+ into source modules which use Artistic Style without astyle_main. In most cases the functions can simply be copied
+ without the template information. The assert statements may also be removed. A variable will need to be added
+ to the class and another may need to be modified. If the shared or static library configuration is being used
+ then no changes are necessary.
+
+
+ The file globing function was obtained from "The Code Project" and was written by Jack Handy. It was modified
+ slightly to make the comparisons case insensitive for Windows.
+
+
+ The OpenVMS distribution is prepared by Jim Duff, an OpenVMS Systems Specialist living in Sydney, Australia. His
+ website is eight‑cubed.com.
+
+
+ Thanks to Emilio Guijarro and Jens Krinke for their contributions, and to Sam Cooler for testing the Mac OS X
+ version.
+
+
+
+
+
+
Artistic Style 1.21 (June 2007)
+
+
+ This release contains many bug fixes. Array formatting and indentation has been improved. Arrays and enums are
+ now formatted by a different procedure than functions. Brackets will now attach to lines with comments. Brackets
+ will be broken from lines with comments without bringing the comments with them. All comments will remain in their
+ original column, if possible. The formatting of empty blocks was fixed. The BracketType definition was expanded
+ and the bracket types are now correctly identified. There are several formatting fixes for Java files. See the
+ Release Notes for a complete list of changes.
+
+
+ A new option, --preserve-date (-Z), has been added. This will retain the date modified of the original file in
+ the new formatted file. Otherwise the new file will contain the current date.
+
+
+ The option --errors-to-standard-output has been shortened to --errors-to-stdout. The short options
+ -c (mode=c) and -j (mode=java) have been removed. The options should seldom be needed since the mode is now set
+ automatically from the file extension for each source file instead of for each program execution.
+ A new long option --mode=cs (C#) has been added. Key words are now set for each file depending on the file mode
+ (C, Java, or C#). This will eliminate formatting problems caused by not being able to identify the source code
+ language.
+
+
+ There has been a change to the Linux style bracket formatting for C++ header files. In the past brackets have
+ been broken for function definitions within a class. With this release the brackets will be attached. The brackets
+ will also be attached for arrays, structs, enums, and other top level objects that are not classes or functions.
+ The Linux style formatting for Java and C# has not been changed.
+
+
+ This release supports only one platform in each distribution package. In the past all platforms were included
+ in every package. If you use Artistic Style on more than one platform you will need to download packages for each
+ platform. The main difference in platforms is the build directory and the line endings. The source code and documentation
+ are the same for all packages.
+
+
+ There are new instructions about optimizing compiler options in the Install Instructions. If you are compiling
+ using a development environment you may want to read them.
+
+
+ If you have broken brackets with comments attached to the opening bracket instead of the previous line, do the
+ following before formatting again with broken brackets. Use the current Artistic Style release
+ (1.21). Format the source using attached brackets to reattach the brackets and the comments to the previous line.
+ Then format the source again using broken brackets. This will move the brackets to the next line without the comments.
+ The comments will now be on the correct line.
+
+
+ There is a new multi-platform GUI program, UniversalIndent, available at sourceforge.net/projects/universalindent.
+ It allows you to view the effects of the Artistic Style options on your source code without saving the file. You
+ can review the results of the formatting options before updating the file. It can be used with a test file or
+ with your actual source code. It supports several other formatting programs. The Artistic Style for Windows
+ program has been updated to support the current release. It is available at jimp03.zxq.net
+
+
+ There have been a few inquiries about how to customize Artistic Style for an unsupported format. Changes can be
+ made with Python or another text processing program after formatting the source, or you can modify the Artistic
+ Style source code itself. The best place to modify the code is usually in ASEnhancer.cpp. The ASEnhancer class
+ is called after the main formatting has been done so you are getting a formatted file. If you just need to change
+ the indentation of a few things this is probably the best place to do it.
+
+
+ There is now a distribution package for OpenVMS thanks to Jim Duff, an OpenVMS Systems Specialist living in Sydney
+ Australia. His website is at eight-cubed.com.
+
+
+ Thanks to Norbert Holzki and Siemens AG, Medical Solutions, Forchheim, Germany for testing the array formatting.
+
+
+ Thanks to Sam Cooler for testing the Mac OS X version.
+
+
+
+
+
+
Artistic Style 1.20 (January 2007)
+
+
+ Release 1.20.2 fixed problems with the new stream I/O procedure added in release 1.20.1. Release 1.20.1 improved
+ the processing for Mac OS X platforms. The compatibility with TextWrangler was improved. There is now a separate
+ release for Mac.
+
+
+ Artistic Style will now indent message maps for Microsoft Foundation Class (MFC) and event tables for wxWidgets.
+ The option --brackets=break-closing-headers has been shortened to --brackets=break-closing and a short option
+ added (-y). There have been short options added for --break-elseifs (-e), --indent-preprocessor (-w), --break-blocks
+ (-f), and --break-blocks=all (-F).
+
+
+ With this release the Artistic Style license changes from the GNU General Public License (GPL) to the GNU Lesser
+ General Public License (LGPL). You can use Artistic Style for free or commercial software without charge. Projects
+ that use Artistic Style do not have to make the their source code available. If Artistic Style itself is modified,
+ however, the modified Artistic Style source code must be made available. See the GNU Lesser General Public License
+ for more information.
+
+
+ There is a new preprocessor option to aid developers in using Artistic Style with a Graphical User Interface (GUI).
+ It is no longer necessary to remove the source module astyle_main.cpp and write embedded code to call the formatter.
+ It can be compiled as a static library or a shared library (DLL), or the entire source code can be included in
+ the project. See the Artistic Style Developer Information for the calling procedure and other details.
+
+
+ There is a sample GUI program for Windows available at http://jimp03.zxq.net/. It uses the unmodified Artistic
+ Style compiled for a GUI. The source code needs some work so it is not available for now. It should work under
+ Linux using WINE. Future enhancements and platform support will depend on the response to the sample program.
+
+
+ To support the new Artistic Style preprocessor option there are new makefiles and project files. Windows users
+ have a project file for Microsoft Visual C++ 2003 (version 7). Linux users have a new makefile that has several
+ new options. The location of both files is in the build directory. Be sure to read the "Artistic Style Install
+ Information" for the details.
+
+
+ Intel® is now offering it's C++ and Fortran compilers free for non-commercial use. Information is available
+ at the Intel® Software Development Products website. Click on the "Free Non-Commercial Download" link to see
+ if you qualify. The Intel Compilers on Windows and Linux require that other compilers be installed (Microsoft
+ Visual C++ or GNU gcc respectively). This is because the Intel Compilers require the header files, runtime libraries
+ and linkers distributed as part of these other compilers. If you want to use this compiler there is now a makefile
+ (makeintel) included with the project. See "Artistic Style Install Information" for instructions.
+
+
+
+
+
+
Artistic Style 1.19 (July 2006)
+
+
+ Most changes this release were again concerned with the options pad=oper and pad=paren. The formatting still worked
+ a little different if both options were declared than if only one was used. The problems with distinguishing the
+ multiplication operator from pointers, and of separating an object from the member access pointer (->) were
+ fixed.
+
+
+ A new option, unpad=paren, was added. This will undo the pad=paren, pad=paren-out and pad=paren-in options. It
+ can be used alone or with pad=paren-out or pad=paren-in. If used alone it will unpad all parens that have been
+ previously padded. If used with a paren padding option, the paren padding option will take precedence and only
+ the unnecessary padding will be removed. This will enable the paren padding to be changed in one formatting run.
+
+
+ Padding to paren headers (e.g. "if", "for", "while") was reinstated. This was done in previous releases if pad=oper
+ was used. Since most people used this option, the headers were usually padded. The general opinion was that they
+ looked better padded, especially in the case of "else if" statements. Since it is a minor point, it was not made
+ an option.
+
+
+ This is the third release of Artistic Style in the last four months. The reason for the frequent releases was
+ the number of pervasive errors in the formatting. In the future there will probably be two or three new releases
+ per year, or one every four to six months. It will take about three years to make all the changes that are planned
+ at this time.; The releases will be a combination of fixes, changes to formatting, and new features.
+
Fix to not automatically space pad C++11 uniform initializer brackets (#275).
+
Fix formatting of enums with leading commas (#159, #179, #270).
+
Fix formatting of logical && operator in class initializers (#290).
+
Fix flagging a 'const' variable as a 'const' method (#275).
+
Fix piping and redirection adding an extra character to the output (#245, #252, #305).
+
Fix "indent-modifiers" to attach class access modifiers to Horstmann style brackets.
+
Fix ASFormatter to correctly recognize the end of a C++ raw string literal (#261).
+
Fix to recognize C++11 "enum class" as an enum (#303).
+
Fix indent of C++11 "noexecpt" statements within a class (#260, #304).
+
Fix not resetting templateDepth when a template was not found (#295).
+
Fix formatting of multiplication in a block paren (#144).
+
Fix whitespace padding when formatting an rvalue references (#297).
+
Fix to recognize an rvalue reference without a name (#265).
+
Fix to not identify an operator overload method as a calculation (#296).
+
Fix concatenating multiplication with a pointer dereference (#291).
+
Fix recognition of a pointer dereference following a question mark (#213).
+
Fix extra space after a trailing reference type (#300).
+
Fix _asm blocks not being identified as a block opener and the variable not cleared on exit (#163).
+
Fix indentation of line comments before a "class" opening bracket.
+
Fix indentation of line comments before a "namespace" opening bracket.
+
Fix isBracketType() method to correctly process a NULL_TYPE.
+
Fix unpad-paren to recognize additional variables (#43, #132, #143).
+
Fix indentation of C# "let" statements.
+
Fix a few omissions with "fill-empty-lines".
+
Fix file read to read 64K blocks of data.
+
Refactor to un-obfuscate (clarify) the code, and improve design and decomposition:
+
+
Extract class Utf8_16 from ASConsole.
+
Replace Linux dependency on iconv with a Utf8_16 class for ASLibrary.
+
Move global "using" statements to the astyle namespace in astyle.h and ASLocalizer.h.
+
Move shared library declarations from astyle.h to astyle_main.h.
+
Move indentable macros from ASEnhancer to ASResource and create static pairs.
+
Simplify ASBeautifier procedure to identify the colon (:) type.
+
Major refactoring in ASBeautifier to create separate variables for an enum, a class statement and a class initializer.
+ This was needed to fix the processing of C++11 uniform initializers in a class initializer.
+
+
Minor changes to ASFormatter and ASBeautifier based on results of the Clang analyzer.
+
Change several methods in astyle_main to "const".
+
+
+
+
+
Artistic Style 2.04 (November 2013)
+
+
+
Add new programming language Objective‑C.
+
Add new bracket style option "style=google" (-A14).
+
Add new option "indent-preproc-cond" (xw) to indent preprocessor conditional statements (#118).
+
Add new bracket modify options "attach-namespaces", "attach-classes", "attach-inlines", and "attach-extern-c".
+
+
Add new option "indent-modifiers" (-xG) to indent class access modifiers one-half indent (#130).
+
Add new option "remove-brackets" (-xj) to remove brackets from single line conditional statements.
+
Add new option "remove-comment-prefix" (-xp) to remove the leading '*' from multi-line comments.
+
Add new option "align-method-colon" (-xM) to align Objective‑C method colons.
+
Add new option "pad-method-colon=#" (-xP#) to space pad Objective‑C method colons.
+
Add new options "pad-method-prefix" (-xQ), and "unpad-method-prefix" (-xR) to pad the Objective‑C "-" and
+ "+" method prefix.
+
Add new dll entry point AStyleMainUtf16 for processing C# UTF-16 strings.
+
Add formatting of C++11 raw string literals (#222).
+
Add "style=knf" as an alternative to "style=linux".
+
Remove depreciated "bracket=" options.
+
Improve recognition and formatting of pointers and references (#174 and other changes).
+
Improve the recognition of block-opening brackets.
+
Improve code using a static code analyzer (#195).
+
Change "max-code-length" to include Objective‑C methods.
+
Change "indent-elseifs" and "break-blocks" to look ahead only if in command-type brackets (speed improvement).
+
+
Fix linux bracket styles to break the opening bracket in inline function definitions (#185).
+
Fix indentation of switch block comments (#164).
+
Fix enums to indent with tabs when requested (#92, #121).
+
Fix formatting of rvalue reference without a name in a declaration (#219).
+
Fix "pad-first-paren-out" to not pad if the following parens are empty (#232).
+
Fix end-of-statement reset when comments follow closing bracket.
+
Fix the ASBeautifier active and waiting stacks to delete the ASBeautifier objects before deleting the pointers.
+
+
Fix ASBeautifier "init" to delete the tempStack vectors before deleting the tempStack.
+
Fix Linux piping problem by changing "cin" input to build a stringstream before formatting.
+
Fix to identify the correct bracket type when 'extern "C"' is part of the enum definition.
+
Fix to clear 'extern "C"' variables when the block is closed.
+
Fix unindented 'extern "C"' to not indent when in a #else preprocessor directive.
+
Fix not always correctly formatting linux type brackets for enum blocks.
+
Fix align-pointer in a range-based for statement (#217).
+
Fix pointer-reference argument alignment to correctly position a following comment (#235).
+
Fix to not attach a bracket to a line ending in a backslash '\' (#186, #214, #220).
+
Fix to recognize templates using multiple lines (#85, #87, #136).
+
Fix formatting of template continuation lines (#85, #87, #136).
+
Fix to allow '^' as an array operator (#233).
+
Fix an "enum" argument being mistaken for an enumeration (#211).
+
Fix to recognize a non-instatement array after a "},{" sequence.
+
Fix "pad-oper" to not pad before a following comma.
+
Fix recognition of an operator when the calculation contains a bitwise "not" '~' (#166).
+
Fix to allow a preprocessor statement within a preprocessor define (#238).
+
Fix preprocessor comparison to check for whole words (#246).
+
Fix "add-brackets" when a line contains more than one paren pairs (#181).
+
Fix to allow Mac old CR line endings in the options file (#129).
+
Refactor to aid debugging and improve design and decomposition:
+
+
Move ALL preliminary indentation calculations to computePreliminaryIndentation() in ASBeautifier.
+
Move calculation of 'force tab' indents to preLineWS() in ASBeautifier.
+
Combine methods init() and init(ASSourceIterator*) in ASBeautifier.
+
Extract method adjustParsedLineIndentation() in ASBeautifier.
+
Extract method parseCurrentLine() in ASEnhancer.
+
Remove astyle_main.cpp unused functions getFilesUnchanged, getOptionsFileRequired, and setOptionsFileRequired.
+
+
+
+
+
+
Artistic Style 2.03 (April 2013)
+
+
+
Add new option "indent=force-tab-x=#" (-xT#) to allow a tab length that different from the indent length (3430662).
+
+
Add new option, "pad-first-paren-out" (xd), to pad only the first paren in a series on the outside (3350356).
+
+
Add new option "max-code-length=#" (-xC#) to limit the length of code on a line.
+
Add new option "break-after-logical" (-xL) to modify a "max-code-length" line break for conditionals.
+
Add new option "close-templates" (-xy) to close whitespace in the angle brackets ">" of template
+ definitions.
+
Add formatting of C++ rvalue references (&&) using the existing "align-pointer" and "align-reference"
+ options.
+
Add formatting of C++/CLI managed pointers (the "^" character) to the "align-pointer" option.
+
Add translations for Dutch, Finnish, Italian, Japanese, Korean, Polish, Portuguese, Russian, Swedish, and Ukrainian.
+
+
Remove byte-order-mark from ASLocalizer.cpp.
+
Change the short option for delete-empty-lines from "xd" to "xe".
+
Change the ASTYLE_LIB option to remove __declspec for a Visual C static library when ASTYLE_NO_VCX is also declared.
+
+
Change to remove any space padding in a pointer to pointer (**).
+
Fix "break-elseifs" to format one-line "if" and "else" statements the same as when the option is not used.
+
+
Fix "break-elseifs" to break else-if statements when "keep-one-line-statements" also is requested.
+
Fix "break-elseifs" to correctly format comments preceding the else-if.
+
Fix C# not correctly identifying lambda expressions as a command-type bracket.
+
Fix C# preprocessor statements adding extra empty lines when "break-blocks" is used.
+
Fix C# padding "get" and "set" statements that are not headers when "break-blocks" is used.
+
Fix C# to recognize the "#line" statement.
+
Fix C++11 standard for range-based "for" loops (3458402, 3480095).
+
Fix C++11 standard for "enum" with a base type (3458402).
+
Fix C++11 standard for template closing angle brackets (no space required) (3495192).
+
Fix C/C++ keyword 'extern "C"' in a preprocessor causing an extra indent (1514844, 2953388, 2963382, 3093842,
+ 3467479).
+
Fix breaking after a switch "default" statement when "break-elseifs" is used without "keep-one-line-statements"
+ (3559365).
+
Fix in-statement arrays to indent correctly when they exceed the "max-instatement-indent".
+
Fix quote continuation sometimes being processed as a preprocessor directive (3445475).
+
Fix formatting of some conditional statements on a continuation-line.
+
Fix Java formatting of generics with wildcards (3428140).
+
Fix formatting of pointers and references to work with the new "max-code-length" option.
+
Fix formatting of pointers and references after a template close.
+
Fix formatting of empty attached brackets (3505002).
+
Fix C comments beginning a line breaking if they follow a semi-colon (3502700).
+
Fix "pad-header" not padding "return" and "throw" statements (3509134).
+
Fix recognition problems with templates.
+
Fix "struct" return type being mistaken for a struct.
+
Fix "pad-oper" in java for-each loop.
+
Fix recognition of a macro multi-line comment (3414970).
+
Fix bracketTypeStack entries added by #if and #else if the # is separated from the word.
+
Fix C++ breaking a line on an access modifier in a one-line block when "keep-one-line-blocks" is used.
+
+
Fix memory leak when "ascii" option is used.
+
Fix memory leak when a preprocessor statement is used without a closing #endif.
+
Fix preprocessor directive to allow compiling with mingw-x64 compiler.
+
Fix redirection on Windows so it does not hang when Linux line ends are used (3514712).
+
Fix redirection on Linux to output the correct line ends (3514712).
+
Fix non-portable return value on locale name (3452574).
+
Fix assert errors caused by not checking the text length on the return from peekNextText().
+
Fix spelling of "depreciated" in help message (3454735).
+
Refactor to improve design and decomposition:
+
+
Fix warning messages from Visual Studio static code analysis.
+
Fix warning messages from cppcheck, except for constructor uninitialized variables (false positive).
+
Remove astyle_main.h dependency from ASLocalizer.h
+
Remove appendChar() from the inline functions.
+
Extract methods for pointer or reference alignment in ASFormatter.
Fix bracketFormatMode of NONE_MODE to correctly break single line blocks.
+
Fix --keep‑one‑line‑blocks breaking 'if' statements when --break‑elseifs is used.
+
Remove inefficiencies for speed improvement.
+
+
Reduce calls to frequently used functions by first checking for specific requirements.
+
New class ASBase to inline frequently used functions and eliminate duplication between classes.
+
Change ASEnhancer from inherited to embedded to eliminate scope resolution requirements.
+
Change ASFormatter to output words instead of characters.
+
Resequence operator vectors and add new findHeader and findOperator functions.
+
+
+
Fix NONE_MODE brackets to break a statement on the same line as an opening broken bracket.
+
Add 'errno' message for file and directory errors in the Linux build.
+
Add error checking for file remove and rename procedure.
+
Fix Linux abort for file sizes over 2 GB.
+
Fix searching the entire directory when only one file is requested.
+
Change --preserve-date increment to 2 units for Visual Studio 2008.
+
+
+
Artistic Style 1.22 (April 2008)
+
+
+
New --recursive (-r, -R) option to recursively process sub directories.
+
New --exclude option to exclude files and sub directories from processing.
+
New --verbose (-v) option to display optional information, such as release number and statistical data.
+
New --quiet (-q) option to suppress all informational messages.
+
Change --version short option to -V.
+
Change --convert‑tabs short option to -c.
+
Change to NOT write a new or backup file if a file contents has not changed,
+
Change console file input procedure to create a .tmp file and preserve the input file on a crash.
+
Add Java Native Interface (JNI) for developers.
+
New peekNextLine and peekReset functions in ASStreamIterator.
+
Change ASEnhancer static variables to class member variables and reset them in the init() function.
+
Patch from Jens Krinke to fix stack underrun when the number of closing brackets exceed opening brackets.
+
Fix stack underrun when the number of closing parens exceed opening parens.
+
Fix processing of C/C++ string literal continuation lines.
+
Patch from Emilio Guijarro to correct padding and formatting of C# 'foreach' statements.
+
Fix C# to correctly identify accessor calls as not being headers.
+
Fix C# accessors (get and set) to break when breaking single line blocks.
+
Modify template procedure to process C# generics.
+
Fix processing of C# verbatim string literals.
+
Fix indentation of C# methods containing 'base' or 'this' keywords.
+
Fix indentation of C# methods containing generics.
+
Fix indentation of C# enums containing a type.
+
Fix indentation of C# catch blocks when 'catch' is a non-paren header.
+
Fix C# breaking of linux style brackets for methods containing generics and methods containing accessors.
+
Allow @ as a C# identifier prefix.
+
Fix assert error on C# UTF-8 files when the byte-order mark (BOM) is not followed by a space or a comment.
+
+
Fix nested preprocessor formatting by adding waitingBeautifierStack, activeBeautifierStack, waitingBeautifierStackLengthStack,
+ and activeBeautifierStackLengthStack to the ASBeautifier copy constructor and class destructor.
+
Fix ASStreamIterator end of file procedure for ASTYLE_LIB option.
+
Add pragma statements for Intel compiler to disable specific warning messages.
+
Move line number accumulators from ASSourceIterator class to private in ASStreamIterator class.
+
Fix reset of ASFormatter isInPreprocessor flag when \ is followed by a blank line.
+
Fix cin, cout, and cerr continuation lines to be indented.
+
Fix indentation of inner classes that inherit a base class.
+
Add astyle_main.cpp function declarations to astyle_main.cpp.
+
Change global variable prefix from '_' to 'g_'.
+
Inline selected ASStreamIterator functions.
+
Fix brackets=attach from attaching a bracket to a preprocessor directive.
+
Fix brackets=attach and brackets=linux breaking in an array immediately after a preprocessor directive.
+
Modify Jack Handy's wildcmp() function to make Windows comparisons case insensitive.
+
Fix not indenting a bracket when an attached bracket is broken and the following line is a no-indent comment.
+
+
Add error message if 'options=' file cannot be opened.
+
Bypass colon enclosed in quotes when processing 'case' statements.
+
Fix brackets=none not always breaking a closing bracket when breaking single line blocks.
+
Fix padding of header words that are in a definition (array).
+
Fix indentation of line immediately after a case statement where the object is enclosed in parens.
+
Fix breaking of multiple case statements when the object is enclosed in parens.
+
Fix indentation when there is more than one case statement on a line.
+
Remove processing for shouldBreakLineAfterComments (no longer used).
+
Fix brackets=break not breaking if before a comment that is not at end of line.
+
Fix brackets=none not space padding before a bracket.
+
Fix brackets=break and brackets=none not breaking comments following a bracket.
+
Fix blank line not being trimmed if inside a comment.
+
Fix brackets=break incorrectly space padding a preceding preprocessor statement line.
+
Fix brackets=attach attaching two consecutive opening brackets before an end-of-line comment.
+
Fix break-blocks not inserting a blank line if a bracket preceding a comment was moved to the following line.
+
+
Add 'X' to selected ASEnhancer variables to prevent conflict with ASBeautifier.
+
Fix brackets=none not space padding after a closing bracket that precedes a closing header.
+
Change minimum indent edit from 2 spaces to 1 space.
+
Change to check for preprocessor definitions in C/C++ files only.
+
Fix padding of template definitions when pad=oper is used.
+
Fix comment formatting in nested preprocessor definitions.
+
Fix header dependencies and warning messages for Linux GCC 4.3.
+
Use file name from disk for output to maintain correct case in Windows.
+
Fix pad=operator padding a negative value in a case statement.
+
Fix incorrect identification of bracket type following a struct statement.
+
Fix indentation of blank lines outside of brackets when --fill‑empty‑lines is used with --indent‑blocks
+ or --indent‑brackets.
+
Fix ASFormatter not identifying comments in preprocessor directives.
+
Fix brackets=attach deleting a preceding blank line in array type brackets.
+
+
+
Artistic Style 1.21 (June 2007)
+
+
+
New function, formatArrayBrackets, to improve array formatting and indentation.
+
Attach brackets to lines with end-of-line comments.
+
Break brackets from lines with end-of-line comments without bringing the comments with them.
+
Move ASFormatter and ASBeautifier static initialization from constructor to "init" function to allow for changes
+ in the file type.
+
Add --preserve-date (-Z) option.
+
New functions formatBrackets, padOperators and PadParens to improve decomposition.
+
Add identification of file mode (C, C#, or Java) to file open procedure.
+
Keywords in headers now depend on file mode (C, C#, or Java) and object type (formatter or beautifier).
+
Remove short options -c (mode=c) and -j (mode=java) since the mode is now set automatically from the file extension.
+
+
Change Linux bracket formatting for header files.
+
Fix formatting of empty blocks.
+
Expand BracketType definition.
+
Fix "do not change" bracket mode inconsistencies with other bracket formatting.
+
Remove mode=java from Java predefined style.
+
Change long option --errors-to-standard-output to --errors-to-stdout.
+
Fix breaking of struct variable declaration.
+
Add support for OpenVMS compiler.
+
Inline the ASBeautifier function isLegalNameChar.
+
Fix no-indent of block comments starting in column 1 or 2.
+
Fix formatting of Java anonymous class defined as a method call parameter (bracket within a paren).
+
Fix indentation for Java "for each" statement.
+
Fix bracket being attached to a preprocessor directive.
+
Fix extra indent of single line blocks when a previous line probation header is found.
+
Fix formatting of block comments when continuation lines have different leading whitespace characters.
+
Fix deleting a blank line before a bracket when brackets=attach.
+
Fix segmentation fault on preprocessor continuation line followed by an empty line.
+
Fix bad bracket indent that sometimes occurs when brackets=attach and it cannot be attached.
+
Fix trimming of comment lines.
+
Fix incorrect identification of "new" operator pointers as calculations.
+
Fix incorrect identification of assignments as command type bracket.
+
Fix incorrect indentation of pointers following a dot operator or pointer.
+
Fix attaching "else if" statements to a single line block.
+
Fix header recognition problem when header is proceeded by a tab instead of a space.
+
Fix line break when colon is followed by a comment.
+
Fix ASBeautifier not identifying a template definition.
+
Change indents around the end of line to two indents.
+
Change header includes to fix header dependencies for Linux GCC 4.3.
+
Add output line number for debugging.
+
Add filename to trace output.
+
Add trace for arrays.
+
Add trace for bracketType.
+
Fix no-indent comment in a #else preprocessor directive.
+
Fix block comment continuation line indent when block comments do not start the line.
+
Adjust position of block comments (/*) when padding is added or deleted.
+
Fix incorrect formatting if "return" is included in a function name.
+
Fix incorrect padding if template depth is greater that one and pad=oper is used.
+
Fix incorrect bracket type identification when bracket is followed by a comment.
+
Fix incorrect bracket type identification when a "const" method is declared.
+
Fix incorrect bracket type identification when pre-definition header is inside a paren.
+
Fix deleting a space when attaching a bracket with line comments.
+
Fix indentation when the conditional "?" operator is used in a single line statement.
+
Fix indentation when single line "if" statement is used.
+
Add pointers, multiply operators, and selected variables to do not unpad in paren unpad procedure.
+
Return exit code 0 for --version and --help.
+
+
+
Artistic Style 1.20.2 (February 2007)
+
+
+
Fix problems with the new stream I/O procedure added in release 1.20.1:
+
+
Fix adding an extra blank line at end of document.
+
Fix line ending on last line when cin and cout option is used.
+
+
+
+
+
Artistic Style 1.20.1 (January 2007)
+
+
+
The following changes were made to improve processing for Mac OS X platforms:
+
+
Remove Makefile linker option -s and add a separate "strip" command.
+
Open console input and output streams as binary to allow Linux line ends on a Windows platform.
+
Change stream I/O procedure to allow for Mac OS 9 line endings.
+
Change output stream end of line from endl so output stream is not flushed with each write.
+
Change information messages from cerr to cout.
+
Removed messages when I/O is to cin and cout to accommodate TextWrangler.
+
+
+
+
+
Artistic Style 1.20 (January 2007)
+
+
+
Call importOptions() from function AStyleMain() to allow slop in options parameters.
+
New makefiles for GCC and Intel with new compile options.
+
New project file for Visual C with new compile options.
+
Change comments to reflect the GNU Lesser General Public License.
+
Indent message maps for MFC and event tables for wxWidgets.
+
Fix incorrect formatting for an empty comment.
+
Fix "Unknown option" in default options file when last line does not contain CR or LF.
+
Patch from Dieter Bayer to fix case indent when a scope resolution operator is used.
+
Change long option --brackets=break-closing-headers to --brackets=break-closing.
+
Add short option -y for --brackets=break-closing.
+
Add short option -e for --break-elseifs.
+
Add short option -w for --indent-preprocessor.
+
Add short option -f for --break-blocks.
+
Add short option -F for --break-blocks=all.
+
Remove the backup file after formatting when --suffix=none.
+
Show total time at end of job.
+
Improved error handling for invalid options with ASTYLE_LIB.
+
Add function AStyleGetVersion() to ASTYLE_LIB option.
+
Change preprocessor macro from ASTYLE_GUI to ASTYLE_LIB.
+
Add astyle namespace to ASEnhancer.
+
Add #include <ctype.h> for Red Hat distribution of GCC 3.2 (prior to Jan 2004).
+
Remove commented-out code.
+
+
+
Artistic Style 1.19 (July 2006)
+
+
+
Add unpad=paren option.
+
Always pad paren headers (e.g. 'if', 'for', 'while').
+
Fix problem of pad=oper working different if pad=paren is declared.
+
Add additional tests to distinguish the multiplication operator from pointers.
+
Fix padding parens before a member access pointer (->).
+
If space padding has changed, move end-of-line comments to the original column, if possible.
+
Move potential calculation decision to outside of operator padding function.
+
Fix duplication of last line of source if a final endline is not present.
+
Fix class initializer not indented on last line if bracket is attached.
+
Fix identification of templates contained in parens.
+
Fix one line block occurring before end of class.
+
Fix line added after one line block with bracketFormatMode = NONE_MODE.
+
Add needed variables to ASBeautifier copy constructor.
+
Trim end of line for multi-line comments.
+
Add a breakLine before paren checks (needed for unpad=paren option).
+
Add trace file to ASFormatter.
+
Move formatting message from end to beginning of formatting.
+
Move the building of vectors to ASResource. Vectors for classes ASBeautifier and ASFormatter should now have the
+ same values.
+
Move debugging variable inLineNumber from ASFormatter to ASBeautifier.
+
Bypass char processing for UTF8 characters in ASBeautifier.
+
Move switchVariables struct from ASEnhancer to the header file.
+
Remove preprocessorHeader vector (not used).
+
Remove variable isInConst (not used).
+
Remove commented-out code.
+
+
+
Artistic Style 1.18 (June 2006)
+
+
+
The following changes were made for the option pad=oper:
+
+
Does not remove extra spaces from formatted expressions.
+
Does not pad opening parens on the outside.
+
Does not remove leading spaces from multi-line comments.
+
Does not pad negative numbers.
+
Does not add a space to the end of preprocessor directives.
+
Will not pad operators inside block parens [].
+
+
+
The following changes were made for the option pad=paren:
+
+
Formats correctly with or without pad=oper.
+
Does not add a space for each additional run if pad=oper is not used.
+
Outside of opening paren is padded correctly.
+
Inside of closing paren is padded correctly.
+
Does not pad block parens [].
+
Added short option P, previously used for pad=all.
+
+
+
Added new options pad=paren-out (d) and pad=paren-in (D).
+
Removed option pad=all.
+
Add short option V for convert-tabs.
+
Added bounds checking to options containing parameters.
+
Display a message when a default options file is used.
+
Replaced IS_PARAM_OPTION(S) macros with overloaded isParamOption. Fixed compare problem with short param options.
+
+
Fix EOF problem with default options file.
+
+
+
Artistic Style 1.17 (May 2006)
+
+
+
The following changes were made for processing bracketFormatMode = NONE_MODE:
+
+
Removed the function isFormattingEnabled() and always performed the formatting.
+
Removed the formatting bypass for NONE_MODE.
+
Fix brackets always being broken in the 2 cases where NONE_MODE formatting was done.
+
Added new functions to support the processing of NONE_MODE brackets.
+
Made other minor changes necessary for correct NONE_MODE processing.
+
+
+
Changed indent cases option to indent the entire case block.
+
Changed to output Windows or Linux line endings.
+
Added ASEnhancer module for case statement indenting.
+
Corrected errors in identifying options indent=tab=, and force-indent=tab=.
+
Corrected errors in identifying options min-conditional-indent=, and max-instatement-indent=.
+
Improved error and information messages.
+
Added capability to compile as a console program, shared library, or static library.
+
Fixed problem with semicolons and parens being put on a line by themselves.
+
Fixed spaces being added before a line comment.
+
Fixed blank line added after some preprocessor statements.
+
Fixed preprocessor statements not being trimmed.
+
Do not indent line comments that begin in column 1 or 2.
+
Fixed indentation problem with ending }; of class statements.
+
Changed nextLine() function to eliminate char buffer limits.
+
Moved Windows default options file to %USERPROFILE%.
+
Removed NEW operators to prevent memory leaks.
+
Fixed space before the semicolon in return ; statement.
+
Fixed extra space that was sometimes added when pad operators was used.
+
Removed string parameter from IS_PARAM_OPTION.
+
Added forward declaration of parseOption() to eliminate compile error.
+
Added input line number counter for debugging.
+
Add statements to check for markers if break-blocks or break-blocks=all is used.
+
Remove warnings for signed/unsigned mismatch.
+
Removed COMPARE macro and used string compare.
+
Removed compiler_defines.h.
+
Removed USES_NAMESPACE declaration.
+
+
+
Artistic Style 1.16
+
+
+ There was no release 1.16.
+
+
+
Artistic Style 1.15.3 (7 March 2002)
+
+
+
Bug fix in handling of brackets after line-comments.
+
Bug fix: C# add/remove event property headers now properly formatted.
+
+
+
Artistic Style 1.15.2 (2 March 2002)
+
+
+
Bug fixes in exception handling phrases, e.g. multiple catches and try..finally.
+
+
+
Artistic Style 1.15.1 (2 March 2002)
+
+
+
Bug fix: C# properties are now formatted properly.
+
+
+
Artistic Style 1.15.0 (2 March 2002)
+
+
+
Added support for C#.
+
Artistic Style is now licensed only under the GNU Public License (GPL).
+
Compilation under G++ 3.0 now works properly.
+
Bug fix: Opening brackets that appear at the beginning of a line immediately after an empty line comment are now
+ handled properly, and not appended as part of the line comment.
+
Bug fix: Brackets inside comments are now not mis-indented within the comment.
+
+
+
Artistic Style 1.14.1 (2 June 2001)
+
+
+
Bug fix: : '<' and '>' symbols within template declarations (e.g. 'foo<bar*, xoo>') are now left unpadded
+ in the padding modes.
+
Bug fix: Fixed false recognizing of headers within larger words (e.g. 'catch' in 'gcatch').
+
+
+
Artistic Style 1.14.0 (1 June 2001)
+
+
+
Bug fix: Fixed indentation of statements within preprocessor '#if...' statements.
+
Bug fix: Templates are now not broken from their bodies.
+
Bug fix: '<' and '>' symbols within template definitions (e.g. 'template<class T>') are now left unpadded
+ in the padding modes.
+
+
+
Artistic Style 1.13.8 (13 April 2001)
+
+
+
Bug fix: Fixed indentation of multiple nested non-block brackets, such as in multi bracketed static array declarations.
+
+
+
+
Artistic Style 1.13.7 (6 April 2001)
+
+
+
New option:'--force-indent=tab=#' (or 'T#') instructs astyle to indent using tabs in all the pre-statement white
+ space, including areas astyle's '--indent=tab' prefers to indent using spaces, such as white space in multi-line
+ statements.
+
Bug fix: Fixed unwanted empty line insertions between empty blocks (e.g. '{}') and closing brackets that come
+ immediately after them.
+
Bug fix: Fixed unwanted empty line insertions immediately after colons (e.g. 'default:', 'label:', ...)
+
+
+
Artistic Style 1.13.6 (24 January 2001)
+
+
+
Bug fix: Preprocessor lines now remain unpadded in padding modes.
+
+
+
Artistic Style 1.13.5 (24 January 2001)
+
+
+
Bug fix: Fixed the insertion of phantom empty lines immediately after {} blocks.
+
Bug fix: Bare open brackets ('{') with no preceding headers are now broken appropriately from their preceding
+ code lines in the 'attach' and 'linux' bracketmodes.
+
Bug fix: Fixed operator recognition for long operators such as '>>=', '<<= '.
+
+
+
Artistic Style 1.13.4 (24 January 2001)
+
+
+
Bug fix: L" unicode strings are now handled properly in padding modes.
+
Bug fix: Fixed the padding around '-' operators (which went sour somewhere in the past).
+
Bug fix: Fixed the handling of exponent numbers (e.g. 12.2e+2) in padding modes. The fix enables 'e+' to be regarded
+ as part of the exponent.
+
+
+
Artistic Style 1.13.3 (23 January 2001)
+
+
+
Line that contain both headers and their following non-header code (e.g. 'if (isFoo) doBar();') are now broken
+ by default into multiple lines. To keep these lines as single lines, use '--one-line= keep-statements'.
+
Added the new option '--break-elseifs' which breaks 'else if()' statements into multiple lines.
+
The option block breaking options now works properly with the padding options.
+
Various minor bug fixes.
+
+
+
Artistic Style 1.13.2 (21 January 2001)
+
+
+
Added the new option '--brackets=break-closing-headers'. When this option is added to either '--brackets=attach'
+ or '--brackets= linux', astyle breaks closing headers (e.g. 'else', 'catch') from their preceding closing brackets.
+
+
'--break-blocks' and '--break-blocks= all' now correctly handle blocks that appear immediately before closing
+ brackets, and do not append empty lines between them and the closing brackets.
+
+
+
Artistic Style 1.13.0 (27 September 1999)
+
+
+
Moved back to odd-minor-numbered development versions, and even-minor-numbered stable versions.
+
Added the new option '--break-blocks' which breaks apart unrelated blocks, labels, classes, etc.
+
Added the new option '--break-blocks=all' which also breaks apart blocks of closing headers, such as 'else', 'catch',
+ etc.
+
Fixed indentation handling of labels and class-definition identifiers such as 'public:', 'protected:', ... (thanks
+ to Daryn Adler for his patch)
+
Fixed indentation of nested class definitions. (thanks to Daryn Adler for his patch)
+
Added the new option '--indent-preprocessor' which (surprisingly) tries to reindent C/C++ preprocessor macro lines.
+ Astyle should do an pretty nice indentation job if the macro code is sane, but don't expect miracles for horrid
+ macro definitions...
+
+
+
Artistic Style 1.11.6 (27 September 1999)
+
+
+
Improved indentation of lines containing single-line blocks.
+
+
+
Artistic Style 1.11.5 (25 September 1999)
+
+
+
Improved the bug fix for a 'const' keyword bug which resulted in wrong indentation of methods that are declared
+ const.
+
+
+
Artistic Style 1.11.4 (18 September 1999)
+
+
+
Improved handling of single colons (':') in class headers, e.g. class Foo : public Bar { ... }
+
Improved handling of single colons (':') in method (constructor) headers, e.g. Foo::Foo(int a) : Bar(a)
+
+
+
Artistic Style 1.11.3 (16 September 1999)
+
+
+
Fixed a serious bug in the formatting of brackets, introduced in 1.11.2.
+
+
+
Artistic Style 1.11.2 (10 September 1999)
+
+
+
Fixed an indentation bug in statements that contain the 'const', that resulted in wrong indentation of array blocks
+ that where declared const. (Thanks Daniel!)
+
Fixed an indentation bug that could arise in lines that appear immediately after several preprocessor commands.
+ (Thanks Daniel!).
+
Fixed a bug that inserted an empty line after closing brackets if a comment appeared immediately prior to the
+ closing bracket. (Thanks Ed!)
+
Fixed a bug that eliminated empty lines between closing brackets and immediately following opening brackets. (Thanks
+ Ed!)
+
+
+
Artistic Style 1.11.1 (3 September 1999)
+
+
+
Fixed a bug that inserted an empty line at the begining of source files.
+
+
+
Artistic Style 1.11.0 (3 September 1999)
+
+
+
Astyle now filters out line-feeds ('\r') before begining to parse lines. This should take care of bizarre formatting
+ that existed when moving source files from Windows (which breaks lines with a linefeed AND newline ("\r\n") to
+ unix (which breaks lines only with newlines).
+
The "struct", "static" and "synchronized" keywords are now finally handled correctly in both the contexts of block
+ headers AND simple keywords.
+
Better treatment of precompiler lines that end with backslashes, and the lines that immediately follow them.
+
+
The '--indent-classes' (or '-C') option now works correctly (again...).
+
Series of short command-line options (e.g. "-b -s4 -C") are now parsed correctly.
+
+
+
Artistic Style 1.10.4 (27 July 1999)
+
+
+
Fixed a MAJOR bug (inserted in 1.10.3) that resulted wrong handling of double-colons ('::') in C++.
+
+
+
Artistic Style 1.10.3 (24 July 1999)
+
+
+
Fixed a bug (inserted yesterday) that resulted in unwanted line breaks before closing-brackets.
+
Fixed a bug in the handling of 'static' blocks in java.
+
Added the new option '--indent-cases' (or '-K') for indenting 'case XXX:' lines so they are flush with their following
+ code lines.
+
Added the new option '--fill-empty-lines' (or '-E') which fills empty lines with the white-space of their previous
+ line.
+
+
+
Artistic Style 1.10.2 (23 July 1999)
+
+
+
Fixed a series of related bugs that resulted in certain cases of lacking line breaks after close-brackets, and
+ colons. Thanks Jeroen!
+
+
+
Artistic Style 1.10.1 (18 July 1999)
+
+
+
Fixed a bug (introduced in astyle 1.10.0) that can result in missing line breaks before closing brackets if they
+ appear immediately after comments. Thanks Larry!
Fixed a bug in the in-statement indentation algorithm which resulted in sub-optimal indentation of multiple-line
+ conditional statements that immediately follow headers such as 'if', 'else if', 'while', etc... As a result, the
+ current in-statement indentation is finally what it should have been long ago - MUCH better then in the last stable
+ versions.
+
The "linux" bracket style (in which definition brackets are broken while code brackets are attached) has been
+ fixed, and should finally work correctly.
+
Artistic Style can now parse both C/C++ and Java files in the same command. Unless a specific language mode is
+ specified (e.g. --style=java or --style=c), astyle will now automatically set the language mode according to each
+ file's suffix (java mode for the '.java' suffix , c mode otherwise).
+
Multiple statements in a single line (e.g. aaa; bbb; fff;) are now broken up by default.
+
Added the option '--one-line=keep-statements' (or '-o') that keeps multiple
+ statements in a single line attached, thus countering the default break detailed above.
+
Changed the option previously called '--keep-one-line-blocks' to '--one-line=keep-blocks',
+ for similarity with the new option above.
+
Changed the short option name of the option '--errors-to-standard-output' from '-o'
+ to '-X'.
+
Up to now, Artistic Style always inserted a minimal indent of twice the current selected indent
+ size inside multi-line conditional headers ('if', 'while' ...), so that it would be clear where the headers end
+ and the code after them begins. The current version adds the option '--min-conditional-indent=#'
+ (or '-m#') that sets the absolute minimal indent between conditional headers and their multiple-line
+ conditional statements. If this option is not specified, the default indent remains twice the current selected
+ indent size.
+ For example, This option should come very handy in code that already has brackets after EVERY conditional statement
+ (even if just one line is in that bracket...) - in such a case, it would be wise to set --min-conditional-indent=0
+ since the brackets already make it clear where the header ends and the code begins...
+
Added the ability to set the assumed tab size when in '--indent-tab' mode by using '--indent-tab=#'
+ or '-t#' and replacing the # with the wanted size. If the size is not specified,
+ the size of each tab is assumed to be 4 spaces long.
+
+
+
Artistic Style 1.8.2 (18 March 1999)
+
+
+
Fixed pointer handling problems in ASBeautifier that led to crashes when parsing preprocessor commands.
+
Fixed the problem in locating the default options file in the directory pointed to by $HOME or %HOMEPATH% when
+ these system variables do not contain an '/' (or '\' ...) at their end.
+
Fixed inverse insertion of spaces vs. tabs when in -t mode. (Thanks Brian!)
+
Got rid of those pesky C4786 warnings when compiling under Visual C++ (Thanks John!)
+
+
+
Artistic Style 1.8.1 (9 March 1999)
+
+
+
Changed the '--style=k&r' option to '--style= kr' , so that linux/unix machines don't misinterpret the '&'
+ as a background processing command.
+
+
+
Artistic Style 1.8.0 (3 March 1999)
+
+
+
Added support for predefined styles. Current supported styles are: ansi, k&r, linux, gnu, java.
+ these can be set by using '--style=THESTYLE' (e.g. '--style=linux').
+
Added '--indent-blocks' (or -G) option, which adds indentation to entire blocks, including their
+ brackets, in similar fashion to the standard gnu style.
+
Added option '--brackets=linux' (or '-l') which breaks definition-block brackets, but attaches command-block
+ brackets.
+
Padding can now be set separately for operators alone('-p' or '--pad=oper'), parentheses alone ('--pad=paren)
+ or both ('-P' or '--pad=all').
+
Artistic Style looks for a default options file in the following order:
+ 1. The contents of the ARTISTIC_STYLE_OPTIONS environment variable if it exists.
+ 2. The file called .astylerc in the directory pointed to by the HOME environment variable ( i.e.
+ $HOME/.astylerc ).
+ 3. The file called .astylerc in the directory pointed to by the HOMEPATH environment variable
+ ( i.e. %HOMEPATH%\.astylerc ).
+ If a default options file is found, the options in this file will be parsed BEFORE the command-line options. Options
+ within the default option file may be written without the preliminary '-' or '--'. Indentation within #if , #else
+ and #endif precompiler commands now works correctly even if the program lines between these precompiler commands
+ contain non-pared brackets.
+
Improved handling of labels (e.g. 'exit:'). By default, labels are now flushed completely to the left. Labels
+ can also be indented to one indent LESS than current standard indentation by using the new option '--indent-labels'
+ (or '-L') .
+
Fixed handling of the 'operator' keyword when it is preceded by a non space character (such as '&' or '*').
+
+
Fixed wrong bracket handling after 'throws' statements.
+
Fixed wrong indentation of single-line blocks. These where indented 1 indent to much.
+
Fixed wrong indentation of headers in internal classes (java mode). These where indented 1 indent to little.
+
+
The option ' --errors-to-standard-output' now has the one-letter option '-o'.
+
Fixed bug which resulted in an unneeded indent in function-declarations in which function-variables are declared
+ before the function declaration and are preceded by the 'static' keyword. Thanks Scott.
+
+
+
Artistic Style 1.6.0 (5 January 1999)
+
+
+
Fixed zero indentation that resulted when a '-suffix' option was set after a '--indent=spaces' (or '-s') option.
+
+
Wrong options are now announced.
+
Changed default indentation to NOT automatically indent class blocks and switch blocks. Instead, the new options
+ '--indent-classes' (or '-C') and '--indent-switches' (or '-S') should be used. The option '--indent-switches'
+ replaces the old option '--flush-switches'.
+
+
+
Artistic Style 1.4.1 (4 January 1999)
+
+
+
Fixed ability to write options without the preceding '--' in the default options file.
+
Added one-letter options to most options that had only long-options in version 1.4.0.
+
Added a '-v' or '--version' option that writes the current Artistic Style version.
+
+
+
Artistic Style 1.4.0 (3 January 1999)
+
+
+
MAJOR NEW CHANGE IN THE FORMAT OF OPTIONS:
+ Options are now either short one-letter options starting with '-', or long multi-letter options
+ starting with '--'. The Short one-letter options MAY BE ATTACHED TOGETHER. Thus, writing '-bps4' is the same as
+ writing '-b -p -s4'.
+ Many options that have up to now had a 2 letter format now retain only their long format. I truly believe that
+ the combination of attached-one-letter options PLUS a default option's file containing long-letter-options related
+ to style will be much easier to work with than the previous setup.
+
Added support for a default options file (pointed to by the ARTISTIC_STYLE_OPTIONS environment
+ variable).
+
Changed downloading method from the server. From now, there will be specific directories containing the latest
+ stable sources, stable binaries, and development sources.
+
Space padding ('-p' or '--pad') now works correctly (1) around semicolons and commas, (2) between headers that
+ require parentheses after them (such as 'if', 'while'...)and those parentheses, and (3) after parentheses (unless
+ immediately followed by a ';' or ',' or '.').
+
From now on, namespace blocks are NOT indented by default. To indent namespace blocks use the new '--indent-namespaces'
+ option.
+
Added options '--errors-to-standard-output' for redirection of standard-error to standard-output from within Artistic
+ Style, and '--suffix=' for specifying a suffix other than '.orig' to append to original filenames.
+
Corrected indentation of 'default' in switch statements. (Up to now, this only worked correctly in java mode...).
+
+
+
+
Artistic Style 1.2.0 (19 December 1998)
+
+
+
Artistic Style 1.2.0 is the first stable result of a new version numbering, in which development versions are
+ numbered with an odd minor number (such as 1.1.x), and stable versions are numbered with an even number (1.2.x).
+ Thus, version 1.2.0 accumulates all the additions/changes of the 1.1.x development versions of Artistic Style.
+
+
A new '-ol' formatting mode that eliminates breaking of one-line blocks.
+
Fixed a SERIOUS bug, which resulted in wrong formatting of brackets ('{', '}') that came IMMEDIATELY AFTER definition
+ type brackets, (e.g. brackets that come right after 'class', 'interface', 'name-space', etc ...). This bug was
+ mistakenly introduced when I set out to correctly space-pad pointer and reference signs, somewhere in version
+ 0.9.x.
+
Fixed unwanted elimination of final empty lines.
+
Fixed broken indentation of virgin opening-brackets that occur immediately after a previous closing-bracket.
+
+
Fixed space-padding to not insert a space in front of ':' characters unless they are a part of a '? ... : ' statement.
+
+
+
+
Artistic Style 1.0.5 (11 December 1998)
+
+
+
'extern' blocks now handled correctly.
+
Fixed handling of ^= in '-p' mode.
+
Win32 executables now contain wildcard expansion. *** Look at the README.TXT for info
+ on how to include wildcard expansion abilities when compiling Artistic Style under Win32. (Thanks for the info
+ on wildcard-expansion enabling, Nat!!!)
+
+
+
Artistic Style 1.0.4 (2 December 1998)
+
+
+
Fixed unwanted space-padding around urinary minuses and '-' symbols within exponents
+ (e.g. 2.5E-5) when using the '-p' option.
+
+
+
Artistic Style 1.0.3 (1 December 1998)
+
+
+
Control characters now remain in the indented file.
+
Fixed a bug in which long quoted white-space sequences where mistakenly eliminated
+ in the '-p' mode.
+
Fixed unwanted line-breaks in '-ab -p' mode, that in some cases occurred between '//'
+ and the rest of a line comment.
+
Fixed handling of '>>=', '<<= ' in '-p' mode.
+
+
+
Artistic Style 1.0.2 (27 November 1998)
+
+
+
Fixed a SERIOUS bug of missing needed line-breaks in lines immediately after line-comments
+ when in '-ab' mode.
+
Support for the 'finally' header.
+
lines that contain only white-space now become empty lines.
+
+
+
Artistic Style 1.0.1 (26 November 1998)
+
+
+
Fixed a SERIOUS bug, which lacked a needed line-break between closing brackets and
+ the headers that follow them (e.g. '} else') when in '-bb' mode. In fixing the bug, I used a variation on a patch
+ sent by Richard Bullington - THANKS!
+
Fixed a set of SERIOUS bugs which inserted an empty line into both the start and end
+ of the reindented file.
+
Improved documentation of formatting options in the file astyle.html .
+
+
+
Artistic Style 1.0.0 (24 November 1998)
+
+
+
Indented files now retain the original file name, while the original
+ pre-indented file is saved with a ".orig"at its end. Thus, after the call "astyle -bb foo.cpp",
+ the newly indented file will be called "foo.cpp", while a file called "foo.cpp.orig"
+ will contain the original pre-indented file.
+
Artistic Style may now be used and /or modified and/or distributed under EITHER
+ the "Artistic License", or the GNU General Public License (GPL).
+
Methods with headers that end with 'const' are now properly indented.
+
Cleaner, more robust, and better documented source code.
+
+
+
Artistic Style 0.9.2
+
+
+
Fixed a serious bug which led to a maximal supported source code line size of 128
+ characters!!!
+
Maximal supported line size is now 1024 characters.
+
Fixed a serious bug in the handling of brackets inside '#define' statements.
+
Fixed a serious bug in which '#include' files containing slashes (i.e. #include <foo_dir/foo> ) where space-padded
+ when using option '-p' on C, C++ files.
+
+
+
Artistic Style 0.9.1
+
+
+
Much improved space-padding around pointers ('*') and references ('&') and the
+ 'operator' key-word in C and C++ source files when using the '-p' space padding option.
+
Fixed several pointer handling bugs which led to potential core dumps.
+
Version 0.9.1 now includes all the abilities I am planning for the final 1.0 version, and should be looked
+ at as the first pre-release version of Artistic Style.
+
+
+
Artistic Style 0.9.0
+
+
+
Added a formatting layer (ASFormatter.cpp) around the indentation
+ layer (ASBeautifier.cpp).
+
+
As a result, the following formatting capabilities have been added:
+
+
Bracket ('{' and '}') placement in either ANSI C style or Java style.
+
Space padding around operators, i.e. (1+2)*3-4 becomes ( 1 + 2 ) * 3 - 4.
+
+
+
Fixed the 'tab' elimination bug introduced in ASBeautifier 0.8.2.
+
Fixed a bug which under-indented class headers containing inheritance info.
+
+
+
ASBeautifier 0.8.2
+
+
+
Fixed indentation problem in brackets around 'struct', and 'union' blocks.
+
Added recognition for '\' characters in the end of lines.
+
Improved indentation of post-method-declaration variable initializations.
+
Several minor bug fixes.
+
+
+
ASBeautifier 0.8.1
+
+
+
Fixed an important bug in pointer arithmetic which resulted both in phantom indentation errors, and in core-dumps
+ when trying to indent java files.
+
+
+
ASBeautifier 0.8.0
+
+
+
This is the first public release of ASBeautifier. It is a direct port to C++ of JSBeautifier
+ 1.1.1, PLUS extensions to for C++ indentation.
+
So far, very little beta-testing has been done for the C++ extensions. This should
+ change extremely with the open-source release (this was the case with JSBeautifier...), so expect ASBeautifier
+ to become bug-free fast!!!
+
The C++ source code is not yet written in optimal quality. I rushed a little so that I could release this initial
+ release as soon as possible. This will soon change.
+ The following are scripts to support the Artistic Style program. They are in various computer languages for multiple
+ platforms.
+
+
+
Scripts
+
+
+
+ astyle-clean.py is a Python script to clean a directory tree by
+ moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup files
+ without cluttering your source directories. There are four variables at the start of the script that need to be
+ set for each application. The script will move or copy backup files to a backup directory maintaining the original
+ directory structure. New backup files will be copied over the old so you will always have the most current backup.
+
+
+
+ astyle-clean.sh is a Linux shell script to clean a directory tree
+ by moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup files
+ without cluttering your source directories. There are four variables at the start of the script that need to be
+ set for each application. The script will move or copy backup files to a backup directory maintaining the original
+ directory structure. New backup files will be copied over the old so you will always have the most current backup.
+
+
+
+ astyle-clean.bat is a Windows batch file to clean a directory
+ tree by moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup
+ files without cluttering your source directories. There are four variables at the start of the script that need
+ to be set for each application. The script will move or copy backup files to a backup directory maintaining the
+ original directory structure. New backup files will be copied over the old so you will always have the most current
+ backup.
+
+
+
+ astyle.pl is a Mac Perl script to indent source files in TextWrangler
+ and BBEdit using Artistic Style. Selected text from the editor can be passed to Artistic Style and replaced with
+ the reformatted text. Save the script in the "Unix Filters" directory (you need to restart TextWrangler to see
+ new scripts). Then simply highlight the text you would like to indent, choose the script from the Shebang (#!)
+ menu, and the text will be immaculately formatted. You can add Artistic Style options to the "my $astyle" line
+ in the script.
+
+
+
+ indent-commit.pl is a Perl script to integrate Artistic Style
+ with a CVS repository check-in. Before code is checked in, Artistic Style is automatically called so that the
+ repository files have a consistent style. This script was posted on the web site several years ago and probably
+ needs to be updated.
+
+
+
+ astyle-hooks.el is an Emacs Lisp script containing hooks to convert
+ Emacs default styles to Artistic Style default styles. There are hooks for C++, Java, and C# files. The C# hook
+ requires the csharp-mode.el file from
+ csharpmode on Google Project Hosting. For best results Artistic Style should use the options ‑‑min‑conditional‑indent=0
+ (‑m0) and ‑‑max‑instatement‑indent=50 (‑M50). Emacs does not seem to have
+ an option equivalent to these. The formatting for Emacs and Artistic Style will not be identical but should be
+ reasonably close.
+
+
+
+
+
+
diff --git a/External/Tools/AStyle/doc/styles.css b/External/Tools/AStyle/doc/styles.css
new file mode 100644
index 0000000000..892ca1c93a
--- /dev/null
+++ b/External/Tools/AStyle/doc/styles.css
@@ -0,0 +1,35 @@
+
+/* h1 is a title
+ * h2 is a subtitle
+ * h3 is a hanging text title
+ * h4 is a non-hanging text title
+ * p.noindent is non-hanging text (text without a title)
+ * p.contents entries are for the table of contents
+ * a.contents are table of contents links (not underlined)
+ * a.links are links (underlined)
+ * img does not have a border
+ * pre is a predefined format for formatting code
+ */
+
+
+body { background-color: white; margin-top: 0.5in; margin-right: 0.8in; margin-bottom: 0.5in; margin-left: 1.3in; }
+
+h1 { color: #0000A0; text-align: center; font-style: italic; margin-top: 18pt; margin-left: -0.5in; }
+h2.large { color: #0000A0; text-align: center; font-size: x-large; margin-top: 0.4in; margin-left: -0.5in; }
+h2 { color: #0000A0; text-align: center; font-size: larger; margin-top: 0.4in; margin-left: -0.5in; }
+h3 { color: #0000A0; margin-top: 0.4in; margin-left: -0.4in; }
+h4 { color: #0000A0; margin-top: 0.3in; }
+
+p.noindent { margin-left: -0.4in; }
+p.contents1 { font-size: 105%; margin-top: 0in; margin-left: 0in; margin-bottom: 0in; margin-right: 0in; }
+p.contents2 { margin-top: 0in; margin-left: .4in; margin-bottom: 0in; margin-right: .4in; }
+/* p.contents3 { margin-top:0in; margin-left:.8in; margin-bottom:0in; margin-right:.8in; } */
+a.contents:link, a.contents:visited { color: #0000A0; text-decoration: none; }
+a.contents:hover { color: #F00000; text-decoration: none; }
+
+a:link, a:visited { color: #0000A0; text-decoration: underline; }
+a:hover { color: #F00000; text-decoration: underline; }
+
+img { border: none; }
+
+pre { margin-left: 0.3in; color: navy; font-weight: bold; }
diff --git a/External/Tools/AStyle/doc/subversion.html b/External/Tools/AStyle/doc/subversion.html
new file mode 100644
index 0000000000..6b09ce1a6b
--- /dev/null
+++ b/External/Tools/AStyle/doc/subversion.html
@@ -0,0 +1,99 @@
+
+
+
+
+
+ Artistic Style - Subversion
+
+
+
+
+
+
+
+
+
Artistic Style Subversion Repository
+
+
+
+
+
+
Artistic Style
+
+
+ The latest development source is in the Artistic Style repository at SourceForge. It can be checked out using
+ Subversion. The source code is under development and some changes take several weeks to complete. The intermediate
+ source files have not been through the extensive system tests that are done before each release. Use reasonable
+ precautions when using source code from the repository.
+
+
+ The current version is in the "trunk/AStyle" branch of the repository. The file and directory names are case sensitive.
+
+
+ A sample checkout is:
+ svn checkout "https://svn.code.sf.net/p/astyle/code/trunk/AStyle" "$HOME/astyle"
+
+
+ You can also browse the subversion repository.
+ The current development release is in the "trunk" directory. This gives you a view into the current status of
+ the project's code without actually checking-out the files.
+
+
+
+
+
+
Other Projects
+
+
+ Two additional Artistic Style projects are available in the repository. They are not maintained for the general
+ public but are available if you want them. You may have to create your own project files and scripts to use them.
+ These projects require the Artistic Style project above. They are an extension that requires the Artistic Style
+ source. All projects, and any additional source required, should be installed in the same top level folder.
+
+
+
AStyleDev
+
+
+ AStyleDev contains the development files that are made available in the "Developer Information" section. Refer
+ to that section for more information.
+
+
+ A sample checkout is:
+ svn checkout "https://svn.code.sf.net/p/astyle/code/trunk/AStyleDev" "$HOME/astyledev"
+
+
+
AStyleTest
+
+
+ AStyleTest contains the unit test programs and test scripts for Artistic Style. There are over 2000 tests in the
+ main test program.
+
+
+ A sample checkout is:
+ svn checkout "https://svn.code.sf.net/p/astyle/code/trunk/AStyleTest" "$HOME/astyletest"
+
+
+ In addition to the Artistic Style source the test program requires
+ Google Mock. This is the Google multi-platform framework for writing
+ C++ unit tests. The main Artistic Style test project, AStyleTest, actually uses "integration" tests
+ instead of "unit" tests. This type of testing can be effective for programs that were written without
+ unit tests to begin with.
+
+ Following are instructions for installing the .NET Framework SDK in Visual Studio 2010 Express and adding x64
+ platforms to an existing project in a manner similar to the more expensive Visual Studio editions.
+
+
+
Installing .NET Framework SDK
+
+
+ 64-bit tools are not available on the Visual Studio 2010 C++ Express Edition by default. To enable 64-bit targets,
+ install the .NET Framework SDK in addition to the Visual Studio 2010 Express Edition. Otherwise, the x64 solution
+ platform is not available and a warning will occur if you open a project containing a 64-bit target.
+
+
+ Install the
+ Windows SDK appropriate for your operating system. Use the "Install Now" link to get the SDK. You can
+ optionally install the Windows Performance Toolkit, Debugging Tools, and Application Verifier. The Help is also
+ optional.
+
+
+ After installing this package the x64 configurations can be created.
+
+
+ IMPORTANT: If Visual Studio 2010 Service Pack 1 is applied after the .NET Framework SDK install, an additional
+ update is required to restore the Visual C++ compilers and libraries that may have been removed. Information is
+ available here.
+
+
+
+
Adding x64 to Project Files
+
+
+ Open a Win32 project. Open the Configuration Manager from the Build menu. In the Active Solution Platform select
+ New. For the New Platform select x64. You will need to “Copy settings from Win32” and check
+ “Create new project platforms”.
+
+
+ Open the Properties from the Project menu. There is a new configuration property that needs to be set for the
+ linker to find the system libraries. Be sure the x64 platform is selected and change "Configuration Properties
+ > General
+ > Platform Toolset", to Windows7.1SDK. Otherwise you will get linker errors
+ such as "LINK : fatal error LNK1104: cannot open file 'kernel32.lib'". This setting can also optionally be used
+ for the Win32 platform.
+
+
+ The x64 configuration can now be compiled, but the compiles will place the files in the same directories as the
+ Win32 compiles. To correct this the x64 compiles should be placed in an x64 directory using the $(Platform)
+ macro.
+
+
+ Add the $(Platform) macro to “Configuration Properties > General > Output directory” so the
+ entry becomes $(SolutionDir)$(Platform)\$(Configuration)\.
+
+
+ Leave “Configuration Properties > General> Intermediate Directory” at the default which
+ should be $(Platform)\$(Configuration)\.
+
+
+ Check the x64 Debug configuration “Configuration Properties > Linker > Debugging > Generate Program
+ Database File” for $(TargetDir)$(TargetName).pdb.
+
+
+ Compile the project. If there are compile errors you may need to add the $(Platform) macro
+ to other settings as well. For example, if there are user library files the macro may need to be added to
+ “Configuration Properties > Linker > General > Additional Library Directories”.
+
+
+ You should now be able to compile both Win32 and x64 platforms in a manner similar to the more expensive Visual
+ Studio editions.
+