clang API Documentation

Public Member Functions
clang::format::ContinuationIndenter Class Reference

#include <ContinuationIndenter.h>

List of all members.

Public Member Functions

 ContinuationIndenter (const FormatStyle &Style, const AdditionalKeywords &Keywords, SourceManager &SourceMgr, WhitespaceManager &Whitespaces, encoding::Encoding Encoding, bool BinPackInconclusiveFunctions)
 Constructs a ContinuationIndenter to format Line starting in column FirstIndent.
LineState getInitialState (unsigned FirstIndent, const AnnotatedLine *Line, bool DryRun)
 Get the initial state, i.e. the state after placing Line's first token at FirstIndent.
bool canBreak (const LineState &State)
 Returns true, if a line break after State is allowed.
bool mustBreak (const LineState &State)
 Returns true, if a line break after State is mandatory.
unsigned addTokenToState (LineState &State, bool Newline, bool DryRun, unsigned ExtraSpaces=0)
 Appends the next token to State and updates information necessary for indentation.
unsigned getColumnLimit (const LineState &State) const
 Get the column limit for this line. This is the style's column limit, potentially reduced for preprocessor definitions.

Detailed Description

Definition at line 35 of file ContinuationIndenter.h.


Constructor & Destructor Documentation

clang::format::ContinuationIndenter::ContinuationIndenter ( const FormatStyle Style,
const AdditionalKeywords Keywords,
SourceManager SourceMgr,
WhitespaceManager Whitespaces,
encoding::Encoding  Encoding,
bool  BinPackInconclusiveFunctions 
)

Constructs a ContinuationIndenter to format Line starting in column FirstIndent.

Definition at line 59 of file ContinuationIndenter.cpp.


Member Function Documentation

unsigned clang::format::ContinuationIndenter::addTokenToState ( LineState State,
bool  Newline,
bool  DryRun,
unsigned  ExtraSpaces = 0 
)

Get the column limit for this line. This is the style's column limit, potentially reduced for preprocessor definitions.

Definition at line 1133 of file ContinuationIndenter.cpp.

References clang::format::FormatStyle::ColumnLimit, clang::format::AnnotatedLine::InPPDirective, and clang::format::LineState::Line.

Referenced by mustBreak().

Returns true, if a line break after State is mandatory.

Definition at line 135 of file ContinuationIndenter.cpp.

References clang::format::FormatStyle::AllowShortFunctionsOnASingleLine, clang::format::FormatStyle::AlwaysBreakBeforeMultilineStrings, clang::prec::Assignment, clang::format::BK_Block, clang::format::FormatToken::BlockKind, clang::format::FormatStyle::BreakBeforeBinaryOperators, clang::format::FormatStyle::BreakBeforeTernaryOperators, clang::format::FormatStyle::BreakConstructorInitializersBeforeComma, clang::format::FormatToken::closesBlockTypeList(), clang::format::FormatToken::ClosesTemplateDeclaration, clang::format::LineState::Column, clang::format::FormatStyle::ColumnLimit, Current, clang::format::FormatToken::EndsBinaryExpression, clang::prec::Equality, getColumnLimit(), clang::format::getLengthToMatchingParen(), clang::format::FormatToken::getPrecedence(), clang::format::FormatToken::is(), clang::format::FormatToken::isNot(), clang::format::FormatToken::isOneOf(), clang::format::FormatToken::isTrailingComment(), clang::format::LineState::LineContainsContinuedForLoopSection, clang::format::FormatToken::MustBreakBefore, clang::format::FormatToken::NestingLevel, clang::format::LineState::NextToken, clang::format::FormatToken::Previous, Previous, clang::prec::Relational, clang::format::FormatStyle::SFS_All, clang::format::LineState::Stack, clang::format::startsNextParameter(), clang::format::startsSegmentOfBuilderTypeCall(), clang::format::TT_ArrayInitializerLSquare, clang::format::TT_BinaryOperator, clang::format::TT_ConditionalExpr, clang::format::TT_CtorInitializerColon, clang::format::TT_DictLiteral, clang::format::TT_FunctionDeclarationName, clang::format::TT_InlineASMColon, clang::format::TT_OverloadedOperator, clang::format::TT_SelectorName, and clang::format::FormatToken::Type.


The documentation for this class was generated from the following files: