view Exception.hpp @ 15:199fc63c60c1

Increase buffersize for filehash computing.
author Tom Fredrik Blenning Klaussen <bfg@sim.no>
date Sat, 25 Aug 2012 01:42:13 +0200
parents b5943e4bf676
children 06166d6c083b
line wrap: on
line source

#ifndef EXCEPTION_HPP
#define EXCEPTION_HPP

#include <QtCore/QString>

class Exception {

public:
  typedef QString string_t;

  virtual const string_t& toString() const
  {
    return errorMsg_;
  }
  void raise() const
  {
    throw *this;
  }


protected:
  Exception(const string_t& errorMsg) : errorMsg_(errorMsg) {}
  virtual ~Exception() {}

  void setErrorMsg(string_t& errorMsg);
  const string_t& errorMsg(string_t& errorMsg);

private:
  string_t errorMsg_;
};

#endif //EXCEPTION_HPP