green::Error Class Reference

#include <Error.h>

List of all members.

Public Member Functions

 Error ()
 Error (unsigned int line, std::string file, std::string message)
virtual ~Error ()
virtual void SetLine (unsigned int line)
virtual unsigned int GetLine () const
virtual void SetFile (std::string file)
virtual const std::string & GetFile () const
virtual void SetMessage (std::string message)
virtual const std::string & GetMessage () const
virtual void Print (std::ostream &os)

Protected Attributes

unsigned int mLine
 the line where the error occured
std::string mFile
 the file where the error occured
std::string mMessage
 an optional message about the error


Detailed Description

The Error class encapsulates an error message to be thrown as an exception. You can specify the line number, file, and a custom message for the error. You can also print the error to any ostream. It is possible and encouraged to subclass Error for more specific error types.


Constructor & Destructor Documentation

green::Error::Error (  )  [inline]

Default constructor sets the error line to 0, and file and message fields to empty strings.

green::Error::Error ( unsigned int  line,
std::string  file,
std::string  message 
) [inline]

Constructor that sets the line, file, and message fields.

Parameters:
line The line number where the error occured.
file A string representing the file where the error occured.
message A string containing an extra message about the error

virtual green::Error::~Error (  )  [inline, virtual]

Destructor is simply the default constructor, defined as virtual.


Member Function Documentation

virtual void green::Error::SetLine ( unsigned int  line  )  [inline, virtual]

Sets the line number where the error occured.

Parameters:
line The line number where the error occurred

virtual unsigned int green::Error::GetLine (  )  const [inline, virtual]

Gets the line number where the error occured.

Returns:
Returns the line number where the error occured.

virtual void green::Error::SetFile ( std::string  file  )  [inline, virtual]

Sets the file string where the error occured

Parameters:
file The file where the error occured.

virtual const std::string& green::Error::GetFile (  )  const [inline, virtual]

Gets the file string where the error occured.

Returns:
Returns the file string where the error occured.

virtual void green::Error::SetMessage ( std::string  message  )  [inline, virtual]

Sets the message string.

Parameters:
message The extra message associated with the file

virtual const std::string& green::Error::GetMessage (  )  const [inline, virtual]

Gets the message string associated with the error

Returns:
Returns the message string associated with the error

virtual void green::Error::Print ( std::ostream &  os  )  [inline, virtual]

Prints the error out to an ostream in a nice format.

Parameters:
os The output stream the error is to be printed on


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 10:27:39 2007 for Green Engine by  doxygen 1.5.1