SourceLocation

A SourceLocation represents a particular location within a source file.

Members

Functions

presumed
auto presumed()

Retrieve the file, line, column, and offset represented by the given source location, as specified in a # line directive.

toString
void toString(Writer w, FormatSpec!Char fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin CX
Undocumented in source.

Properties

column
uint column [@property getter]

Get the column represented by this source location.

expansion
Location expansion [@property getter]

Retrieve the file, line, column, and offset represented by the given source location.

file
File file [@property getter]

Get the file represented by this source location. TODO implement with a cache, this is inefficient.

isFromMainFile
bool isFromMainFile [@property getter]

Returns if the given source location is in the main file of the corresponding translation unit.

line
uint line [@property getter]

Get the line represented by this source location.

offset
uint offset [@property getter]

Get the file offset represented by this source location.

path
string path [@property getter]

The path the SourceLocation point to.

spelling
Location spelling [@property getter]

Retrieve the file, line, column, and offset represented by the given source location.

Static functions

empty
SourceLocation empty()

Retrieve a NULL (invalid) source location.

fromOffset
SourceLocation fromOffset(TranslationUnit tu, File file, uint offset)

Retrieves the source location associated with a given character offset in a particular translation unit. TODO consider moving to TranslationUnit instead

fromPosition
Nullable!SourceLocation fromPosition(TranslationUnit tu, File file, uint line, uint offset)

Retrieves the source location associated with a given file/line/column in a particular translation unit. TODO consider moving to TranslationUnit instead

Structs

Location
struct Location
Undocumented in source.
Location2
struct Location2
Undocumented in source.

Mixed In Members

From mixin CX

cx
CType cx;
Undocumented in source.
dispose
void dispose()

Trusted: on the assumption that dispose as implemented by the LLVM community is good _enough_. Any bugs should by now have been found.

isValid
bool isValid [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta