37 lines
574 B
C++
37 lines
574 B
C++
#ifndef WC3RE_EXCEPTIONS_HH__
|
|
#define WC3RE_EXCEPTIONS_HH__
|
|
|
|
#include <string>
|
|
|
|
class Exception {
|
|
public:
|
|
Exception(std::string msg = "");
|
|
|
|
virtual ~Exception();
|
|
|
|
virtual std::string toString() const;
|
|
|
|
protected:
|
|
std::string msg_;
|
|
};
|
|
|
|
class FormatException : public Exception {
|
|
public:
|
|
FormatException(std::string msg);
|
|
|
|
std::string toString() const override;
|
|
};
|
|
|
|
class POSIXException : public Exception {
|
|
public:
|
|
POSIXException(int err, std::string msg = "");
|
|
|
|
int getErr() const;
|
|
|
|
std::string toString() const override;
|
|
private:
|
|
int err_;
|
|
};
|
|
|
|
#endif
|