#include <libthrowable/throwable.h>
Public Member Functions | |
virtual const char * | what () const throw () |
Inherited from std::exception. | |
virtual std::string | what (unsigned indent) const throw () |
The same like what(), but with additional indent. | |
virtual std::string | toString (int lineWidth=libthrowable::util::getTerminalWidth()) const throw () |
Converts a Throwable object to a string tweaked for a given line width. | |
virtual | ~Throwable () throw () |
Protected Member Functions | |
Throwable (const std::string &msg, const DontManipulateStr &dummy) throw () | |
Use this constructor when deriving from this class. | |
std::string & | getInternalString () throw () |
Use this one if you want to manipulate the stored string from a derived classes. | |
Static Protected Member Functions | |
static std::string | internalStrFromFilenameAndLinenumber (const std::string &className, const char *filename, int linenumber) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromFilenameLinenumberAndFunction (const std::string &className, const char *filename, int linenumber, const char *function) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromFilenameLinenumberAndMessage (const std::string &className, const char *filename, int linenumber, const std::string &message) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromFilenameLinenumberFunctionAndMessage (const std::string &className, const char *filename, int linenumber, const char *function, const std::string &message) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromCause (const std::string &className, const std::exception &cause) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromCauseAndMessage (const std::string &className, const std::exception &cause, const std::string &message) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromFilenameLinenumberAndCause (const std::string &className, const char *filename, int linenumber, const std::exception &cause) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromFilenameLinenumberFunctionAndCause (const std::string &className, const char *filename, int linenumber, const char *function, const std::exception &cause) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | internalStrFromFilenameLinenumberFunctionCauseAndMessage (const std::string &className, const char *filename, int linenumber, const char *function, const std::exception &cause, const std::string &msg) throw () |
Convenience function to be used in constructors of derived classes. | |
static std::string | strFromFilenameAndLinenumber (const char *filename, int linenumber) throw () |
Returns 'where: <filename>:<linenumber>'. | |
static std::string | strFromFilenameLinenumberAndFunction (const char *filename, int linenumber, const char *function) throw () |
Returns 'where:\n <filename>:<linenumber> in\n <function>'. | |
static std::string | strFromFilenameLinenumberAndMessage (const char *filename, int linenumber, const std::string &msg) throw () |
Returns 'where: <filename>:<linenumber> \nmessage:\n <msg>'. | |
static std::string | strFromFilenameLinenumberFunctionAndMessage (const char *filename, int linenumber, const char *function, const std::string &msg) throw () |
Returns 'strFromFilenameAndLinenumber() + \nmessage:\n <msg>'. | |
static std::string | strFromCause (const std::exception &cause) throw () |
Returns 'cause:\n <cause.what()>'. | |
static std::string | strFromCauseAndMessage (const std::exception &cause, const std::string &msg) throw () |
Returns 'cause:\n <cause.what()>\nmessage\n <msg>'. | |
static std::string | strFromFilenameLinenumberAndCause (const char *filename, int linenumber, const std::exception &cause) throw () |
Returns 'where: <filename>:<linenumber>\ncause:\n <cause.what()>'. | |
static std::string | strFromFilenameLinenumberFunctionAndCause (const char *filename, int linenumber, const char *function, const std::exception &cause) throw () |
Returns 'where: <filename>:<linenumber> in\n <function>\ncause:\n <cause.what()>'. | |
static std::string | strFromFilenameLinenumberFunctionCauseAndMessage (const char *filename, int linenumber, const char *function, const std::exception &cause, const std::string &msg) throw () |
Returns 'where: <filename>:<linenumber> in\n <function>\nmessage:\n <msg>\ncause:\n <cause.what()>'. | |
Classes | |
class | DontManipulateStr |
Dummy class. More... |
virtual libthrowable::Throwable::~Throwable | ( | ) | throw () [virtual] |
libthrowable::Throwable::Throwable | ( | const std::string & | msg, | |
const DontManipulateStr & | dummy | |||
) | throw () [protected] |
Use this constructor when deriving from this class.
virtual const char* libthrowable::Throwable::what | ( | ) | const throw () [virtual] |
virtual std::string libthrowable::Throwable::what | ( | unsigned | indent | ) | const throw () [virtual] |
The same like what(), but with additional indent.
virtual std::string libthrowable::Throwable::toString | ( | int | lineWidth = libthrowable::util::getTerminalWidth() |
) | const throw () [virtual] |
Converts a Throwable object to a string tweaked for a given line width.
lineWidth | the maximal line width the output of this method should be tweaked for. For linewidth < 40, no tweaking is done. |
std::string& libthrowable::Throwable::getInternalString | ( | ) | throw () [protected] |
Use this one if you want to manipulate the stored string from a derived classes.
static std::string libthrowable::Throwable::internalStrFromFilenameAndLinenumber | ( | const std::string & | className, | |
const char * | filename, | |||
int | linenumber | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromFilenameLinenumberAndFunction | ( | const std::string & | className, | |
const char * | filename, | |||
int | linenumber, | |||
const char * | function | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromFilenameLinenumberAndMessage | ( | const std::string & | className, | |
const char * | filename, | |||
int | linenumber, | |||
const std::string & | message | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromFilenameLinenumberFunctionAndMessage | ( | const std::string & | className, | |
const char * | filename, | |||
int | linenumber, | |||
const char * | function, | |||
const std::string & | message | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromCause | ( | const std::string & | className, | |
const std::exception & | cause | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromCauseAndMessage | ( | const std::string & | className, | |
const std::exception & | cause, | |||
const std::string & | message | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromFilenameLinenumberAndCause | ( | const std::string & | className, | |
const char * | filename, | |||
int | linenumber, | |||
const std::exception & | cause | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromFilenameLinenumberFunctionAndCause | ( | const std::string & | className, | |
const char * | filename, | |||
int | linenumber, | |||
const char * | function, | |||
const std::exception & | cause | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::internalStrFromFilenameLinenumberFunctionCauseAndMessage | ( | const std::string & | className, | |
const char * | filename, | |||
int | linenumber, | |||
const char * | function, | |||
const std::exception & | cause, | |||
const std::string & | msg | |||
) | throw () [static, protected] |
Convenience function to be used in constructors of derived classes.
static std::string libthrowable::Throwable::strFromFilenameAndLinenumber | ( | const char * | filename, | |
int | linenumber | |||
) | throw () [static, protected] |
Returns 'where: <filename>:<linenumber>'.
static std::string libthrowable::Throwable::strFromFilenameLinenumberAndFunction | ( | const char * | filename, | |
int | linenumber, | |||
const char * | function | |||
) | throw () [static, protected] |
Returns 'where:\n <filename>:<linenumber> in\n <function>'.
static std::string libthrowable::Throwable::strFromFilenameLinenumberAndMessage | ( | const char * | filename, | |
int | linenumber, | |||
const std::string & | msg | |||
) | throw () [static, protected] |
Returns 'where: <filename>:<linenumber> \nmessage:\n <msg>'.
static std::string libthrowable::Throwable::strFromFilenameLinenumberFunctionAndMessage | ( | const char * | filename, | |
int | linenumber, | |||
const char * | function, | |||
const std::string & | msg | |||
) | throw () [static, protected] |
Returns 'strFromFilenameAndLinenumber() + \nmessage:\n <msg>'.
static std::string libthrowable::Throwable::strFromCause | ( | const std::exception & | cause | ) | throw () [static, protected] |
Returns 'cause:\n <cause.what()>'.
static std::string libthrowable::Throwable::strFromCauseAndMessage | ( | const std::exception & | cause, | |
const std::string & | msg | |||
) | throw () [static, protected] |
Returns 'cause:\n <cause.what()>\nmessage\n <msg>'.
static std::string libthrowable::Throwable::strFromFilenameLinenumberAndCause | ( | const char * | filename, | |
int | linenumber, | |||
const std::exception & | cause | |||
) | throw () [static, protected] |
Returns 'where: <filename>:<linenumber>\ncause:\n <cause.what()>'.
static std::string libthrowable::Throwable::strFromFilenameLinenumberFunctionAndCause | ( | const char * | filename, | |
int | linenumber, | |||
const char * | function, | |||
const std::exception & | cause | |||
) | throw () [static, protected] |
Returns 'where: <filename>:<linenumber> in\n <function>\ncause:\n <cause.what()>'.
static std::string libthrowable::Throwable::strFromFilenameLinenumberFunctionCauseAndMessage | ( | const char * | filename, | |
int | linenumber, | |||
const char * | function, | |||
const std::exception & | cause, | |||
const std::string & | msg | |||
) | throw () [static, protected] |
Returns 'where: <filename>:<linenumber> in\n <function>\nmessage:\n <msg>\ncause:\n <cause.what()>'.