diff options
Diffstat (limited to 'include/clang/Format/Format.h')
-rw-r--r-- | include/clang/Format/Format.h | 340 |
1 files changed, 170 insertions, 170 deletions
diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h index 0a8b6cfefb..144ee2f9e2 100644 --- a/include/clang/Format/Format.h +++ b/include/clang/Format/Format.h @@ -41,27 +41,27 @@ public: const std::error_category &getParseCategory(); std::error_code make_error_code(ParseError e); -/// \brief The ``FormatStyle`` is used to configure the formatting to follow +/// The ``FormatStyle`` is used to configure the formatting to follow /// specific guidelines. struct FormatStyle { - /// \brief The extra indent or outdent of access modifiers, e.g. ``public:``. + /// The extra indent or outdent of access modifiers, e.g. ``public:``. int AccessModifierOffset; - /// \brief Different styles for aligning after open brackets. + /// Different styles for aligning after open brackets. enum BracketAlignmentStyle { - /// \brief Align parameters on the open bracket, e.g.: + /// Align parameters on the open bracket, e.g.: /// \code /// someLongFunction(argument1, /// argument2); /// \endcode BAS_Align, - /// \brief Don't align, instead use ``ContinuationIndentWidth``, e.g.: + /// Don't align, instead use ``ContinuationIndentWidth``, e.g.: /// \code /// someLongFunction(argument1, /// argument2); /// \endcode BAS_DontAlign, - /// \brief Always break after an open bracket, if the parameters don't fit + /// Always break after an open bracket, if the parameters don't fit /// on a single line, e.g.: /// \code /// someLongFunction( @@ -70,13 +70,13 @@ struct FormatStyle { BAS_AlwaysBreak, }; - /// \brief If ``true``, horizontally aligns arguments after an open bracket. + /// If ``true``, horizontally aligns arguments after an open bracket. /// /// This applies to round brackets (parentheses), angle brackets and square /// brackets. BracketAlignmentStyle AlignAfterOpenBracket; - /// \brief If ``true``, aligns consecutive assignments. + /// If ``true``, aligns consecutive assignments. /// /// This will align the assignment operators of consecutive lines. This /// will result in formattings like @@ -87,7 +87,7 @@ struct FormatStyle { /// \endcode bool AlignConsecutiveAssignments; - /// \brief If ``true``, aligns consecutive declarations. + /// If ``true``, aligns consecutive declarations. /// /// This will align the declaration names of consecutive lines. This /// will result in formattings like @@ -98,9 +98,9 @@ struct FormatStyle { /// \endcode bool AlignConsecutiveDeclarations; - /// \brief Different styles for aligning escaped newlines. + /// Different styles for aligning escaped newlines. enum EscapedNewlineAlignmentStyle { - /// \brief Don't align escaped newlines. + /// Don't align escaped newlines. /// \code /// #define A \ /// int aaaa; \ @@ -108,7 +108,7 @@ struct FormatStyle { /// int dddddddddd; /// \endcode ENAS_DontAlign, - /// \brief Align escaped newlines as far left as possible. + /// Align escaped newlines as far left as possible. /// \code /// true: /// #define A \ @@ -119,7 +119,7 @@ struct FormatStyle { /// false: /// \endcode ENAS_Left, - /// \brief Align escaped newlines in the right-most column. + /// Align escaped newlines in the right-most column. /// \code /// #define A \ /// int aaaa; \ @@ -129,10 +129,10 @@ struct FormatStyle { ENAS_Right, }; - /// \brief Options for aligning backslashes in escaped newlines. + /// Options for aligning backslashes in escaped newlines. EscapedNewlineAlignmentStyle AlignEscapedNewlines; - /// \brief If ``true``, horizontally align operands of binary and ternary + /// If ``true``, horizontally align operands of binary and ternary /// expressions. /// /// Specifically, this aligns operands of a single expression that needs to be @@ -143,7 +143,7 @@ struct FormatStyle { /// \endcode bool AlignOperands; - /// \brief If ``true``, aligns trailing comments. + /// If ``true``, aligns trailing comments. /// \code /// true: false: /// int a; // My comment a vs. int a; // My comment a @@ -151,7 +151,7 @@ struct FormatStyle { /// \endcode bool AlignTrailingComments; - /// \brief If the function declaration doesn't fit on a line, + /// If the function declaration doesn't fit on a line, /// allow putting all parameters of a function declaration onto /// the next line even if ``BinPackParameters`` is ``false``. /// \code @@ -168,12 +168,12 @@ struct FormatStyle { /// \endcode bool AllowAllParametersOfDeclarationOnNextLine; - /// \brief Allows contracting simple braced statements to a single line. + /// Allows contracting simple braced statements to a single line. /// /// E.g., this allows ``if (a) { return; }`` to be put on a single line. bool AllowShortBlocksOnASingleLine; - /// \brief If ``true``, short case labels will be contracted to a single line. + /// If ``true``, short case labels will be contracted to a single line. /// \code /// true: false: /// switch (a) { vs. switch (a) { @@ -186,12 +186,12 @@ struct FormatStyle { /// \endcode bool AllowShortCaseLabelsOnASingleLine; - /// \brief Different styles for merging short functions containing at most one + /// Different styles for merging short functions containing at most one /// statement. enum ShortFunctionStyle { - /// \brief Never merge functions into a single line. + /// Never merge functions into a single line. SFS_None, - /// \brief Only merge functions defined inside a class. Same as "inline", + /// Only merge functions defined inside a class. Same as "inline", /// except it does not implies "empty": i.e. top level empty functions /// are not merged either. /// \code @@ -205,7 +205,7 @@ struct FormatStyle { /// } /// \endcode SFS_InlineOnly, - /// \brief Only merge empty functions. + /// Only merge empty functions. /// \code /// void f() {} /// void f2() { @@ -213,7 +213,7 @@ struct FormatStyle { /// } /// \endcode SFS_Empty, - /// \brief Only merge functions defined inside a class. Implies "empty". + /// Only merge functions defined inside a class. Implies "empty". /// \code /// class Foo { /// void f() { foo(); } @@ -224,7 +224,7 @@ struct FormatStyle { /// void f() {} /// \endcode SFS_Inline, - /// \brief Merge all functions fitting on a single line. + /// Merge all functions fitting on a single line. /// \code /// class Foo { /// void f() { foo(); } @@ -234,18 +234,18 @@ struct FormatStyle { SFS_All, }; - /// \brief Dependent on the value, ``int f() { return 0; }`` can be put on a + /// Dependent on the value, ``int f() { return 0; }`` can be put on a /// single line. ShortFunctionStyle AllowShortFunctionsOnASingleLine; - /// \brief If ``true``, ``if (a) return;`` can be put on a single line. + /// If ``true``, ``if (a) return;`` can be put on a single line. bool AllowShortIfStatementsOnASingleLine; - /// \brief If ``true``, ``while (true) continue;`` can be put on a single + /// If ``true``, ``while (true) continue;`` can be put on a single /// line. bool AllowShortLoopsOnASingleLine; - /// \brief Different ways to break after the function definition return type. + /// Different ways to break after the function definition return type. /// This option is **deprecated** and is retained for backwards compatibility. enum DefinitionReturnTypeBreakingStyle { /// Break after return type automatically. @@ -257,7 +257,7 @@ struct FormatStyle { DRTBS_TopLevel, }; - /// \brief Different ways to break after the function definition or + /// Different ways to break after the function definition or /// declaration return type. enum ReturnTypeBreakingStyle { /// Break after return type automatically. @@ -328,14 +328,14 @@ struct FormatStyle { RTBS_TopLevelDefinitions, }; - /// \brief The function definition return type breaking style to use. This + /// The function definition return type breaking style to use. This /// option is **deprecated** and is retained for backwards compatibility. DefinitionReturnTypeBreakingStyle AlwaysBreakAfterDefinitionReturnType; - /// \brief The function declaration return type breaking style to use. + /// The function declaration return type breaking style to use. ReturnTypeBreakingStyle AlwaysBreakAfterReturnType; - /// \brief If ``true``, always break before multiline string literals. + /// If ``true``, always break before multiline string literals. /// /// This flag is mean to make cases where there are multiple multiline strings /// in a file look more consistent. Thus, it will only take effect if wrapping @@ -349,7 +349,7 @@ struct FormatStyle { /// \endcode bool AlwaysBreakBeforeMultilineStrings; - /// \brief If ``true``, always break after the ``template<...>`` of a template + /// If ``true``, always break after the ``template<...>`` of a template /// declaration. /// \code /// true: false: @@ -358,7 +358,7 @@ struct FormatStyle { /// \endcode bool AlwaysBreakTemplateDeclarations; - /// \brief If ``false``, a function call's arguments will either be all on the + /// If ``false``, a function call's arguments will either be all on the /// same line or will have one line each. /// \code /// true: @@ -376,7 +376,7 @@ struct FormatStyle { /// \endcode bool BinPackArguments; - /// \brief If ``false``, a function declaration's or function definition's + /// If ``false``, a function declaration's or function definition's /// parameters will either all be on the same line or will have one line each. /// \code /// true: @@ -390,7 +390,7 @@ struct FormatStyle { /// \endcode bool BinPackParameters; - /// \brief The style of wrapping parameters on the same line (bin-packed) or + /// The style of wrapping parameters on the same line (bin-packed) or /// on one line each. enum BinPackStyle { /// Automatically determine parameter bin-packing behavior. @@ -401,7 +401,7 @@ struct FormatStyle { BPS_Never, }; - /// \brief The style of breaking before or after binary operators. + /// The style of breaking before or after binary operators. enum BinaryOperatorStyle { /// Break after operators. /// \code @@ -441,10 +441,10 @@ struct FormatStyle { BOS_All, }; - /// \brief The way to wrap binary operators. + /// The way to wrap binary operators. BinaryOperatorStyle BreakBeforeBinaryOperators; - /// \brief Different ways to attach braces to their surrounding context. + /// Different ways to attach braces to their surrounding context. enum BraceBreakingStyle { /// Always attach braces to surrounding context. /// \code @@ -579,10 +579,10 @@ struct FormatStyle { BS_Custom }; - /// \brief The brace breaking style to use. + /// The brace breaking style to use. BraceBreakingStyle BreakBeforeBraces; - /// \brief Precise control over the wrapping of braces. + /// Precise control over the wrapping of braces. /// \code /// # Should be declared this way: /// BreakBeforeBraces: Custom @@ -590,7 +590,7 @@ struct FormatStyle { /// AfterClass: true /// \endcode struct BraceWrappingFlags { - /// \brief Wrap class definitions. + /// Wrap class definitions. /// \code /// true: /// class foo {}; @@ -600,7 +600,7 @@ struct FormatStyle { /// {}; /// \endcode bool AfterClass; - /// \brief Wrap control statements (``if``/``for``/``while``/``switch``/..). + /// Wrap control statements (``if``/``for``/``while``/``switch``/..). /// \code /// true: /// if (foo()) @@ -618,7 +618,7 @@ struct FormatStyle { /// } /// \endcode bool AfterControlStatement; - /// \brief Wrap enum definitions. + /// Wrap enum definitions. /// \code /// true: /// enum X : int @@ -630,7 +630,7 @@ struct FormatStyle { /// enum X : int { B }; /// \endcode bool AfterEnum; - /// \brief Wrap function definitions. + /// Wrap function definitions. /// \code /// true: /// void foo() @@ -646,7 +646,7 @@ struct FormatStyle { /// } /// \endcode bool AfterFunction; - /// \brief Wrap namespace definitions. + /// Wrap namespace definitions. /// \code /// true: /// namespace @@ -662,11 +662,11 @@ struct FormatStyle { /// } /// \endcode bool AfterNamespace; - /// \brief Wrap ObjC definitions (interfaces, implementations...). + /// Wrap ObjC definitions (interfaces, implementations...). /// \note @autoreleasepool and @synchronized blocks are wrapped /// according to `AfterControlStatement` flag. bool AfterObjCDeclaration; - /// \brief Wrap struct definitions. + /// Wrap struct definitions. /// \code /// true: /// struct foo @@ -680,7 +680,7 @@ struct FormatStyle { /// }; /// \endcode bool AfterStruct; - /// \brief Wrap union definitions. + /// Wrap union definitions. /// \code /// true: /// union foo @@ -694,7 +694,7 @@ struct FormatStyle { /// } /// \endcode bool AfterUnion; - /// \brief Wrap extern blocks. + /// Wrap extern blocks. /// \code /// true: /// extern "C" @@ -708,7 +708,7 @@ struct FormatStyle { /// } /// \endcode bool AfterExternBlock; - /// \brief Wrap before ``catch``. + /// Wrap before ``catch``. /// \code /// true: /// try { @@ -724,7 +724,7 @@ struct FormatStyle { /// } /// \endcode bool BeforeCatch; - /// \brief Wrap before ``else``. + /// Wrap before ``else``. /// \code /// true: /// if (foo()) { @@ -738,9 +738,9 @@ struct FormatStyle { /// } /// \endcode bool BeforeElse; - /// \brief Indent the wrapped braces themselves. + /// Indent the wrapped braces themselves. bool IndentBraces; - /// \brief If ``false``, empty function body can be put on a single line. + /// If ``false``, empty function body can be put on a single line. /// This option is used only if the opening brace of the function has /// already been wrapped, i.e. the `AfterFunction` brace wrapping mode is /// set, and the function could/should not be put on a single line (as per @@ -752,7 +752,7 @@ struct FormatStyle { /// \endcode /// bool SplitEmptyFunction; - /// \brief If ``false``, empty record (e.g. class, struct or union) body + /// If ``false``, empty record (e.g. class, struct or union) body /// can be put on a single line. This option is used only if the opening /// brace of the record has already been wrapped, i.e. the `AfterClass` /// (for classes) brace wrapping mode is set. @@ -763,7 +763,7 @@ struct FormatStyle { /// \endcode /// bool SplitEmptyRecord; - /// \brief If ``false``, empty namespace body can be put on a single line. + /// If ``false``, empty namespace body can be put on a single line. /// This option is used only if the opening brace of the namespace has /// already been wrapped, i.e. the `AfterNamespace` brace wrapping mode is /// set. @@ -776,7 +776,7 @@ struct FormatStyle { bool SplitEmptyNamespace; }; - /// \brief Control of individual brace wrapping cases. + /// Control of individual brace wrapping cases. /// /// If ``BreakBeforeBraces`` is set to ``BS_Custom``, use this to specify how /// each individual brace case should be handled. Otherwise, this is ignored. @@ -790,7 +790,7 @@ struct FormatStyle { /// \endcode BraceWrappingFlags BraceWrapping; - /// \brief If ``true``, ternary operators will be placed after line breaks. + /// If ``true``, ternary operators will be placed after line breaks. /// \code /// true: /// veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription @@ -804,7 +804,7 @@ struct FormatStyle { /// \endcode bool BreakBeforeTernaryOperators; - /// \brief Different ways to break initializers. + /// Different ways to break initializers. enum BreakConstructorInitializersStyle { /// Break constructor initializers before the colon and after the commas. /// \code @@ -830,10 +830,10 @@ struct FormatStyle { BCIS_AfterColon }; - /// \brief The constructor initializers style to use. + /// The constructor initializers style to use. BreakConstructorInitializersStyle BreakConstructorInitializers; - /// \brief Break after each annotation on a field in Java files. + /// Break after each annotation on a field in Java files. /// \code{.java} /// true: false: /// @Partial vs. @Partial @Mock DataLoad loader; @@ -842,17 +842,17 @@ struct FormatStyle { /// \endcode bool BreakAfterJavaFieldAnnotations; - /// \brief Allow breaking string literals when formatting. + /// Allow breaking string literals when formatting. bool BreakStringLiterals; - /// \brief The column limit. + /// The column limit. /// /// A column limit of ``0`` means that there is no column limit. In this case, /// clang-format will respect the input's line breaking decisions within /// statements unless they contradict other rules. unsigned ColumnLimit; - /// \brief A regular expression that describes comments with special meaning, + /// A regular expression that describes comments with special meaning, /// which should not be split into lines or otherwise changed. /// \code /// // CommentPragmas: '^ FOOBAR pragma:' @@ -861,7 +861,7 @@ struct FormatStyle { /// \endcode std::string CommentPragmas; - /// \brief If ``true``, in the class inheritance expression clang-format will + /// If ``true``, in the class inheritance expression clang-format will /// break before ``:`` and ``,`` if there is multiple inheritance. /// \code /// true: false: @@ -872,7 +872,7 @@ struct FormatStyle { /// \endcode bool BreakBeforeInheritanceComma; - /// \brief If ``true``, consecutive namespace declarations will be on the same + /// If ``true``, consecutive namespace declarations will be on the same /// line. If ``false``, each namespace is declared on a new line. /// \code /// true: @@ -895,7 +895,7 @@ struct FormatStyle { /// \endcode bool CompactNamespaces; - /// \brief If the constructor initializers don't fit on a line, put each + /// If the constructor initializers don't fit on a line, put each /// initializer on its own line. /// \code /// true: @@ -913,11 +913,11 @@ struct FormatStyle { /// \endcode bool ConstructorInitializerAllOnOneLineOrOnePerLine; - /// \brief The number of characters to use for indentation of constructor + /// The number of characters to use for indentation of constructor /// initializer lists. unsigned ConstructorInitializerIndentWidth; - /// \brief Indent width for line continuations. + /// Indent width for line continuations. /// \code /// ContinuationIndentWidth: 2 /// @@ -927,7 +927,7 @@ struct FormatStyle { /// \endcode unsigned ContinuationIndentWidth; - /// \brief If ``true``, format braced lists as best suited for C++11 braced + /// If ``true``, format braced lists as best suited for C++11 braced /// lists. /// /// Important differences: @@ -949,17 +949,17 @@ struct FormatStyle { /// \endcode bool Cpp11BracedListStyle; - /// \brief If ``true``, analyze the formatted file for the most common + /// If ``true``, analyze the formatted file for the most common /// alignment of ``&`` and ``*``. /// Pointer and reference alignment styles are going to be updated according /// to the preferences found in the file. /// ``PointerAlignment`` is then used only as fallback. bool DerivePointerAlignment; - /// \brief Disables formatting completely. + /// Disables formatting completely. bool DisableFormat; - /// \brief If ``true``, clang-format detects whether function calls and + /// If ``true``, clang-format detects whether function calls and /// definitions are formatted with one parameter per line. /// /// Each call can be bin-packed, one-per-line or inconclusive. If it is @@ -971,7 +971,7 @@ struct FormatStyle { /// not use this in config files, etc. Use at your own risk. bool ExperimentalAutoDetectBinPacking; - /// \brief If ``true``, clang-format adds missing namespace end comments and + /// If ``true``, clang-format adds missing namespace end comments and /// fixes invalid existing ones. /// \code /// true: false: @@ -981,7 +981,7 @@ struct FormatStyle { /// \endcode bool FixNamespaceComments; - /// \brief A vector of macros that should be interpreted as foreach loops + /// A vector of macros that should be interpreted as foreach loops /// instead of as function calls. /// /// These are expected to be macros of the form: @@ -998,9 +998,9 @@ struct FormatStyle { /// For example: BOOST_FOREACH. std::vector<std::string> ForEachMacros; - /// \brief Styles for sorting multiple ``#include`` blocks. + /// Styles for sorting multiple ``#include`` blocks. enum IncludeBlocksStyle { - /// \brief Sort each ``#include`` block separately. + /// Sort each ``#include`` block separately. /// \code /// #include "b.h" into #include "b.h" /// @@ -1008,7 +1008,7 @@ struct FormatStyle { /// #include "a.h" #include <lib/main.h> /// \endcode IBS_Preserve, - /// \brief Merge multiple ``#include`` blocks together and sort as one. + /// Merge multiple ``#include`` blocks together and sort as one. /// \code /// #include "b.h" into #include "a.h" /// #include "b.h" @@ -1016,7 +1016,7 @@ struct FormatStyle { /// #include "a.h" /// \endcode IBS_Merge, - /// \brief Merge multiple ``#include`` blocks together and sort as one. + /// Merge multiple ``#include`` blocks together and sort as one. /// Then split into groups based on category priority. See /// ``IncludeCategories``. /// \code @@ -1028,22 +1028,22 @@ struct FormatStyle { IBS_Regroup, }; - /// \brief Dependent on the value, multiple ``#include`` blocks can be sorted + /// Dependent on the value, multiple ``#include`` blocks can be sorted /// as one and divided based on category. IncludeBlocksStyle IncludeBlocks; - /// \brief See documentation of ``IncludeCategories``. + /// See documentation of ``IncludeCategories``. struct IncludeCategory { - /// \brief The regular expression that this category matches. + /// The regular expression that this category matches. std::string Regex; - /// \brief The priority to assign to this category. + /// The priority to assign to this category. int Priority; bool operator==(const IncludeCategory &Other) const { return Regex == Other.Regex && Priority == Other.Priority; } }; - /// \brief Regular expressions denoting the different ``#include`` categories + /// Regular expressions denoting the different ``#include`` categories /// used for ordering ``#includes``. /// /// These regular expressions are matched against the filename of an include @@ -1071,7 +1071,7 @@ struct FormatStyle { /// \endcode std::vector<IncludeCategory> IncludeCategories; - /// \brief Specify a regular expression of suffixes that are allowed in the + /// Specify a regular expression of suffixes that are allowed in the /// file-to-main-include mapping. /// /// When guessing whether a #include is the "main" include (to assign @@ -1084,7 +1084,7 @@ struct FormatStyle { /// as the "main" include in both a.cc and a_test.cc. std::string IncludeIsMainRegex; - /// \brief Indent case labels one level from the switch statement. + /// Indent case labels one level from the switch statement. /// /// When ``false``, use the same indentation level as for the switch statement. /// Switch statement body is always indented one level more than case labels. @@ -1100,7 +1100,7 @@ struct FormatStyle { /// \endcode bool IndentCaseLabels; - /// \brief Options for indenting preprocessor directives. + /// Options for indenting preprocessor directives. enum PPDirectiveIndentStyle { /// Does not indent any directives. /// \code @@ -1122,10 +1122,10 @@ struct FormatStyle { PPDIS_AfterHash }; - /// \brief The preprocessor directive indenting style to use. + /// The preprocessor directive indenting style to use. PPDirectiveIndentStyle IndentPPDirectives; - /// \brief The number of columns to use for indentation. + /// The number of columns to use for indentation. /// \code /// IndentWidth: 3 /// @@ -1138,7 +1138,7 @@ struct FormatStyle { /// \endcode unsigned IndentWidth; - /// \brief Indent if a function definition or declaration is wrapped after the + /// Indent if a function definition or declaration is wrapped after the /// type. /// \code /// true: @@ -1151,7 +1151,7 @@ struct FormatStyle { /// \endcode bool IndentWrappedFunctionNames; - /// \brief Quotation styles for JavaScript strings. Does not affect template + /// Quotation styles for JavaScript strings. Does not affect template /// strings. enum JavaScriptQuoteStyle { /// Leave string quotes as they are. @@ -1174,10 +1174,10 @@ struct FormatStyle { JSQS_Double }; - /// \brief The JavaScriptQuoteStyle to use for JavaScript strings. + /// The JavaScriptQuoteStyle to use for JavaScript strings. JavaScriptQuoteStyle JavaScriptQuotes; - /// \brief Whether to wrap JavaScript import/export statements. + /// Whether to wrap JavaScript import/export statements. /// \code{.js} /// true: /// import { @@ -1191,7 +1191,7 @@ struct FormatStyle { /// \endcode bool JavaScriptWrapImports; - /// \brief If true, the empty line at the start of blocks is kept. + /// If true, the empty line at the start of blocks is kept. /// \code /// true: false: /// if (foo) { vs. if (foo) { @@ -1201,7 +1201,7 @@ struct FormatStyle { /// \endcode bool KeepEmptyLinesAtTheStartOfBlocks; - /// \brief Supported languages. + /// Supported languages. /// /// When stored in a configuration file, specifies the language, that the /// configuration targets. When passed to the ``reformat()`` function, enables @@ -1228,10 +1228,10 @@ struct FormatStyle { }; bool isCpp() const { return Language == LK_Cpp || Language == LK_ObjC; } - /// \brief Language, this format style is targeted at. + /// Language, this format style is targeted at. LanguageKind Language; - /// \brief A regular expression matching macros that start a block. + /// A regular expression matching macros that start a block. /// \code /// # With: /// MacroBlockBegin: "^NS_MAP_BEGIN|\ @@ -1259,10 +1259,10 @@ struct FormatStyle { /// \endcode std::string MacroBlockBegin; - /// \brief A regular expression matching macros that end a block. + /// A regular expression matching macros that end a block. std::string MacroBlockEnd; - /// \brief The maximum number of consecutive empty lines to keep. + /// The maximum number of consecutive empty lines to keep. /// \code /// MaxEmptyLinesToKeep: 1 vs. MaxEmptyLinesToKeep: 0 /// int f() { int f() { @@ -1275,7 +1275,7 @@ struct FormatStyle { /// \endcode unsigned MaxEmptyLinesToKeep; - /// \brief Different ways to indent namespace contents. + /// Different ways to indent namespace contents. enum NamespaceIndentationKind { /// Don't indent in namespaces. /// \code @@ -1309,10 +1309,10 @@ struct FormatStyle { NI_All }; - /// \brief The indentation used for namespaces. + /// The indentation used for namespaces. NamespaceIndentationKind NamespaceIndentation; - /// \brief Controls bin-packing Objective-C protocol conformance list + /// Controls bin-packing Objective-C protocol conformance list /// items into as few lines as possible when they go over ``ColumnLimit``. /// /// If ``Auto`` (the default), delegates to the value in @@ -1344,7 +1344,7 @@ struct FormatStyle { /// \endcode BinPackStyle ObjCBinPackProtocolList; - /// \brief The number of characters to use for indentation of ObjC blocks. + /// The number of characters to use for indentation of ObjC blocks. /// \code{.objc} /// ObjCBlockIndentWidth: 4 /// @@ -1354,37 +1354,37 @@ struct FormatStyle { /// \endcode unsigned ObjCBlockIndentWidth; - /// \brief Add a space after ``@property`` in Objective-C, i.e. use + /// Add a space after ``@property`` in Objective-C, i.e. use /// ``@property (readonly)`` instead of ``@property(readonly)``. bool ObjCSpaceAfterProperty; - /// \brief Add a space in front of an Objective-C protocol list, i.e. use + /// Add a space in front of an Objective-C protocol list, i.e. use /// ``Foo <Protocol>`` instead of ``Foo<Protocol>``. bool ObjCSpaceBeforeProtocolList; - /// \brief The penalty for breaking around an assignment operator. + /// The penalty for breaking around an assignment operator. unsigned PenaltyBreakAssignment; - /// \brief The penalty for breaking a function call after ``call(``. + /// The penalty for breaking a function call after ``call(``. unsigned PenaltyBreakBeforeFirstCallParameter; - /// \brief The penalty for each line break introduced inside a comment. + /// The penalty for each line break introduced inside a comment. unsigned PenaltyBreakComment; - /// \brief The penalty for breaking before the first ``<<``. + /// The penalty for breaking before the first ``<<``. unsigned PenaltyBreakFirstLessLess; - /// \brief The penalty for each line break introduced inside a string literal. + /// The penalty for each line break introduced inside a string literal. unsigned PenaltyBreakString; - /// \brief The penalty for each character outside of the column limit. + /// The penalty for each character outside of the column limit. unsigned PenaltyExcessCharacter; - /// \brief Penalty for putting the return type of a function onto its own + /// Penalty for putting the return type of a function onto its own /// line. unsigned PenaltyReturnTypeOnItsOwnLine; - /// \brief The ``&`` and ``*`` alignment style. + /// The ``&`` and ``*`` alignment style. enum PointerAlignmentStyle { /// Align pointer to the left. /// \code @@ -1403,20 +1403,20 @@ struct FormatStyle { PAS_Middle }; - /// \brief Pointer and reference alignment style. + /// Pointer and reference alignment style. PointerAlignmentStyle PointerAlignment; /// See documentation of ``RawStringFormats``. struct RawStringFormat { - /// \brief The language of this raw string. + /// The language of this raw string. LanguageKind Language; - /// \brief A list of raw string delimiters that match this language. + /// A list of raw string delimiters that match this language. std::vector<std::string> Delimiters; - /// \brief A list of enclosing function names that match this language. + /// A list of enclosing function names that match this language. std::vector<std::string> EnclosingFunctions; - /// \brief The canonical delimiter for this language. + /// The canonical delimiter for this language. std::string CanonicalDelimiter; - /// \brief The style name on which this raw string format is based on. + /// The style name on which this raw string format is based on. /// If not specified, the raw string format is based on the style that this /// format is based on. std::string BasedOnStyle; @@ -1428,7 +1428,7 @@ struct FormatStyle { } }; - /// \brief Defines hints for detecting supported languages code blocks in raw + /// Defines hints for detecting supported languages code blocks in raw /// strings. /// /// A raw string with a matching delimiter or a matching enclosing function @@ -1465,7 +1465,7 @@ struct FormatStyle { /// \endcode std::vector<RawStringFormat> RawStringFormats; - /// \brief If ``true``, clang-format will attempt to re-flow comments. + /// If ``true``, clang-format will attempt to re-flow comments. /// \code /// false: /// // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information @@ -1479,7 +1479,7 @@ struct FormatStyle { /// \endcode bool ReflowComments; - /// \brief If ``true``, clang-format will sort ``#includes``. + /// If ``true``, clang-format will sort ``#includes``. /// \code /// false: true: /// #include "b.h" vs. #include "a.h" @@ -1487,7 +1487,7 @@ struct FormatStyle { /// \endcode bool SortIncludes; - /// \brief If ``true``, clang-format will sort using declarations. + /// If ``true``, clang-format will sort using declarations. /// /// The order of using declarations is defined as follows: /// Split the strings by "::" and discard any initial empty strings. The last @@ -1503,21 +1503,21 @@ struct FormatStyle { /// \endcode bool SortUsingDeclarations; - /// \brief If ``true``, a space is inserted after C style casts. + /// If ``true``, a space is inserted after C style casts. /// \code /// true: false: /// (int) i; vs. (int)i; /// \endcode bool SpaceAfterCStyleCast; - /// \brief If \c true, a space will be inserted after the 'template' keyword. + /// If \c true, a space will be inserted after the 'template' keyword. /// \code /// true: false: /// template <int> void foo(); vs. template<int> void foo(); /// \endcode bool SpaceAfterTemplateKeyword; - /// \brief If ``false``, spaces will be removed before assignment operators. + /// If ``false``, spaces will be removed before assignment operators. /// \code /// true: false: /// int a = 5; vs. int a=5; @@ -1525,7 +1525,7 @@ struct FormatStyle { /// \endcode bool SpaceBeforeAssignmentOperators; - /// \brief If ``false``, spaces will be removed before constructor initializer + /// If ``false``, spaces will be removed before constructor initializer /// colon. /// \code /// true: false: @@ -1533,14 +1533,14 @@ struct FormatStyle { /// \endcode bool SpaceBeforeCtorInitializerColon; - /// \brief If ``false``, spaces will be removed before inheritance colon. + /// If ``false``, spaces will be removed before inheritance colon. /// \code /// true: false: /// class Foo : Bar {} vs. class Foo: Bar {} /// \endcode bool SpaceBeforeInheritanceColon; - /// \brief Different ways to put a space before opening parentheses. + /// Different ways to put a space before opening parentheses. enum SpaceBeforeParensOptions { /// Never put a space before opening parentheses. /// \code @@ -1575,10 +1575,10 @@ struct FormatStyle { SBPO_Always }; - /// \brief Defines in which cases to put a space before opening parentheses. + /// Defines in which cases to put a space before opening parentheses. SpaceBeforeParensOptions SpaceBeforeParens; - /// \brief If ``false``, spaces will be removed before range-based for loop + /// If ``false``, spaces will be removed before range-based for loop /// colon. /// \code /// true: false: @@ -1586,7 +1586,7 @@ struct FormatStyle { /// \endcode bool SpaceBeforeRangeBasedForLoopColon; - /// \brief If ``true``, spaces may be inserted into ``()``. + /// If ``true``, spaces may be inserted into ``()``. /// \code /// true: false: /// void f( ) { vs. void f() { @@ -1598,7 +1598,7 @@ struct FormatStyle { /// \endcode bool SpaceInEmptyParentheses; - /// \brief The number of spaces before trailing line comments + /// The number of spaces before trailing line comments /// (``//`` - comments). /// /// This does not affect trailing block comments (``/*`` - comments) as @@ -1614,7 +1614,7 @@ struct FormatStyle { /// \endcode unsigned SpacesBeforeTrailingComments; - /// \brief If ``true``, spaces will be inserted after ``<`` and before ``>`` + /// If ``true``, spaces will be inserted after ``<`` and before ``>`` /// in template argument lists. /// \code /// true: false: @@ -1623,7 +1623,7 @@ struct FormatStyle { /// \endcode bool SpacesInAngles; - /// \brief If ``true``, spaces are inserted inside container literals (e.g. + /// If ``true``, spaces are inserted inside container literals (e.g. /// ObjC and Javascript array and dict literals). /// \code{.js} /// true: false: @@ -1632,21 +1632,21 @@ struct FormatStyle { /// \endcode bool SpacesInContainerLiterals; - /// \brief If ``true``, spaces may be inserted into C style casts. + /// If ``true``, spaces may be inserted into C style casts. /// \code /// true: false: /// x = ( int32 )y vs. x = (int32)y /// \endcode bool SpacesInCStyleCastParentheses; - /// \brief If ``true``, spaces will be inserted after ``(`` and before ``)``. + /// If ``true``, spaces will be inserted after ``(`` and before ``)``. /// \code /// true: false: /// t f( Deleted & ) & = delete; vs. t f(Deleted &) & = delete; /// \endcode bool SpacesInParentheses; - /// \brief If ``true``, spaces will be inserted after ``[`` and before ``]``. + /// If ``true``, spaces will be inserted after ``[`` and before ``]``. /// Lambdas or unspecified size array declarations will not be affected. /// \code /// true: false: @@ -1655,7 +1655,7 @@ struct FormatStyle { /// \endcode bool SpacesInSquareBrackets; - /// \brief Supported language standards. + /// Supported language standards. enum LanguageStandard { /// Use C++03-compatible syntax. LS_Cpp03, @@ -1666,14 +1666,14 @@ struct FormatStyle { LS_Auto }; - /// \brief Format compatible with this standard, e.g. use ``A<A<int> >`` + /// Format compatible with this standard, e.g. use ``A<A<int> >`` /// instead of ``A<A<int>>`` for ``LS_Cpp03``. LanguageStandard Standard; - /// \brief The number of columns used for tab stops. + /// The number of columns used for tab stops. unsigned TabWidth; - /// \brief Different ways to use tab in formatting. + /// Different ways to use tab in formatting. enum UseTabStyle { /// Never use tab. UT_Never, @@ -1686,7 +1686,7 @@ struct FormatStyle { UT_Always }; - /// \brief The way to use tab characters in the resulting file. + /// The way to use tab characters in the resulting file. UseTabStyle UseTab; bool operator==(const FormatStyle &R) const { @@ -1822,36 +1822,36 @@ private: friend std::error_code parseConfiguration(StringRef Text, FormatStyle *Style); }; -/// \brief Returns a format style complying with the LLVM coding standards: +/// Returns a format style complying with the LLVM coding standards: /// http://llvm.org/docs/CodingStandards.html. FormatStyle getLLVMStyle(); -/// \brief Returns a format style complying with one of Google's style guides: +/// Returns a format style complying with one of Google's style guides: /// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml. /// http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml. /// https://developers.google.com/protocol-buffers/docs/style. FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language); -/// \brief Returns a format style complying with Chromium's style guide: +/// Returns a format style complying with Chromium's style guide: /// http://www.chromium.org/developers/coding-style. FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language); -/// \brief Returns a format style complying with Mozilla's style guide: +/// Returns a format style complying with Mozilla's style guide: /// https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style. FormatStyle getMozillaStyle(); -/// \brief Returns a format style complying with Webkit's style guide: +/// Returns a format style complying with Webkit's style guide: /// http://www.webkit.org/coding/coding-style.html FormatStyle getWebKitStyle(); -/// \brief Returns a format style complying with GNU Coding Standards: +/// Returns a format style complying with GNU Coding Standards: /// http://www.gnu.org/prep/standards/standards.html FormatStyle getGNUStyle(); -/// \brief Returns style indicating formatting should be not applied at all. +/// Returns style indicating formatting should be not applied at all. FormatStyle getNoStyle(); -/// \brief Gets a predefined style for the specified language by name. +/// Gets a predefined style for the specified language by name. /// /// Currently supported names: LLVM, Google, Chromium, Mozilla. Names are /// compared case-insensitively. @@ -1860,7 +1860,7 @@ FormatStyle getNoStyle(); bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language, FormatStyle *Style); -/// \brief Parse configuration from YAML-formatted text. +/// Parse configuration from YAML-formatted text. /// /// Style->Language is used to get the base style, if the ``BasedOnStyle`` /// option is present. @@ -1871,24 +1871,24 @@ bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language, /// document, are retained in \p Style. std::error_code parseConfiguration(StringRef Text, FormatStyle *Style); -/// \brief Gets configuration in a YAML string. +/// Gets configuration in a YAML string. std::string configurationAsText(const FormatStyle &Style); -/// \brief Returns the replacements necessary to sort all ``#include`` blocks +/// Returns the replacements necessary to sort all ``#include`` blocks /// that are affected by ``Ranges``. tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, ArrayRef<tooling::Range> Ranges, StringRef FileName, unsigned *Cursor = nullptr); -/// \brief Returns the replacements corresponding to applying and formatting +/// Returns the replacements corresponding to applying and formatting /// \p Replaces on success; otheriwse, return an llvm::Error carrying /// llvm::StringError. llvm::Expected<tooling::Replacements> formatReplacements(StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style); -/// \brief Returns the replacements corresponding to applying \p Replaces and +/// Returns the replacements corresponding to applying \p Replaces and /// cleaning up the code after that on success; otherwise, return an llvm::Error /// carrying llvm::StringError. /// This also supports inserting/deleting C++ #include directives: @@ -1909,19 +1909,19 @@ llvm::Expected<tooling::Replacements> cleanupAroundReplacements(StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style); -/// \brief Represents the status of a formatting attempt. +/// Represents the status of a formatting attempt. struct FormattingAttemptStatus { - /// \brief A value of ``false`` means that any of the affected ranges were not + /// A value of ``false`` means that any of the affected ranges were not /// formatted due to a non-recoverable syntax error. bool FormatComplete = true; - /// \brief If ``FormatComplete`` is false, ``Line`` records a one-based + /// If ``FormatComplete`` is false, ``Line`` records a one-based /// original line number at which a syntax error might have occurred. This is /// based on a best-effort analysis and could be imprecise. unsigned Line = 0; }; -/// \brief Reformats the given \p Ranges in \p Code. +/// Reformats the given \p Ranges in \p Code. /// /// Each range is extended on either end to its next bigger logic unit, i.e. /// everything that might influence its formatting or might be influenced by its @@ -1937,7 +1937,7 @@ tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, StringRef FileName = "<stdin>", FormattingAttemptStatus *Status = nullptr); -/// \brief Same as above, except if ``IncompleteFormat`` is non-null, its value +/// Same as above, except if ``IncompleteFormat`` is non-null, its value /// will be set to true if any of the affected ranges were not formatted due to /// a non-recoverable syntax error. tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, @@ -1945,7 +1945,7 @@ tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, StringRef FileName, bool *IncompleteFormat); -/// \brief Clean up any erroneous/redundant code in the given \p Ranges in \p +/// Clean up any erroneous/redundant code in the given \p Ranges in \p /// Code. /// /// Returns the ``Replacements`` that clean up all \p Ranges in \p Code. @@ -1953,7 +1953,7 @@ tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code, ArrayRef<tooling::Range> Ranges, StringRef FileName = "<stdin>"); -/// \brief Fix namespace end comments in the given \p Ranges in \p Code. +/// Fix namespace end comments in the given \p Ranges in \p Code. /// /// Returns the ``Replacements`` that fix the namespace comments in all /// \p Ranges in \p Code. @@ -1962,7 +1962,7 @@ tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style, ArrayRef<tooling::Range> Ranges, StringRef FileName = "<stdin>"); -/// \brief Sort consecutive using declarations in the given \p Ranges in +/// Sort consecutive using declarations in the given \p Ranges in /// \p Code. /// /// Returns the ``Replacements`` that sort the using declarations in all @@ -1972,17 +1972,17 @@ tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, ArrayRef<tooling::Range> Ranges, StringRef FileName = "<stdin>"); -/// \brief Returns the ``LangOpts`` that the formatter expects you to set. +/// Returns the ``LangOpts`` that the formatter expects you to set. /// /// \param Style determines specific settings for lexing mode. LangOptions getFormattingLangOpts(const FormatStyle &Style = getLLVMStyle()); -/// \brief Description to be used for help text for a ``llvm::cl`` option for +/// Description to be used for help text for a ``llvm::cl`` option for /// specifying format style. The description is closely related to the operation /// of ``getStyle()``. extern const char *StyleOptionHelpDescription; -/// \brief Construct a FormatStyle based on ``StyleName``. +/// Construct a FormatStyle based on ``StyleName``. /// /// ``StyleName`` can take several forms: /// * "{<key>: <value>, ...}" - Set specic style parameters. @@ -2011,11 +2011,11 @@ llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName, StringRef Code = "", vfs::FileSystem *FS = nullptr); -// \brief Guesses the language from the ``FileName`` and ``Code`` to be formatted. +// Guesses the language from the ``FileName`` and ``Code`` to be formatted. // Defaults to FormatStyle::LK_Cpp. FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code); -// \brief Returns a string representation of ``Language``. +// Returns a string representation of ``Language``. inline StringRef getLanguageName(FormatStyle::LanguageKind Language) { switch (Language) { case FormatStyle::LK_Cpp: |