clang 8.0.0

Classes | Namespaces | Functions | Variables
BreakableToken.h File Reference

Declares BreakableToken, BreakableStringLiteral, BreakableComment, BreakableBlockComment and BreakableLineCommentSection classes, that contain token type-specific logic to break long lines in tokens and reflow content between tokens. More...

`#include "Encoding.h"`
`#include "TokenAnnotator.h"`
`#include "WhitespaceManager.h"`
`#include "llvm/ADT/StringSet.h"`
`#include "llvm/Support/Regex.h"`
`#include <utility>`
Include dependency graph for BreakableToken.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
class | clang::format::BreakableStringLiteral
class | clang::format::BreakableComment
class | clang::format::BreakableBlockComment
class | clang::format::BreakableLineCommentSection

## Namespaces
| clang
| Dataflow Directional Tag Classes.
| clang::format

## Functions
bool | clang::format::switchesFormatting (const FormatToken &Token)
| Checks if `Token` switches formatting, like /* clang-format off. More...
virtual | clang::format::~BreakableToken ()
virtual unsigned | clang::format::getLineCount () const =0
| Returns the number of lines in this token in the original code. More...
virtual unsigned | clang::format::getRangeLength (unsigned LineIndex, unsigned Offset, StringRef::size_type Length, unsigned StartColumn) const =0
| Returns the number of columns required to format the text in the byte range [`Offset`, `Offset` `+` `Length`). More...
virtual unsigned | clang::format::getRemainingLength (unsigned LineIndex, unsigned Offset, unsigned StartColumn) const
| Returns the number of columns required to format the text following the byte `Offset` in the line `LineIndex`, including potentially unbreakable sequences of tokens following after the end of the token. More...
virtual unsigned | clang::format::getContentStartColumn (unsigned LineIndex, bool Break) const =0
| Returns the column at which content in line `LineIndex` starts, assuming no reflow. More...
virtual unsigned | clang::format::getContentIndent (unsigned LineIndex) const
| Returns additional content indent required for the second line after the content at line `LineIndex` is broken. More...
virtual Split | clang::format::getSplit (unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit, unsigned ContentStartColumn, llvm::Regex &CommentPragmasRegex) const =0
| Returns a range (offset, length) at which to break the line at `LineIndex`, if previously broken at `TailOffset`. More...
virtual void | clang::format::insertBreak (unsigned LineIndex, unsigned TailOffset, Split Split, unsigned ContentIndent, WhitespaceManager &Whitespaces) const =0
| Emits the previously retrieved `Split` via `Whitespaces`. More...
unsigned | clang::format::getLengthAfterCompression (unsigned RemainingTokenColumns, Split Split) const
| Returns the number of columns needed to format `RemainingTokenColumns`, assuming that Split is within the range measured by `RemainingTokenColumns`, and that the whitespace in Split is reduced to a single space. More...
virtual void | clang::format::compressWhitespace (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces) const =0
| Replaces the whitespace range described by `Split` with a single space. More...
virtual bool | clang::format::supportsReflow () const
| Returns whether the token supports reflowing text. More...
virtual Split | clang::format::getReflowSplit (unsigned LineIndex, llvm::Regex &CommentPragmasRegex) const
| Returns a whitespace range (offset, length) of the content at `LineIndex` such that the content of that line is reflown to the end of the previous one. More...
virtual void | clang::format::reflow (unsigned LineIndex, WhitespaceManager &Whitespaces) const
| Reflows the current line into the end of the previous one. More...
virtual bool | clang::format::introducesBreakBeforeToken () const
| Returns whether there will be a line break at the start of the token. More...
virtual void | clang::format::adaptStartOfLine (unsigned LineIndex, WhitespaceManager &Whitespaces) const
| Replaces the whitespace between `LineIndex-1` and `LineIndex`. More...
virtual Split | clang::format::getSplitAfterLastLine (unsigned TailOffset) const
| Returns a whitespace range (offset, length) of the content at the last line that needs to be reformatted after the last line has been reformatted. More...
void | clang::format::replaceWhitespaceAfterLastLine (unsigned TailOffset, Split SplitAfterLastLine, WhitespaceManager &Whitespaces) const
| Replaces the whitespace from `SplitAfterLastLine` on the last line after the last line has been formatted by performing a reformatting. More...
virtual void | clang::format::updateNextToken (LineState &State) const
| Updates the next token of `State` to the next token after this one. More...
| clang::format::BreakableToken (const FormatToken &Tok, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style)

## Variables
to be on a line of | clang::format::itself
| Base class for tokens / ranges of tokens that can allow breaking within the tokens - for example, to avoid whitespace beyond the column limit, or to reflow text. More...
to be on a line of there are analogous operations *that might be executed after the last line has been | clang::format::reformatted
to be on a line of there are analogous operations *that might be executed after the last line has been for finding a split after the last line that needs *to be | clang::format::reflown
to be on a line of there are analogous operations *that might be executed after the last line has been for finding a split after the last line that needs *to be * | clang::format::replaceWhitespaceAfterLastLine
const FormatToken & | clang::format::Tok
const bool | clang::format::InPPDirective
const encoding::Encoding | clang::format::Encoding
const FormatStyle & | clang::format::Style

## Detailed Description

Declares BreakableToken, BreakableStringLiteral, BreakableComment, BreakableBlockComment and BreakableLineCommentSection classes, that contain token type-specific logic to break long lines in tokens and reflow content between tokens.

Definition in file BreakableToken.h.