Struct clang::SourceLocation [] [src]

pub struct SourceLocation<'tu> {
    // some fields omitted
}

A location in a source file.

Methods

impl<'tu> SourceLocation<'tu>
[src]

fn get_entity(&self) -> Option<Entity<'tu>>

Returns the AST entity at this source location, if any.

fn get_expansion_location(&self) -> Location<'tu>

Returns the file, line, column and character offset of this source location.

If this source location is inside a macro expansion, the location of the macro expansion is returned instead.

fn get_file_location(&self) -> Location<'tu>

Returns the file, line, column and character offset of this source location.

If this source location is inside a macro expansion, the location of the macro expansion is returned instead unless this source location is inside a macro argument. In that case, the location of the macro argument is returned.

fn get_presumed_location(&self) -> (String, u32, u32)

Returns the file path, line, and column of this source location taking line directives into account.

fn get_spelling_location(&self) -> Location<'tu>

Returns the file, line, column and character offset of this source location.

fn is_in_main_file(&self) -> bool

Returns whether this source location is in the main file of its translation unit.

fn is_in_system_header(&self) -> bool

Returns whether this source location is in a system header.

Trait Implementations

impl<'tu> Clone for SourceLocation<'tu>
[src]

fn clone(&self) -> SourceLocation<'tu>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<'tu> Copy for SourceLocation<'tu>
[src]

impl<'tu> Eq for SourceLocation<'tu>
[src]

impl<'tu> PartialEq for SourceLocation<'tu>
[src]

fn eq(&self, other: &SourceLocation<'tu>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<'tu> Debug for SourceLocation<'tu>
[src]

fn fmt(&self, formatter: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<'tu> Hash for SourceLocation<'tu>
[src]

fn hash<H: Hasher>(&self, hasher: &mut H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.