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

#include <TokenAnnotator.h>

Collaboration diagram for clang::format::AnnotatedLine:
[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
 
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 a one of this line's children intersects with an input range. More...
 

Detailed Description

Definition at line 39 of file TokenAnnotator.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

References clang::format::FormatToken::endsSequence(), Last, and Tokens.

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

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

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

References First, clang::format::FormatToken::startsSequence(), and Tokens.

Referenced by clang::format::TokenAnnotator::annotate(), and clang::format::UnwrappedLineFormatter::format().

Member Data Documentation

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

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

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

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

Definition at line 127 of file TokenAnnotator.h.

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

FormatToken* clang::format::AnnotatedLine::First
bool clang::format::AnnotatedLine::InPPDirective
bool clang::format::AnnotatedLine::IsMultiVariableDeclStmt

Definition at line 116 of file TokenAnnotator.h.

FormatToken* clang::format::AnnotatedLine::Last
bool clang::format::AnnotatedLine::LeadingEmptyLinesAffected

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

Definition at line 124 of file TokenAnnotator.h.

Referenced by clang::format::AffectedRangeManager::computeAffectedLines(), and clang::format::UnwrappedLineFormatter::format().

unsigned clang::format::AnnotatedLine::Level
bool clang::format::AnnotatedLine::MightBeFunctionDecl
bool clang::format::AnnotatedLine::MustBeDeclaration

Definition at line 114 of file TokenAnnotator.h.

LineType clang::format::AnnotatedLine::Type

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