clang  3.7.0
Public Member Functions | List of all members
clang::format::ContinuationIndenter Class Reference

#include <ContinuationIndenter.h>

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. More...
 
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. More...
 
bool canBreak (const LineState &State)
 Returns true, if a line break after State is allowed. More...
 
bool mustBreak (const LineState &State)
 Returns true, if a line break after State is mandatory. More...
 
unsigned addTokenToState (LineState &State, bool Newline, bool DryRun, unsigned ExtraSpaces=0)
 Appends the next token to State and updates information necessary for indentation. More...
 
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. More...
 

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 
)
bool clang::format::ContinuationIndenter::canBreak ( const LineState State)
unsigned clang::format::ContinuationIndenter::getColumnLimit ( const LineState State) const

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

Definition at line 1147 of file ContinuationIndenter.cpp.

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

Referenced by mustBreak().

LineState clang::format::ContinuationIndenter::getInitialState ( unsigned  FirstIndent,
const AnnotatedLine Line,
bool  DryRun 
)
bool clang::format::ContinuationIndenter::mustBreak ( const LineState State)

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

Definition at line 136 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::BreakBeforeTernaryOperators, clang::format::FormatStyle::BreakConstructorInitializersBeforeComma, clang::format::FormatToken::CanBreakBefore, clang::format::FormatToken::closesBlockTypeList(), clang::format::FormatToken::ClosesTemplateDeclaration, clang::format::LineState::Column, clang::format::FormatStyle::ColumnLimit, clang::format::FormatStyle::ContinuationIndentWidth, Current, clang::format::FormatToken::EndsBinaryExpression, clang::prec::Equality, clang::format::LineState::FirstIndent, 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(), and clang::format::FormatToken::TokenText.


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