#include <Error.h>
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 |
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.
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.
virtual void green::Error::SetLine | ( | unsigned int | line | ) | [inline, virtual] |
Sets the line number where the error occured.
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.
virtual void green::Error::SetFile | ( | std::string | file | ) | [inline, virtual] |
Sets the file string where the error occured
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.
virtual void green::Error::SetMessage | ( | std::string | message | ) | [inline, virtual] |
Sets the message string.
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
virtual void green::Error::Print | ( | std::ostream & | os | ) | [inline, virtual] |
Prints the error out to an ostream in a nice format.
os | The output stream the error is to be printed on |