#include <exception.hpp>
Guichan will only throw exceptions of this class. You can use this class for your own exceptions. A nifty feature of the excpetion class is that it can tell you from which line and file it was thrown. To make things easier when throwing exceptions there exists a macro for creating exceptions which automatically sets the filename and line number.
EXAMPLE:
throw GCN_EXCEPTION("my error message");
Definition at line 98 of file exception.hpp.
Public Member Functions | |
Exception () | |
Constructor. | |
Exception (const std::string &message) | |
Constructor. | |
Exception (const std::string &message, const std::string &function, const std::string &filename, int line) | |
Constructor. | |
const std::string & | getFunction () const |
Gets the function name in which the exception was thrown. | |
const std::string & | getMessage () const |
Gets the error message of the exception. | |
const std::string & | getFilename () const |
Gets the filename in which the exceptions was thrown. | |
int | getLine () const |
Gets the line number of the line where the exception was thrown. | |
Protected Attributes | |
std::string | mFunction |
std::string | mMessage |
std::string | mFilename |
int | mLine |
gcn::Exception::Exception | ( | const std::string & | message | ) |
Constructor.
message | the error message. |
Definition at line 70 of file exception.cpp.
References mMessage.
gcn::Exception::Exception | ( | const std::string & | message, | |
const std::string & | function, | |||
const std::string & | filename, | |||
int | line | |||
) |
Constructor.
NOTE: Don't use this constructor. Use the GCN_EXCEPTION macro instead.
message | the error message. | |
function | the function name. | |
filename | the name of the file. | |
line | the line number. |
Definition at line 75 of file exception.cpp.
const std::string & gcn::Exception::getFilename | ( | ) | const |
Gets the filename in which the exceptions was thrown.
Definition at line 96 of file exception.cpp.
References mFilename.
const std::string & gcn::Exception::getFunction | ( | ) | const |
Gets the function name in which the exception was thrown.
Definition at line 86 of file exception.cpp.
References mFunction.
int gcn::Exception::getLine | ( | ) | const |
Gets the line number of the line where the exception was thrown.
Definition at line 101 of file exception.cpp.
References mLine.
const std::string & gcn::Exception::getMessage | ( | ) | const |
Gets the error message of the exception.
Definition at line 91 of file exception.cpp.
References mMessage.