home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / kwclass.zip / KVALEXC.HPP < prev    next >
C/C++ Source or Header  |  1994-04-18  |  2KB  |  74 lines

  1. #ifndef _KVALEXC_
  2.   #define _KVALEXC_
  3.  
  4. #ifndef _IEXCBASE_
  5.   #include <iexcbase.hpp>
  6. #endif
  7.  
  8. class IWindow;
  9.  
  10. class KException: public IException 
  11. {
  12.   public:
  13.     KException(const char* a, unsigned long b = 0,
  14.         Severity c = IException::unrecoverable)
  15.       : IException(a,b,c) {}
  16.     virtual const char* name() const { return "KException"; }
  17.     virtual ~KException() {}
  18.     KException(const KException& exc)
  19.       : IException(exc) {}
  20.   private:
  21.     operator = ( const KException& );
  22. };
  23.  
  24. class KValidateException : public KException
  25. {
  26.   public:
  27.     KValidateException(const IWindow *wnd = 0) : 
  28.       KException("Invalid field", 0, IException::recoverable),
  29.       _window(wnd) 
  30.     {
  31.     }
  32.  
  33.     KValidateException(const KValidateException ©) :
  34.       KException(copy) 
  35.     {
  36.     }
  37.  
  38.     virtual const char *name() const { return "KValidateException"; }
  39.     virtual ~KValidateException() {}
  40.     const IWindow *window() const { return _window; }
  41.  
  42.   private:
  43.     operator =(const KValidateException &);
  44.     const IWindow *_window;
  45.  
  46. };
  47.  
  48.  
  49. class KRequiredException : public KException
  50. {
  51.   public:
  52.     KRequiredException(const IWindow *wnd = 0) :
  53.       KException("Invalid field", 0, IException::recoverable),
  54.       _window(wnd) {}
  55.  
  56.     KRequiredException(const KRequiredException ©) :
  57.       KException(copy) {}
  58.  
  59.     virtual const char *name() const { return "KRequiredException"; }
  60.     virtual ~KRequiredException() {}
  61.     const IWindow *window() const { return _window; }
  62.  
  63.   private:
  64.     operator =(const KRequiredException &);
  65.     const IWindow *_window;
  66.  
  67. };
  68.  
  69.  
  70. #define KTHROWREQUIRED(win)
  71. #define KTHROWVALIDATE(win)
  72.  
  73. #endif
  74.