BasicFileLocation Class Reference

#include <BasicFileLocation.h>

List of all members.

Public Member Functions

 BasicFileLocation ()
 BasicFileLocation (const BasicFileLocation &x)
 BasicFileLocation (const std::string filename, const long line, const long col)
virtual ~BasicFileLocation ()
const std::string getFilename () const
const long getLine () const
const long getCol () const
bool isEmpty () const

Private Attributes

std::string filename
long line
long col
bool empty

Friends

std::ostream & operator<< (std::ostream &stream, const BasicFileLocation &fl)


Detailed Description

This class is mainly used by BasicException, but can be used as a general class for recording a line and column location with in a file.

Definition at line 36 of file BasicFileLocation.h.


Constructor & Destructor Documentation

BasicFileLocation::BasicFileLocation (  )  [inline]

Construct a default BasicFileLocation with an empty value.

Definition at line 46 of file BasicFileLocation.h.

BasicFileLocation::BasicFileLocation ( const BasicFileLocation x  )  [inline]

Copy constructor.

Definition at line 51 of file BasicFileLocation.h.

BasicFileLocation::BasicFileLocation ( const std::string  filename,
const long  line,
const long  col 
) [inline]

Parameters:
filename The name of the file.
line The line with that file.
col The column on that line.

Definition at line 59 of file BasicFileLocation.h.

virtual BasicFileLocation::~BasicFileLocation (  )  [inline, virtual]

Definition at line 63 of file BasicFileLocation.h.


Member Function Documentation

const std::string BasicFileLocation::getFilename (  )  const [inline]

Definition at line 65 of file BasicFileLocation.h.

References filename.

Referenced by CC3DTransaction::simulationThreadPython().

const long BasicFileLocation::getLine (  )  const [inline]

Returns:
-1 if no line was set the line number otherwise.

Definition at line 70 of file BasicFileLocation.h.

References line.

Referenced by CC3DTransaction::simulationThreadPython().

const long BasicFileLocation::getCol (  )  const [inline]

Returns:
-1 of no column was set the column number otherwise.

Definition at line 75 of file BasicFileLocation.h.

References col.

bool BasicFileLocation::isEmpty (  )  const [inline]

Returns:
True of no filename, line, or column have been set.

Definition at line 80 of file BasicFileLocation.h.

References empty.

Referenced by operator<<(), and BasicException::print().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const BasicFileLocation fl 
) [friend]

Print a file location to a stream. The format is as follows.

filename[:line[:col]]

If no line or column has been set then they will not be displayed.

Returns:
A reference to the passed stream.


Member Data Documentation

std::string BasicFileLocation::filename [private]

Definition at line 37 of file BasicFileLocation.h.

Referenced by getFilename(), and operator<<().

long BasicFileLocation::line [private]

Definition at line 38 of file BasicFileLocation.h.

Referenced by getLine(), and operator<<().

long BasicFileLocation::col [private]

Definition at line 39 of file BasicFileLocation.h.

Referenced by getCol(), and operator<<().

bool BasicFileLocation::empty [private]

Definition at line 40 of file BasicFileLocation.h.

Referenced by isEmpty().


The documentation for this class was generated from the following file:

Generated on Thu Dec 4 11:41:20 2008 for CompuCell3D by  doxygen 1.5.6