clang 8.0.0

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::format::BreakableComment Class Referenceabstract

`#include "/work/www-prereleases/8.0.0/rc2/builddocs/llvm.src/tools/clang/lib/Format/BreakableToken.h"`

Inheritance diagram for clang::format::BreakableComment:
[legend]
Collaboration diagram for clang::format::BreakableComment:
[legend]

## Public Member Functions
bool | supportsReflow () const override
unsigned | getLineCount () const override
Split | getSplit (unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit, unsigned ContentStartColumn, llvm::Regex &CommentPragmasRegex) const override
void | compressWhitespace (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces) const override

## Protected Member Functions
| BreakableComment (const FormatToken &Token, unsigned StartColumn, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style)
| Creates a breakable token for a comment. More...
const FormatToken & | tokenAt (unsigned LineIndex) const
virtual bool | mayReflow (unsigned LineIndex, llvm::Regex &CommentPragmasRegex) const =0

## Protected Attributes
SmallVector< StringRef, 16 > | Lines
SmallVector< StringRef, 16 > | Content
SmallVector< FormatToken *, 16 > | Tokens
SmallVector< int, 16 > | ContentColumn
unsigned | StartColumn
StringRef | ReflowPrefix = " "

## Detailed Description

Definition at line 291 of file BreakableToken.h.

## Constructor & Destructor Documentation

## ◆ BreakableComment()

clang::format::BreakableComment::BreakableComment | ( | const FormatToken & | Token,
|  | unsigned | StartColumn,
|  | bool | InPPDirective,
|  | encoding::Encoding | Encoding,
|  | const FormatStyle & | Style
| ) |  |
| protected

Creates a breakable token for a comment.

`StartColumn` specifies the column in which the comment will start after formatting.

Definition at line 261 of file BreakableToken.cpp.

## Member Function Documentation

## ◆ compressWhitespace()

void clang::format::BreakableComment::compressWhitespace | ( | unsigned | LineIndex,
|  | unsigned | TailOffset,
|  | Split | Split,
|  | WhitespaceManager & | Whitespaces
| ) |  | const
| override

Definition at line 282 of file BreakableToken.cpp.

## ◆ getLineCount()

unsigned clang::format::BreakableComment::getLineCount | ( |  | ) | const
| override

Definition at line 268 of file BreakableToken.cpp.

References Lines.

## ◆ getSplit()

BreakableToken::Split clang::format::BreakableComment::getSplit | ( | unsigned | LineIndex,
|  | unsigned | TailOffset,
|  | unsigned | ColumnLimit,
|  | unsigned | ContentStartColumn,
|  | llvm::Regex & | CommentPragmasRegex
| ) |  | const
| override

Definition at line 271 of file BreakableToken.cpp.

References Content, clang::format::Encoding, clang::format::getCommentSplit(), Split, clang::format::Style, and clang::format::FormatStyle::TabWidth.

## ◆ mayReflow()

virtual bool clang::format::BreakableComment::mayReflow | ( | unsigned | LineIndex,
|  | llvm::Regex & | CommentPragmasRegex
| ) |  | const
| protected pure virtual

Implemented in clang::format::BreakableLineCommentSection, and clang::format::BreakableBlockComment.

## ◆ supportsReflow()

bool clang::format::BreakableComment::supportsReflow | ( |  | ) | const
| inline override

Definition at line 302 of file BreakableToken.h.

References clang::format::compressWhitespace(), clang::format::getLineCount(), clang::format::getSplit(), and Split.

## ◆ tokenAt()

const FormatToken & clang::format::BreakableComment::tokenAt | ( | unsigned | LineIndex | ) | const
| protected

Definition at line 298 of file BreakableToken.cpp.

References clang::format::Tok, and Tokens.

Referenced by clang::format::BreakableBlockComment::mayReflow(), and clang::format::BreakableLineCommentSection::mayReflow().

## Member Data Documentation

## ◆ Content

SmallVector<StringRef, 16> clang::format::BreakableComment::Content
| protected

Definition at line 329 of file BreakableToken.h.

Referenced by clang::format::BreakableBlockComment::BreakableBlockComment(), clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), clang::format::BreakableBlockComment::getContentIndent(), clang::format::BreakableBlockComment::getRangeLength(), clang::format::BreakableLineCommentSection::getRangeLength(), clang::format::BreakableBlockComment::getReflowSplit(), clang::format::BreakableLineCommentSection::getReflowSplit(), getSplit(), clang::format::BreakableBlockComment::getSplitAfterLastLine(), clang::format::BreakableBlockComment::mayReflow(), and clang::format::BreakableLineCommentSection::mayReflow().

## ◆ ContentColumn

SmallVector<int, 16> clang::format::BreakableComment::ContentColumn
| protected

Definition at line 346 of file BreakableToken.h.

Referenced by clang::format::BreakableBlockComment::BreakableBlockComment(), clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), clang::format::BreakableBlockComment::getContentStartColumn(), and clang::format::BreakableLineCommentSection::getContentStartColumn().

## ◆ Lines

SmallVector<StringRef, 16> clang::format::BreakableComment::Lines
| protected

Definition at line 324 of file BreakableToken.h.

Referenced by clang::format::BreakableBlockComment::BreakableBlockComment(), clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), getLineCount(), clang::format::BreakableBlockComment::getRangeLength(), clang::format::BreakableBlockComment::introducesBreakBeforeToken(), clang::format::BreakableBlockComment::mayReflow(), and clang::format::BreakableLineCommentSection::mayReflow().

## ◆ ReflowPrefix

StringRef clang::format::BreakableComment::ReflowPrefix = " "
| protected

Definition at line 359 of file BreakableToken.h.

## ◆ StartColumn

unsigned clang::format::BreakableComment::StartColumn
| protected

Definition at line 349 of file BreakableToken.h.

Referenced by clang::format::BreakableBlockComment::BreakableBlockComment().

## ◆ Tokens

SmallVector<FormatToken *, 16> clang::format::BreakableComment::Tokens
| protected

Definition at line 334 of file BreakableToken.h.

Referenced by clang::format::BreakableBlockComment::BreakableBlockComment(), clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), and tokenAt().

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

- lib/Format/BreakableToken.h
- lib/Format/BreakableToken.cpp