[][src]Struct clang::source::File

pub struct File<'tu> { /* fields omitted */ }

A source file.

Implementations

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

pub fn get_path(&self) -> PathBuf[src]

Returns the absolute path to this file.

pub fn get_time(&self) -> time_t[src]

Returns the last modification time for this file.

pub fn get_id(&self) -> (u64, u64, u64)[src]

Returns a unique identifier for this file.

pub fn get_contents(&self) -> Option<String>[src]

Returns the contents of this file, if this file has been loaded.

pub fn get_module(&self) -> Option<Module<'tu>>[src]

Returns the module containing this file, if any.

pub fn get_skipped_ranges(&self) -> Vec<SourceRange<'tu>>[src]

Returns the source ranges in this file that were skipped by the preprocessor.

This will always return an empty Vec if the translation unit that contains this file was not constructed with a detailed preprocessing record.

pub fn is_include_guarded(&self) -> bool[src]

Returns whether this file is guarded against multiple inclusions.

pub fn get_location(&self, line: u32, column: u32) -> SourceLocation<'tu>[src]

Returns the source location at the supplied line and column in this file.

Panics

  • line or column is 0

pub fn get_offset_location(&self, offset: u32) -> SourceLocation<'tu>[src]

Returns the source location at the supplied character offset in this file.

pub fn get_includes(&self) -> Vec<Entity<'tu>>[src]

Returns the inclusion directives in this file.

pub fn get_references(&self, entity: Entity<'tu>) -> Vec<Entity<'tu>>[src]

Returns the references to the supplied entity in this file.

pub fn visit_includes<F: FnMut(Entity<'tu>, SourceRange<'tu>) -> bool>(
    &self,
    f: F
) -> bool
[src]

Visits the inclusion directives in this file and returns whether visitation was ended by the callback returning false.

pub fn visit_references<F: FnMut(Entity<'tu>, SourceRange<'tu>) -> bool>(
    &self,
    entity: Entity<'tu>,
    f: F
) -> bool
[src]

Visits the references to the supplied entity in this file and returns whether visitation was ended by the callback returning false.

Trait Implementations

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

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

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

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

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

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

Auto Trait Implementations

impl<'tu> RefUnwindSafe for File<'tu>

impl<'tu> !Send for File<'tu>

impl<'tu> !Sync for File<'tu>

impl<'tu> Unpin for File<'tu>

impl<'tu> UnwindSafe for File<'tu>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.