clang  5.0.0
Public Member Functions | List of all members
clang::format::BreakableStringLiteral Class Reference

#include "/usr/local/google/work/llvm-www-releases/5.0.0/docsbuild/llvm.src/tools/clang/lib/Format/BreakableToken.h"

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

Public Member Functions

 BreakableStringLiteral (const FormatToken &Tok, unsigned StartColumn, StringRef Prefix, StringRef Postfix, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style)
 Creates a breakable token for a single line string literal. More...
 
Split getSplit (unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit, llvm::Regex &CommentPragmasRegex) 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 compressWhitespace (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces) override
 Replaces the whitespace range described by Split with a single space. More...
 
- Public Member Functions inherited from clang::format::BreakableSingleLineToken
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 TailOffset with length Length. More...
 
- Public Member Functions inherited from clang::format::BreakableToken
virtual ~BreakableToken ()
 
unsigned getLineLengthAfterCompression (unsigned RemainingTokenColumns, Split Split) const
 Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset after the whitespace range Split has been compressed into a single space. More...
 
virtual Split getSplitBefore (unsigned LineIndex, unsigned PreviousEndColumn, unsigned ColumnLimit, llvm::Regex &CommentPragmasRegex) const
 Returns a whitespace range (offset, length) of the content at LineIndex such that the content preceding this range needs to be reformatted before any breaks are made to this line. More...
 
virtual unsigned getLineLengthAfterSplitBefore (unsigned LineIndex, unsigned TailOffset, unsigned PreviousEndColumn, unsigned ColumnLimit, Split SplitBefore) const
 Returns the number of columns required to format the piece of line at LineIndex after the content preceding the whitespace range specified SplitBefore has been reformatted, but before any breaks are made to this line. More...
 
virtual void replaceWhitespaceBefore (unsigned LineIndex, unsigned PreviousEndColumn, unsigned ColumnLimit, Split SplitBefore, WhitespaceManager &Whitespaces)
 Replaces the whitespace between LineIndex-1 and LineIndex. More...
 
virtual void updateNextToken (LineState &State) const
 Updates the next token of State to the next token after this one. More...
 

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::BreakableSingleLineToken
 BreakableSingleLineToken (const FormatToken &Tok, unsigned StartColumn, StringRef Prefix, StringRef Postfix, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style)
 
- Protected Member Functions inherited from clang::format::BreakableToken
 BreakableToken (const FormatToken &Tok, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style)
 
- Protected Attributes inherited from clang::format::BreakableSingleLineToken
unsigned StartColumn
 
StringRef Prefix
 
StringRef Postfix
 
StringRef Line
 
- Protected Attributes inherited from clang::format::BreakableToken
const FormatTokenTok
 
const bool InPPDirective
 
const encoding::Encoding Encoding
 
const FormatStyleStyle
 

Detailed Description

Definition at line 189 of file BreakableToken.h.

Constructor & Destructor Documentation

clang::format::BreakableStringLiteral::BreakableStringLiteral ( const FormatToken Tok,
unsigned  StartColumn,
StringRef  Prefix,
StringRef  Postfix,
bool  InPPDirective,
encoding::Encoding  Encoding,
const FormatStyle Style 
)

Creates a breakable token for a single line string literal.

StartColumn specifies the column in which the token will start after formatting.

Definition at line 203 of file BreakableToken.cpp.

Member Function Documentation

void clang::format::BreakableStringLiteral::compressWhitespace ( unsigned  LineIndex,
unsigned  TailOffset,
Split  Split,
WhitespaceManager Whitespaces 
)
inlineoverridevirtual

Replaces the whitespace range described by Split with a single space.

Implements clang::format::BreakableToken.

Definition at line 204 of file BreakableToken.h.

BreakableToken::Split clang::format::BreakableStringLiteral::getSplit ( unsigned  LineIndex,
unsigned  TailOffset,
unsigned  ColumnLimit,
llvm::Regex &  CommentPragmasRegex 
) const
overridevirtual
void clang::format::BreakableStringLiteral::insertBreak ( unsigned  LineIndex,
unsigned  TailOffset,
Split  Split,
WhitespaceManager Whitespaces 
)
overridevirtual

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