2009-11-21 01:45:08 +00:00
|
|
|
#ifndef __EXCEPTION_H__
|
|
|
|
#define __EXCEPTION_H__
|
|
|
|
|
|
|
|
#include <string>
|
2009-12-11 00:59:53 +00:00
|
|
|
#include <exception>
|
2009-11-21 01:45:08 +00:00
|
|
|
|
|
|
|
namespace ProFUSE {
|
|
|
|
|
|
|
|
class Exception : public std::exception
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Exception(const char *cp);
|
|
|
|
Exception(const std::string &str);
|
2009-12-02 01:19:34 +00:00
|
|
|
|
2009-11-21 01:45:08 +00:00
|
|
|
|
|
|
|
virtual ~Exception() throw ();
|
|
|
|
|
|
|
|
virtual const char *what();
|
|
|
|
|
2009-12-02 01:19:34 +00:00
|
|
|
int error() const { return _error; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Exception(const char *cp, int error);
|
|
|
|
Exception(const std::string& string, int error);
|
|
|
|
|
2009-11-21 01:45:08 +00:00
|
|
|
private:
|
|
|
|
int _error;
|
|
|
|
std::string _string;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-12-02 01:19:34 +00:00
|
|
|
class POSIXException : public Exception {
|
|
|
|
public:
|
|
|
|
POSIXException(const char *cp, int error);
|
|
|
|
POSIXException(const std::string& string, int error);
|
|
|
|
};
|
|
|
|
|
|
|
|
class ProDOSException : public Exception {
|
|
|
|
public:
|
|
|
|
ProDOSException(const char *cp, int error);
|
|
|
|
ProDOSException(const std::string& string, int error);
|
|
|
|
};
|
|
|
|
|
2009-11-21 01:45:08 +00:00
|
|
|
inline Exception::Exception(const char *cp):
|
|
|
|
_error(0),
|
|
|
|
_string(cp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Exception::Exception(const std::string& string):
|
|
|
|
_error(0),
|
|
|
|
_string(string)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Exception::Exception(const char *cp, int error):
|
|
|
|
_error(error),
|
|
|
|
_string(cp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Exception::Exception(const std::string& string, int error):
|
|
|
|
_error(error),
|
|
|
|
_string(string)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-12-02 01:19:34 +00:00
|
|
|
inline POSIXException::POSIXException(const char *cp, int error) :
|
|
|
|
Exception(cp, error)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
inline POSIXException::POSIXException(const std::string& string, int error) :
|
|
|
|
Exception(string, error)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
inline ProDOSException::ProDOSException(const char *cp, int error) :
|
|
|
|
Exception(cp, error)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
inline ProDOSException::ProDOSException(const std::string& string, int error) :
|
|
|
|
Exception(string, error)
|
2009-11-21 01:45:08 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-12-02 01:19:34 +00:00
|
|
|
|
|
|
|
|
2009-11-21 01:45:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|