clang  8.0.0svn
Public Member Functions | Public Attributes | List of all members
clang::format::AnnotatedLine Class Reference

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

Collaboration diagram for clang::format::AnnotatedLine:
Collaboration graph
[legend]

Public Member Functions

 AnnotatedLine (const UnwrappedLine &Line)
 
 ~AnnotatedLine ()
 
template<typename... Ts>
bool startsWith (Ts... Tokens) const
 true if this line starts with the given tokens in order, ignoring comments. More...
 
template<typename... Ts>
bool endsWith (Ts... Tokens) const
 true if this line ends with the given tokens in reversed order, ignoring comments. More...
 
bool mightBeFunctionDefinition () const
 true if this line looks like a function definition instead of a function declaration. More...
 

Public Attributes

FormatTokenFirst
 
FormatTokenLast
 
SmallVector< AnnotatedLine *, 0 > Children
 
LineType Type
 
unsigned Level
 
size_t MatchingOpeningBlockLineIndex
 
size_t MatchingClosingBlockLineIndex
 
bool InPPDirective
 
bool MustBeDeclaration
 
bool MightBeFunctionDecl
 
bool IsMultiVariableDeclStmt
 
bool Affected
 True if this line should be formatted, i.e. More...
 
bool LeadingEmptyLinesAffected
 True if the leading empty lines of this line intersect with one of the input ranges. More...
 
bool ChildrenAffected
 True if one of this line's children intersects with an input range. More...
 
unsigned FirstStartColumn
 

Detailed Description

Definition at line 38 of file TokenAnnotator.h.

Constructor & Destructor Documentation

◆ AnnotatedLine()

clang::format::AnnotatedLine::AnnotatedLine ( const UnwrappedLine Line)
inline

Definition at line 40 of file TokenAnnotator.h.

◆ ~AnnotatedLine()

clang::format::AnnotatedLine::~AnnotatedLine ( )
inline

Definition at line 73 of file TokenAnnotator.h.

References Children.

Member Function Documentation

◆ endsWith()

template<typename... Ts>
bool clang::format::AnnotatedLine::endsWith ( Ts...  Tokens) const
inline

true if this line ends with the given tokens in reversed order, ignoring comments.

For example, given tokens [T1, T2, T3, ...], the function returns true if this line is like "... T3 T2 T1".

Definition at line 95 of file TokenAnnotator.h.

◆ mightBeFunctionDefinition()

bool clang::format::AnnotatedLine::mightBeFunctionDefinition ( ) const
inline

true if this line looks like a function definition instead of a function declaration.

Asserts MightBeFunctionDecl.

Definition at line 101 of file TokenAnnotator.h.

References clang::format::FormatToken::isOneOf(), Last, and MightBeFunctionDecl.

◆ startsWith()

template<typename... Ts>
bool clang::format::AnnotatedLine::startsWith ( Ts...  Tokens) const
inline

true if this line starts with the given tokens in order, ignoring comments.

Definition at line 87 of file TokenAnnotator.h.

Member Data Documentation

◆ Affected

bool clang::format::AnnotatedLine::Affected

True if this line should be formatted, i.e.

intersects directly or indirectly with one of the input ranges.

Definition at line 124 of file TokenAnnotator.h.

◆ Children

SmallVector<AnnotatedLine *, 0> clang::format::AnnotatedLine::Children

Definition at line 111 of file TokenAnnotator.h.

Referenced by ~AnnotatedLine().

◆ ChildrenAffected

bool clang::format::AnnotatedLine::ChildrenAffected

True if one of this line's children intersects with an input range.

Definition at line 131 of file TokenAnnotator.h.

◆ First

FormatToken* clang::format::AnnotatedLine::First

◆ FirstStartColumn

unsigned clang::format::AnnotatedLine::FirstStartColumn

Definition at line 133 of file TokenAnnotator.h.

◆ InPPDirective

bool clang::format::AnnotatedLine::InPPDirective

◆ IsMultiVariableDeclStmt

bool clang::format::AnnotatedLine::IsMultiVariableDeclStmt

Definition at line 120 of file TokenAnnotator.h.

◆ Last

FormatToken* clang::format::AnnotatedLine::Last

Definition at line 109 of file TokenAnnotator.h.

Referenced by mightBeFunctionDefinition().

◆ LeadingEmptyLinesAffected

bool clang::format::AnnotatedLine::LeadingEmptyLinesAffected

True if the leading empty lines of this line intersect with one of the input ranges.

Definition at line 128 of file TokenAnnotator.h.

◆ Level

unsigned clang::format::AnnotatedLine::Level

Definition at line 114 of file TokenAnnotator.h.

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

◆ MatchingClosingBlockLineIndex

size_t clang::format::AnnotatedLine::MatchingClosingBlockLineIndex

Definition at line 116 of file TokenAnnotator.h.

◆ MatchingOpeningBlockLineIndex

size_t clang::format::AnnotatedLine::MatchingOpeningBlockLineIndex

Definition at line 115 of file TokenAnnotator.h.

◆ MightBeFunctionDecl

bool clang::format::AnnotatedLine::MightBeFunctionDecl

Definition at line 119 of file TokenAnnotator.h.

Referenced by mightBeFunctionDefinition().

◆ MustBeDeclaration

bool clang::format::AnnotatedLine::MustBeDeclaration

Definition at line 118 of file TokenAnnotator.h.

◆ Type

LineType clang::format::AnnotatedLine::Type

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