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

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/Format/ContinuationIndenter.h"

Public Member Functions

 ContinuationIndenter (const FormatStyle &Style, const AdditionalKeywords &Keywords, const SourceManager &SourceMgr, WhitespaceManager &Whitespaces, encoding::Encoding Encoding, bool BinPackInconclusiveFunctions)
 Constructs a ContinuationIndenter to format Line starting in column FirstIndent. More...
 
LineState getInitialState (unsigned FirstIndent, unsigned FirstStartColumn, const AnnotatedLine *Line, bool DryRun)
 Get the initial state, i.e. 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. More...
 

Detailed Description

Definition at line 47 of file ContinuationIndenter.h.

Constructor & Destructor Documentation

◆ ContinuationIndenter()

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

Constructs a ContinuationIndenter to format Line starting in column FirstIndent.

Definition at line 127 of file ContinuationIndenter.cpp.

Member Function Documentation

◆ addTokenToState()

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

Appends the next token to State and updates information necessary for indentation.

Puts the token on the current line if Newline is false and adds a line break and necessary indentation otherwise.

If DryRun is false, also creates and stores the required Replacement.

Definition at line 388 of file ContinuationIndenter.cpp.

Referenced by clang::format::CommaSeparatedList::formatAfterToken().

◆ canBreak()

bool clang::format::ContinuationIndenter::canBreak ( const LineState State)

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

Definition at line 179 of file ContinuationIndenter.cpp.

◆ getColumnLimit()

unsigned clang::format::ContinuationIndenter::getColumnLimit ( const LineState State) const

◆ getInitialState()

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

◆ mustBreak()

bool clang::format::ContinuationIndenter::mustBreak ( const LineState State)

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

Definition at line 228 of file ContinuationIndenter.cpp.


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