Exception class, derived from std::exception. More...
#include <Exception.hpp>
Inherits exception.
Public Types | |
enum | Type { UnspecifiedException, CoreException, ModuleException, GLException, ClientShaderException, ClientScriptException, ClientException } |
Exception type. More... | |
Public Member Functions | |
Exception (const std::string &m, std::string f="", int l=-1, const Type &t=UnspecifiedException) | |
Exception constructor. More... | |
Exception (const Exception &e) | |
Exception constructor. More... | |
Type | getType (void) const |
Get the type of the exception. More... | |
const char * | what (void) const throw () |
Get the complete exception message. More... | |
const std::string & | getMessage (void) const throw () |
Get the exception message. More... | |
const std::string & | getFilename (void) const throw () |
Get the filename the exception was generated from. More... | |
std::string | getShortFilename (void) const |
Get the last part of the filename (following the last separator). More... | |
int | getLineNumber (void) const throw () |
Get the line number the exception was generated from. More... | |
Exception & | operator= (const std::exception &e) |
Copy an exception. More... | |
Exception & | operator= (const Exception &e) |
Copy an exception. More... | |
Exception & | operator<< (const std::exception &e) |
Concatenate the mesages of two exceptions. More... | |
Exception & | operator<< (const Exception &e) |
Concatenate the mesages of two exceptions. More... | |
void | append (const Exception &e) |
Concatenate the messages of two exceptions. Note that this is a reversed version of operator<<. More... | |
void | prepend (const Exception &e) |
Concatenate the messages of two exceptions. Use this version to serially concatenate multiple descriptions. More... | |
int | getNumSubExceptions (void) const throw () |
Get the number of sub-error embedded. More... | |
const Exception & | getSubException (int i) |
Return the sub-error at index i. More... | |
bool | isSubException (void) const |
Test if the exception is a subordinate. More... | |
void | hideHeader (bool enabled=true) |
Hide (or show) the headers in messages provided by what(). More... | |
bool | isHeaderHidden (void) const |
Test if the header will be shown in the exception message. More... | |
Exception class, derived from std::exception.
Exception type.
Exception::Exception | ( | const std::string & | m, |
std::string | f = "" , |
||
int | l = -1 , |
||
const Type & | t = UnspecifiedException |
||
) |
Exception constructor.
m | Message. |
f | File name (FILE). |
l | Line number (LINE). |
t | Type of the exception (see Exception::Type). |
void Exception::append | ( | const Exception & | e | ) |
Concatenate the messages of two exceptions. Note that this is a reversed version of operator<<.
e | A sub Exception. |
const std::string & Exception::getFilename | ( | void | ) | const | |
throw | ( | ||||
) |
Get the filename the exception was generated from.
int Exception::getLineNumber | ( | void | ) | const | |
throw | ( | ||||
) |
Get the line number the exception was generated from.
const std::string & Exception::getMessage | ( | void | ) | const | |
throw | ( | ||||
) |
Get the exception message.
int Exception::getNumSubExceptions | ( | void | ) | const | |
throw | ( | ||||
) |
Get the number of sub-error embedded.
std::string Exception::getShortFilename | ( | void | ) | const |
Get the last part of the filename (following the last separator).
const Exception & Exception::getSubException | ( | int | i | ) |
Return the sub-error at index i.
i | The index of the sub-error. |
Exception::Type Exception::getType | ( | void | ) | const |
Get the type of the exception.
void Exception::hideHeader | ( | bool | enabled = true | ) |
Hide (or show) the headers in messages provided by what().
enabled | true (default) to hide the headers or true to show them. |
bool Exception::isHeaderHidden | ( | void | ) | const |
Test if the header will be shown in the exception message.
bool Exception::isSubException | ( | void | ) | const |
Test if the exception is a subordinate.
Exception & Exception::operator<< | ( | const std::exception & | e | ) |
Concatenate the mesages of two exceptions.
e | The original exception. |
Concatenate the mesages of two exceptions.
e | The original Exception. |
Exception & Exception::operator= | ( | const std::exception & | e | ) |
Copy an exception.
e | Source exception. |
Copy an exception.
e | Source exception. |
void Exception::prepend | ( | const Exception & | e | ) |
Concatenate the messages of two exceptions. Use this version to serially concatenate multiple descriptions.
e | A sub Exception. |
const char * Exception::what | ( | void | ) | const | |
throw | ( | ||||
) |
Get the complete exception message.