clang  6.0.0svn
Classes | Public Member Functions | Public Attributes | List of all members
clang::format::WhitespaceManager::Change Struct Reference

Represents a change before a token, a break inside a token, or the layout of an unchanged token (or whitespace within). More...

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

Collaboration diagram for clang::format::WhitespaceManager::Change:
Collaboration graph
[legend]

Classes

class  IsBeforeInFile
 Functor to sort changes in original source order. More...
 

Public Member Functions

 Change (const FormatToken &Tok, bool CreateReplacement, SourceRange OriginalWhitespaceRange, int Spaces, unsigned StartOfTokenColumn, unsigned NewlinesBefore, StringRef PreviousLinePostfix, StringRef CurrentLinePrefix, bool ContinuesPPDirective, bool IsInsideToken)
 Creates a Change. More...
 
std::pair< unsigned, unsigned > indentAndNestingLevel () const
 

Public Attributes

const FormatTokenTok
 
bool CreateReplacement
 
SourceRange OriginalWhitespaceRange
 
unsigned StartOfTokenColumn
 
unsigned NewlinesBefore
 
std::string PreviousLinePostfix
 
std::string CurrentLinePrefix
 
bool ContinuesPPDirective
 
int Spaces
 
bool IsInsideToken
 
bool IsTrailingComment
 
unsigned TokenLength
 
unsigned PreviousEndOfTokenColumn
 
unsigned EscapedNewlineColumn
 
const ChangeStartOfBlockComment
 
int IndentationOffset
 

Detailed Description

Represents a change before a token, a break inside a token, or the layout of an unchanged token (or whitespace within).

Definition at line 87 of file WhitespaceManager.h.

Constructor & Destructor Documentation

◆ Change()

clang::format::WhitespaceManager::Change::Change ( const FormatToken Tok,
bool  CreateReplacement,
SourceRange  OriginalWhitespaceRange,
int  Spaces,
unsigned  StartOfTokenColumn,
unsigned  NewlinesBefore,
StringRef  PreviousLinePostfix,
StringRef  CurrentLinePrefix,
bool  ContinuesPPDirective,
bool  IsInsideToken 
)

Creates a Change.

The generated Change will replace the characters at OriginalWhitespaceRange with a concatenation of PreviousLinePostfix, NewlinesBefore line breaks, Spaces spaces and CurrentLinePrefix.

StartOfTokenColumn and InPPDirective will be used to lay out trailing comments and escaped newlines.

Definition at line 28 of file WhitespaceManager.cpp.

Referenced by clang::format::WhitespaceManager::addUntouchableToken(), clang::format::WhitespaceManager::Change::IsBeforeInFile::IsBeforeInFile(), clang::format::WhitespaceManager::replaceWhitespace(), and clang::format::WhitespaceManager::replaceWhitespaceInToken().

Member Function Documentation

◆ indentAndNestingLevel()

std::pair<unsigned, unsigned> clang::format::WhitespaceManager::Change::indentAndNestingLevel ( ) const
inline

Member Data Documentation

◆ ContinuesPPDirective

bool clang::format::WhitespaceManager::Change::ContinuesPPDirective

◆ CreateReplacement

bool clang::format::WhitespaceManager::Change::CreateReplacement

◆ CurrentLinePrefix

std::string clang::format::WhitespaceManager::Change::CurrentLinePrefix

◆ EscapedNewlineColumn

unsigned clang::format::WhitespaceManager::Change::EscapedNewlineColumn

Definition at line 146 of file WhitespaceManager.h.

Referenced by indentAndNestingLevel().

◆ IndentationOffset

int clang::format::WhitespaceManager::Change::IndentationOffset

◆ IsInsideToken

bool clang::format::WhitespaceManager::Change::IsInsideToken

◆ IsTrailingComment

bool clang::format::WhitespaceManager::Change::IsTrailingComment

◆ NewlinesBefore

unsigned clang::format::WhitespaceManager::Change::NewlinesBefore

◆ OriginalWhitespaceRange

SourceRange clang::format::WhitespaceManager::Change::OriginalWhitespaceRange

◆ PreviousEndOfTokenColumn

unsigned clang::format::WhitespaceManager::Change::PreviousEndOfTokenColumn

Definition at line 145 of file WhitespaceManager.h.

Referenced by indentAndNestingLevel().

◆ PreviousLinePostfix

std::string clang::format::WhitespaceManager::Change::PreviousLinePostfix

◆ Spaces

int clang::format::WhitespaceManager::Change::Spaces

Definition at line 134 of file WhitespaceManager.h.

◆ StartOfBlockComment

const Change* clang::format::WhitespaceManager::Change::StartOfBlockComment

◆ StartOfTokenColumn

unsigned clang::format::WhitespaceManager::Change::StartOfTokenColumn

◆ Tok

const FormatToken* clang::format::WhitespaceManager::Change::Tok

◆ TokenLength

unsigned clang::format::WhitespaceManager::Change::TokenLength

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