lestes::std::file_info Class Reference

Source file information. More...

#include <file_info.hh>

Inheritance diagram for lestes::std::file_info:

lestes::std::object lestes::std::mem::keystone List of all members.

Public Types

typedef lstring name_type
 Type of file name.

Public Member Functions

name_type name_get (void) const
 Returns file name.
ptr< source_locationorigin_get (void) const
 Returns inclusion origin.
bool equals (const ptr< file_info > &rhs) const
 Tests equality.

Static Public Member Functions

static ptr< file_infocreate (const name_type &a_name, const ptr< source_location > &a_origin)
 Returns file info initialized with file name and origin.

Protected Member Functions

 file_info (const lstring &a_name, const ptr< source_location > &a_origin)
 Creates the object, initializes with file name and origin.
void gc_mark ()
 Marking routine.

Private Member Functions

 file_info (const file_info &)
 Hides copy constructor.
file_infooperator= (const file_info &)
 Hides assingment operator.

Private Attributes

lstring name
 Name of the file.
srp< source_locationorigin
 Origin of inclusion.

Detailed Description

Source file information.

Represents information about file inside the inclusion chain. The first source has NULL origin.

Definition at line 50 of file file_info.hh.


Member Typedef Documentation

typedef lstring lestes::std::file_info::name_type

Type of file name.

Definition at line 53 of file file_info.hh.


Constructor & Destructor Documentation

lestes::std::file_info::file_info ( const lstring a_name,
const ptr< source_location > &  a_origin 
) [protected]

Creates the object, initializes with file name and origin.

Referenced by create().

lestes::std::file_info::file_info ( const file_info  )  [private]

Hides copy constructor.


Member Function Documentation

file_info::name_type lestes::std::file_info::name_get ( void   )  const

Returns file name.

Returns name of the file.

Returns:
The name of the file.

Definition at line 67 of file file_info.cc.

References name.

00068 {
00069         return name;
00070 }

ptr< source_location > lestes::std::file_info::origin_get ( void   )  const

Returns inclusion origin.

Returns origin of inclusion.

Returns:
The location of the include command for this source file.

Definition at line 76 of file file_info.cc.

References origin.

00077 {
00078         return origin;
00079 }

bool lestes::std::file_info::equals ( const ptr< file_info > &  other  )  const

Tests equality.

Tests equality to other file info.

Parameters:
other The other object to compare to.

Definition at line 85 of file file_info.cc.

References lestes::is_equal(), name, and origin.

00086 {
00087         return other && is_equal(name,other->name_get()) && is_equal(origin,other->origin_get());
00088 }

ptr< file_info > lestes::std::file_info::create ( const name_type a_name,
const ptr< source_location > &  a_origin 
) [static]

Returns file info initialized with file name and origin.

Returns new instance, initializes with name and origin.

Parameters:
a_name The name of the file.
a_origin The origin of inclusion.

Definition at line 95 of file file_info.cc.

References file_info().

Referenced by lestes::std::source_location::zero().

00097 {
00098         return new file_info(a_name,a_origin);
00099 }

void lestes::std::file_info::gc_mark ( void   )  [protected, virtual]

Marking routine.

Standard marking routine, called by the garbage collector.

Reimplemented from lestes::std::mem::keystone.

Definition at line 57 of file file_info.cc.

References lestes::std::mem::keystone::gc_mark(), lestes::std::mem::simple_pointer::gc_mark(), and origin.

00058 {
00059         origin.gc_mark();
00060         object::gc_mark();
00061 }

file_info& lestes::std::file_info::operator= ( const file_info  )  [private]

Hides assingment operator.


Member Data Documentation

lstring lestes::std::file_info::name [private]

Name of the file.

Definition at line 70 of file file_info.hh.

Referenced by equals(), and name_get().

srp<source_location> lestes::std::file_info::origin [private]

Origin of inclusion.

Definition at line 72 of file file_info.hh.

Referenced by equals(), gc_mark(), and origin_get().


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:25:55 2007 for lestes by doxygen 1.5.1-20070107