class CharSourceRange

Declaration

class CharSourceRange { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/Basic/SourceLocation.h:253

Member Variables

private clang::SourceRange Range
private bool IsTokenRange = false

Method Overview

Methods

CharSourceRange()

Declared at: clang/include/clang/Basic/SourceLocation.h:258

CharSourceRange(clang::SourceRange R, bool ITR)

Declared at: clang/include/clang/Basic/SourceLocation.h:259

Parameters

clang::SourceRange R
bool ITR

clang::SourceRange getAsRange() const

Declared at: clang/include/clang/Basic/SourceLocation.h:285

clang::SourceLocation getBegin() const

Declared at: clang/include/clang/Basic/SourceLocation.h:283

static clang::CharSourceRange getCharRange(
    clang::SourceRange R)

Declared at: clang/include/clang/Basic/SourceLocation.h:265

Parameters

clang::SourceRange R

static clang::CharSourceRange getCharRange(
    clang::SourceLocation B,
    clang::SourceLocation E)

Declared at: clang/include/clang/Basic/SourceLocation.h:273

Parameters

clang::SourceLocation B
clang::SourceLocation E

clang::SourceLocation getEnd() const

Declared at: clang/include/clang/Basic/SourceLocation.h:284

static clang::CharSourceRange getTokenRange(
    clang::SourceRange R)

Declared at: clang/include/clang/Basic/SourceLocation.h:261

Parameters

clang::SourceRange R

static clang::CharSourceRange getTokenRange(
    clang::SourceLocation B,
    clang::SourceLocation E)

Declared at: clang/include/clang/Basic/SourceLocation.h:269

Parameters

clang::SourceLocation B
clang::SourceLocation E

bool isCharRange() const

Declared at: clang/include/clang/Basic/SourceLocation.h:281

bool isInvalid() const

Declared at: clang/include/clang/Basic/SourceLocation.h:292

bool isTokenRange() const

Description

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.

Declared at: clang/include/clang/Basic/SourceLocation.h:280

bool isValid() const

Declared at: clang/include/clang/Basic/SourceLocation.h:291

void setBegin(clang::SourceLocation b)

Declared at: clang/include/clang/Basic/SourceLocation.h:287

Parameters

clang::SourceLocation b

void setEnd(clang::SourceLocation e)

Declared at: clang/include/clang/Basic/SourceLocation.h:288

Parameters

clang::SourceLocation e

void setTokenRange(bool TR)

Declared at: clang/include/clang/Basic/SourceLocation.h:289

Parameters

bool TR