_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <exception.h>
Public Member Functions | |
Exception () | |
Exception (const std::string &message) | |
Exception (const std::string &message, const std::string &function, const std::string &filename, int line) | |
const std::string & | getFunction () const |
const std::string & | getMessage () const |
const std::string & | getFilename () const |
int | getLine () const |
Protected Attributes | |
std::string | mFunction |
std::string | mMessage |
std::string | mFilename |
int | mLine |
An exception containing a message, a file and a line number. 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:
gcn::Exception::Exception | ( | ) |
Constructor.
gcn::Exception::Exception | ( | const std::string & | message | ) |
Constructor.
message | the error message. |
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. |
const std::string & gcn::Exception::getFilename | ( | ) | const |
Gets the filename in which the exceptions was thrown.
const std::string & gcn::Exception::getFunction | ( | ) | const |
Gets the function name in which the exception was thrown.
int gcn::Exception::getLine | ( | ) | const |
Gets the line number of the line where the exception was thrown.
const std::string & gcn::Exception::getMessage | ( | ) | const |
Gets the error message of the exception.
|
protected |
|
protected |
|
protected |
|
protected |