Subversion Repositories public iLand

Rev

Rev 105 | Rev 121 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
102 Werner 2
#ifndef EXCEPTION_H
3
#define EXCEPTION_H
4
 
5
 
6
/** Exception IException is the iLand model exception class.
120 Werner 7
    The class uses a string to store exception messages.
102 Werner 8
  */
120 Werner 9
class IException  {
102 Werner 10
 public:
120 Werner 11
   // ~IException () throw() {  }
12
   IException()  { }
13
   //IException(QString msg)  { GlobalSettings::instance()->addErrorMessage(msg); }
14
   //QString toString() const { return GlobalSettings::instance()->errorMessage(); }
15
   IException(QString msg)  { add(msg); }
16
   const QString &toString() const { return mMsg; }
17
   void add(const QString &msg) { if(!mMsg.isEmpty()) mMsg+="\n"; mMsg += msg; }
102 Werner 18
private:
120 Werner 19
   QString mMsg;
102 Werner 20
};
21
 
22
 
23
#endif // EXCEPTION_H