clang API Documentation

Public Member Functions | Public Attributes
clang::format::ParenState Struct Reference

#include <ContinuationIndenter.h>

Collaboration diagram for clang::format::ParenState:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ParenState (unsigned Indent, unsigned IndentLevel, unsigned LastSpace, bool AvoidBinPacking, bool NoLineBreak)
bool operator< (const ParenState &Other) const

Public Attributes

unsigned Indent
 The position to which a specific parenthesis level needs to be indented.
unsigned IndentLevel
 The number of indentation levels of the block.
unsigned LastSpace
 The position of the last space on each level.
unsigned FirstLessLess
 The position the first "<<" operator encountered on each level.
bool BreakBeforeClosingBrace
 Whether a newline needs to be inserted before the block's closing brace.
unsigned QuestionColumn
 The column of a ? in a conditional expression;.
bool AvoidBinPacking
 Avoid bin packing, i.e. multiple parameters/elements on multiple lines, in this context.
bool BreakBeforeParameter
 Break after the next comma (or all the commas in this context if AvoidBinPacking is true).
bool NoLineBreak
 Line breaking in this context would break a formatting rule.
bool LastOperatorWrapped
 True if the last binary operator on this level was wrapped to the next line.
unsigned ColonPos
 The position of the colon in an ObjC method declaration/call.
unsigned StartOfFunctionCall
 The start of the most recent function in a builder-type call.
unsigned StartOfArraySubscripts
 Contains the start of array subscript expressions, so that they can be aligned.
unsigned NestedNameSpecifierContinuation
 If a nested name specifier was broken over multiple lines, this contains the start column of the second line. Otherwise 0.
unsigned CallContinuation
 If a call expression was broken over multiple lines, this contains the start column of the second line. Otherwise 0.
unsigned VariablePos
 The column of the first variable name in a variable declaration.
bool ContainsLineBreak
 true if this ParenState already contains a line-break.
bool ContainsUnwrappedBuilder
 true if this ParenState contains multiple segments of a builder-type call on one line.
bool AlignColons
 true if the colons of the curren ObjC method expression should be aligned.
bool ObjCSelectorNameFound
 true if at least one selector name was found in the current ObjC method expression.
bool HasMultipleNestedBlocks
 true if there are multiple nested blocks inside these parens.
bool JSFunctionInlined

Detailed Description

Definition at line 147 of file ContinuationIndenter.h.


Constructor & Destructor Documentation

clang::format::ParenState::ParenState ( unsigned  Indent,
unsigned  IndentLevel,
unsigned  LastSpace,
bool  AvoidBinPacking,
bool  NoLineBreak 
) [inline]

Definition at line 148 of file ContinuationIndenter.h.


Member Function Documentation

bool clang::format::ParenState::operator< ( const ParenState Other) const [inline]

Member Data Documentation

true if the colons of the curren ObjC method expression should be aligned.

Not considered for memoization as it will always have the same value at the same token.

Definition at line 244 of file ContinuationIndenter.h.

Avoid bin packing, i.e. multiple parameters/elements on multiple lines, in this context.

Definition at line 192 of file ContinuationIndenter.h.

Referenced by operator<().

Whether a newline needs to be inserted before the block's closing brace.

We only want to insert a newline before the closing brace if there also was a newline after the beginning left brace.

Definition at line 185 of file ContinuationIndenter.h.

Referenced by operator<().

Break after the next comma (or all the commas in this context if AvoidBinPacking is true).

Definition at line 196 of file ContinuationIndenter.h.

Referenced by operator<().

If a call expression was broken over multiple lines, this contains the start column of the second line. Otherwise 0.

Definition at line 221 of file ContinuationIndenter.h.

Referenced by operator<().

The position of the colon in an ObjC method declaration/call.

Definition at line 206 of file ContinuationIndenter.h.

Referenced by operator<().

true if this ParenState already contains a line-break.

The first line break in a certain ParenState causes extra penalty so that clang-format prefers similar breaks, i.e. breaks in the same parenthesis.

Definition at line 233 of file ContinuationIndenter.h.

Referenced by operator<().

true if this ParenState contains multiple segments of a builder-type call on one line.

Definition at line 237 of file ContinuationIndenter.h.

Referenced by operator<().

The position the first "<<" operator encountered on each level.

Used to align "<<" operators. 0 if no such operator has been encountered on a level.

Definition at line 178 of file ContinuationIndenter.h.

Referenced by operator<().

true if there are multiple nested blocks inside these parens.

Not considered for memoization as it will always have the same value at the same token.

Definition at line 257 of file ContinuationIndenter.h.

The position to which a specific parenthesis level needs to be indented.

Definition at line 162 of file ContinuationIndenter.h.

Referenced by operator<().

The number of indentation levels of the block.

Definition at line 165 of file ContinuationIndenter.h.

Definition at line 261 of file ContinuationIndenter.h.

Referenced by operator<().

True if the last binary operator on this level was wrapped to the next line.

Definition at line 203 of file ContinuationIndenter.h.

Referenced by operator<().

The position of the last space on each level.

Used e.g. to break like: functionCall(Parameter, otherCall( OtherParameter));

Definition at line 172 of file ContinuationIndenter.h.

Referenced by operator<().

If a nested name specifier was broken over multiple lines, this contains the start column of the second line. Otherwise 0.

Definition at line 217 of file ContinuationIndenter.h.

Line breaking in this context would break a formatting rule.

Definition at line 199 of file ContinuationIndenter.h.

Referenced by operator<().

true if at least one selector name was found in the current ObjC method expression.

Not considered for memoization as it will always have the same value at the same token.

Definition at line 251 of file ContinuationIndenter.h.

The column of a ? in a conditional expression;.

Definition at line 188 of file ContinuationIndenter.h.

Referenced by operator<().

Contains the start of array subscript expressions, so that they can be aligned.

Definition at line 213 of file ContinuationIndenter.h.

Referenced by operator<().

The start of the most recent function in a builder-type call.

Definition at line 209 of file ContinuationIndenter.h.

Referenced by operator<().

The column of the first variable name in a variable declaration.

Used to align further variables if necessary.

Definition at line 226 of file ContinuationIndenter.h.

Referenced by operator<().


The documentation for this struct was generated from the following file: