|
clang
3.8.0
|
#include <BreakableToken.h>
Public Member Functions | |
| BreakableBlockComment (const FormatToken &Token, unsigned IndentLevel, unsigned StartColumn, unsigned OriginaStartColumn, bool FirstInLine, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style) | |
| Creates a breakable token for a block comment. More... | |
| unsigned | getLineCount () const override |
| Returns the number of lines in this token in the original code. More... | |
| unsigned | getLineLengthAfterSplit (unsigned LineIndex, unsigned TailOffset, StringRef::size_type Length) const override |
Returns the number of columns required to format the piece of line at LineIndex, from byte offset Offset with length Length. More... | |
| Split | getSplit (unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit) const override |
Returns a range (offset, length) at which to break the line at LineIndex, if previously broken at TailOffset. More... | |
| void | insertBreak (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces) override |
Emits the previously retrieved Split via Whitespaces. More... | |
| void | replaceWhitespace (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces) override |
Replaces the whitespace range described by Split with a single space. More... | |
| void | replaceWhitespaceBefore (unsigned LineIndex, WhitespaceManager &Whitespaces) override |
Replaces the whitespace between LineIndex-1 and LineIndex. More... | |
Public Member Functions inherited from clang::format::BreakableToken | |
| virtual | ~BreakableToken () |
Additional Inherited Members | |
Public Types inherited from clang::format::BreakableToken | |
| typedef std::pair < StringRef::size_type, unsigned > | Split |
| Contains starting character index and length of split. More... | |
Protected Member Functions inherited from clang::format::BreakableToken | |
| BreakableToken (const FormatToken &Tok, unsigned IndentLevel, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style) | |
Protected Attributes inherited from clang::format::BreakableToken | |
| const FormatToken & | Tok |
| const unsigned | IndentLevel |
| const bool | InPPDirective |
| const encoding::Encoding | Encoding |
| const FormatStyle & | Style |
Definition at line 157 of file BreakableToken.h.
| clang::format::BreakableBlockComment::BreakableBlockComment | ( | const FormatToken & | Token, |
| unsigned | IndentLevel, | ||
| unsigned | StartColumn, | ||
| unsigned | OriginaStartColumn, | ||
| bool | FirstInLine, | ||
| bool | InPPDirective, | ||
| encoding::Encoding | Encoding, | ||
| const FormatStyle & | Style | ||
| ) |
Creates a breakable token for a block comment.
StartColumn specifies the column in which the comment will start after formatting, while OriginalStartColumn specifies in which column the comment started before formatting. If the comment starts a line after formatting, set FirstInLine to true.
Definition at line 252 of file BreakableToken.cpp.
References clang::format::FormatToken::TokenText.
|
overridevirtual |
Returns the number of lines in this token in the original code.
Implements clang::format::BreakableToken.
Definition at line 364 of file BreakableToken.cpp.
|
overridevirtual |
Returns the number of columns required to format the piece of line at LineIndex, from byte offset Offset with length Length.
Note that previous breaks are not taken into account. Offset is always specified from the start of the (original) line. Length can be set to StringRef::npos, which means "to the end of line".
Implements clang::format::BreakableToken.
Definition at line 366 of file BreakableToken.cpp.
References clang::format::encoding::columnWidthWithTabs(), clang::format::BreakableToken::Encoding, clang::format::BreakableToken::Style, and clang::format::FormatStyle::TabWidth.
|
overridevirtual |
Returns a range (offset, length) at which to break the line at LineIndex, if previously broken at TailOffset.
If possible, do not violate ColumnLimit.
Implements clang::format::BreakableToken.
Definition at line 378 of file BreakableToken.cpp.
References clang::format::BreakableToken::Encoding, clang::format::getCommentSplit(), clang::format::BreakableToken::Style, and clang::format::FormatStyle::TabWidth.
|
overridevirtual |
Emits the previously retrieved Split via Whitespaces.
Implements clang::format::BreakableToken.
Definition at line 385 of file BreakableToken.cpp.
References clang::format::BreakableToken::IndentLevel, clang::format::BreakableToken::InPPDirective, clang::format::WhitespaceManager::replaceWhitespaceInToken(), Text, clang::format::BreakableToken::Tok, and clang::format::FormatToken::TokenText.
|
overridevirtual |
Replaces the whitespace range described by Split with a single space.
Implements clang::format::BreakableToken.
Definition at line 405 of file BreakableToken.cpp.
References clang::format::WhitespaceManager::replaceWhitespaceInToken(), Text, clang::format::BreakableToken::Tok, and clang::format::FormatToken::TokenText.
|
overridevirtual |
Replaces the whitespace between LineIndex-1 and LineIndex.
Reimplemented from clang::format::BreakableToken.
Definition at line 417 of file BreakableToken.cpp.
References clang::format::BreakableToken::IndentLevel, clang::format::BreakableToken::InPPDirective, clang::format::WhitespaceManager::replaceWhitespaceInToken(), clang::format::BreakableToken::Tok, and clang::format::FormatToken::TokenText.
1.8.6