Loc

A source code location

Used for error messages, __FILE__ and __LINE__ tokens, __traits(getLocation, XXX), debug info etc.

Members

Functions

charnum
uint charnum()
uint charnum(uint num)

utf8 code unit index relative to start of line, starting from 1

equals
bool equals(const(Loc) loc)

Checks for equivalence by comparing the filename contents (not the pointer) and character location.

filename
const(char)* filename()
filename
void filename(const(char)* name)

Set file name for this location

isValid
bool isValid()
linnum
uint linnum()
uint linnum(uint num)

line number, starting from 1

opEquals
bool opEquals(const(Loc) loc)
toHash
size_t toHash()

opEquals() / toHash() for AA key usage

Static functions

set
void set(bool showColumns, MessageStyle messageStyle)

Configure how display is done

Static variables

initial
Loc initial;

use for default initialization of const ref Loc's

Variables

fileOffset
uint fileOffset;

utf8 code unit index relative to start of file, starting from 0

Meta