clang API Documentation

Public Member Functions | Static Public Member Functions
clang::CharSourceRange Class Reference

Represents a character-granular source range. More...

#include <SourceLocation.h>

List of all members.

Public Member Functions

 CharSourceRange ()
 CharSourceRange (SourceRange R, bool ITR)
bool isTokenRange () const
 Return true if the end of this range specifies the start of the last token. Return false if the end of this range specifies the last character in the range.
bool isCharRange () const
SourceLocation getBegin () const
SourceLocation getEnd () const
const SourceRangegetAsRange () const
void setBegin (SourceLocation b)
void setEnd (SourceLocation e)
bool isValid () const
bool isInvalid () const

Static Public Member Functions

static CharSourceRange getTokenRange (SourceRange R)
static CharSourceRange getCharRange (SourceRange R)
static CharSourceRange getTokenRange (SourceLocation B, SourceLocation E)
static CharSourceRange getCharRange (SourceLocation B, SourceLocation E)

Detailed Description

Represents a character-granular source range.

The underlying SourceRange can either specify the starting/ending character of the range, or it can specify the start of the range and the start of the last token of the range (a "token range"). In the token range case, the size of the last token must be measured to determine the actual end of the range.

Definition at line 225 of file SourceLocation.h.


Constructor & Destructor Documentation

Definition at line 229 of file SourceLocation.h.

Referenced by getCharRange(), and getTokenRange().

Definition at line 230 of file SourceLocation.h.


Member Function Documentation

Definition at line 255 of file SourceLocation.h.

Definition at line 243 of file SourceLocation.h.

References getCharRange().

Definition at line 240 of file SourceLocation.h.

References getTokenRange().

Definition at line 251 of file SourceLocation.h.

Referenced by clang::Lexer::makeFileCharRange().

Return true if the end of this range specifies the start of the last token. Return false if the end of this range specifies the last character in the range.

Definition at line 250 of file SourceLocation.h.

Referenced by clang::markup::EmitRange(), clang::tooling::getRangeSize(), clang::Rewriter::getRangeSize(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), clang::edit::Commit::insertWrap(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), and mergeFixits().

Definition at line 257 of file SourceLocation.h.

References clang::SourceRange::setBegin().

Referenced by clang::Lexer::makeFileCharRange().

Definition at line 258 of file SourceLocation.h.

References clang::SourceRange::setEnd().

Referenced by clang::Lexer::makeFileCharRange().


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