Mercurial > dedupe
view Exception.hpp @ 8:d7b384b4a834
Fix compilation problems.
Fix printing issues.
Introduce raise function in Exception.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Wed, 22 Aug 2012 18:18:20 +0200 |
| parents | a3834af36579 |
| children | b5943e4bf676 |
line wrap: on
line source
#ifndef EXCEPTION_HPP #define EXCEPTION_HPP #include <QtCore/QString> class Exception { public: virtual QString toString() const { return errorMsg_; } void raise() const { throw *this; } protected: Exception(const QString& errorMsg) : errorMsg_(errorMsg) {} virtual ~Exception() {} void setErrorMsg(QString& errorMsg); const QString& errorMsg(QString& errorMsg); private: QString errorMsg_; }; #endif //EXCEPTION_HPP
