Struct clang::File
[−]
[src]
pub struct File<'tu> { // some fields omitted }
A source file.
Methods
impl<'tu> File<'tu>
[src]
fn get_id(&self) -> (u64, u64, u64)
Returns a unique identifier for this file.
fn get_includes(&self) -> Vec<Entity<'tu>>
Returns the inclusion directives in this file.
fn get_location(&self, line: u32, column: u32) -> SourceLocation<'tu>
Returns the source location at the supplied line and column in this file.
Panics
line
orcolumn
is0
fn get_module(&self) -> Option<Module<'tu>>
Returns the module containing this file, if any.
fn get_offset_location(&self, offset: u32) -> SourceLocation<'tu>
Returns the source location at the supplied character offset in this file.
fn get_path(&self) -> PathBuf
Returns the absolute path to this file.
fn get_references(&self, entity: Entity<'tu>) -> Vec<Entity<'tu>>
Returns the references to the supplied entity in this file.
fn get_skipped_ranges(&self) -> Vec<SourceRange<'tu>>
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.
fn get_time(&self) -> time_t
Returns the last modification time for this file.
fn is_include_guarded(&self) -> bool
Returns whether this file is guarded against multiple inclusions.
fn visit_includes<F: FnMut(Entity<'tu>, SourceRange<'tu>) -> bool>(&self, f: F) -> bool
Visits the inclusion directives in this file and returns whether visitation was ended by the
callback returning false
.
fn visit_references<F: FnMut(Entity<'tu>, SourceRange<'tu>) -> bool>(&self, entity: Entity<'tu>, f: F) -> bool
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]
fn clone(&self) -> File<'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 File<'tu>
[src]
impl<'tu> Eq for File<'tu>
[src]
impl<'tu> PartialEq for File<'tu>
[src]
fn eq(&self, other: &File<'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 File<'tu>
[src]
impl<'tu> Hash for File<'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.