clang  16.0.0git
Public Member Functions | Public Attributes | List of all members
clang::format::AnnotatedLine Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/TokenAnnotator.h"

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

Public Member Functions

 AnnotatedLine (const UnwrappedLine &Line)
 
 ~AnnotatedLine ()
 
bool isComment () const
 
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...
 
bool startsWithNamespace () const
 true if this line starts a namespace definition. More...
 

Public Attributes

FormatTokenFirst
 
FormatTokenLast
 
SmallVector< AnnotatedLine *, 0 > Children
 
LineType Type
 
unsigned Level
 
size_t MatchingOpeningBlockLineIndex
 
size_t MatchingClosingBlockLineIndex
 
bool InPPDirective
 
bool InMacroBody
 
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...
 
bool IsContinuation
 True if this line should be indented by ContinuationIndent in addition to the normal indention level. More...
 
unsigned FirstStartColumn
 

Detailed Description

Definition at line 37 of file TokenAnnotator.h.

Constructor & Destructor Documentation

◆ AnnotatedLine()

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

Definition at line 39 of file TokenAnnotator.h.

◆ ~AnnotatedLine()

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

Definition at line 70 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.

Referenced by mightBeFunctionDefinition().

◆ isComment()

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

◆ 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 endsWith(), 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.

Referenced by startsWithNamespace().

◆ startsWithNamespace()

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

true if this line starts a namespace definition.

Definition at line 117 of file TokenAnnotator.h.

References startsWith().

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 140 of file TokenAnnotator.h.

◆ Children

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

Definition at line 126 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 147 of file TokenAnnotator.h.

◆ First

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

◆ FirstStartColumn

unsigned clang::format::AnnotatedLine::FirstStartColumn

Definition at line 153 of file TokenAnnotator.h.

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

◆ InMacroBody

bool clang::format::AnnotatedLine::InMacroBody

Definition at line 133 of file TokenAnnotator.h.

◆ InPPDirective

bool clang::format::AnnotatedLine::InPPDirective

Definition at line 132 of file TokenAnnotator.h.

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

◆ IsContinuation

bool clang::format::AnnotatedLine::IsContinuation

True if this line should be indented by ContinuationIndent in addition to the normal indention level.

Definition at line 151 of file TokenAnnotator.h.

◆ IsMultiVariableDeclStmt

bool clang::format::AnnotatedLine::IsMultiVariableDeclStmt

Definition at line 136 of file TokenAnnotator.h.

◆ Last

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

Definition at line 124 of file TokenAnnotator.h.

◆ 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 144 of file TokenAnnotator.h.

◆ Level

unsigned clang::format::AnnotatedLine::Level

◆ MatchingClosingBlockLineIndex

size_t clang::format::AnnotatedLine::MatchingClosingBlockLineIndex

Definition at line 131 of file TokenAnnotator.h.

◆ MatchingOpeningBlockLineIndex

size_t clang::format::AnnotatedLine::MatchingOpeningBlockLineIndex

Definition at line 130 of file TokenAnnotator.h.

◆ MightBeFunctionDecl

bool clang::format::AnnotatedLine::MightBeFunctionDecl

Definition at line 135 of file TokenAnnotator.h.

Referenced by mightBeFunctionDefinition().

◆ MustBeDeclaration

bool clang::format::AnnotatedLine::MustBeDeclaration

Definition at line 134 of file TokenAnnotator.h.

◆ Type

LineType clang::format::AnnotatedLine::Type

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