struct WhitespaceManager::Change

Declaration

struct WhitespaceManager::Change { /* full declaration omitted */ };

Description

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

Declared at: clang/lib/Format/WhitespaceManager.h:94

Member Variables

public const clang::format::FormatToken* Tok
public bool CreateReplacement
public clang::SourceRange OriginalWhitespaceRange
public unsigned int StartOfTokenColumn
public unsigned int NewlinesBefore
public std::string PreviousLinePostfix
public std::string CurrentLinePrefix
public bool IsAligned
public bool ContinuesPPDirective
public int Spaces
public bool IsInsideToken
public bool IsTrailingComment
public unsigned int TokenLength
public unsigned int PreviousEndOfTokenColumn
public unsigned int EscapedNewlineColumn
public const clang::format::WhitespaceManager::Change* StartOfBlockComment
public int IndentationOffset
public int ConditionalsLevel

Method Overview

  • public Change(const clang::format::FormatToken & Tok, bool CreateReplacement, clang::SourceRange OriginalWhitespaceRange, int Spaces, unsigned int StartOfTokenColumn, unsigned int NewlinesBefore, llvm::StringRef PreviousLinePostfix, llvm::StringRef CurrentLinePrefix, bool IsAligned, bool ContinuesPPDirective, bool IsInsideToken)
  • public std::tuple<unsigned int, unsigned int, unsigned int> indentAndNestingLevel() const

Methods

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

Description

Creates a \c Change. The generated \c Change will replace the characters at\p OriginalWhitespaceRange with a concatenation of\p PreviousLinePostfix, \p NewlinesBefore line breaks, \p Spaces spaces and \p CurrentLinePrefix. \p StartOfTokenColumn and \p InPPDirective will be used to lay out trailing comments and escaped newlines.

Declared at: clang/lib/Format/WhitespaceManager.h:114

Parameters

const clang::format::FormatToken& Tok
bool CreateReplacement
clang::SourceRange OriginalWhitespaceRange
int Spaces
unsigned int StartOfTokenColumn
unsigned int NewlinesBefore
llvm::StringRef PreviousLinePostfix
llvm::StringRef CurrentLinePrefix
bool IsAligned
bool ContinuesPPDirective
bool IsInsideToken

std::tuple<unsigned int,
           unsigned int,
           unsigned int>
indentAndNestingLevel() const

Declared at: clang/lib/Format/WhitespaceManager.h:174