1*cdf0e10cSrcweir // RegistryException.h: Schnittstelle f�r die Klasse RegistryException. 2*cdf0e10cSrcweir // 3*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////// 4*cdf0e10cSrcweir 5*cdf0e10cSrcweir #ifndef _REGISTRYEXCEPTION_HXX_ 6*cdf0e10cSrcweir #define _REGISTRYEXCEPTION_HXX_ 7*cdf0e10cSrcweir 8*cdf0e10cSrcweir #include <exception> 9*cdf0e10cSrcweir 10*cdf0e10cSrcweir //####################################### 11*cdf0e10cSrcweir // Base class for all Registry exceptions 12*cdf0e10cSrcweir //####################################### 13*cdf0e10cSrcweir 14*cdf0e10cSrcweir class RegistryException : public std::exception 15*cdf0e10cSrcweir { 16*cdf0e10cSrcweir public: 17*cdf0e10cSrcweir 18*cdf0e10cSrcweir RegistryException(long ErrorCode); 19*cdf0e10cSrcweir 20*cdf0e10cSrcweir virtual ~RegistryException() throw(); 21*cdf0e10cSrcweir 22*cdf0e10cSrcweir /** 23*cdf0e10cSrcweir @descr Returns a string that describes the error if 24*cdf0e10cSrcweir available, else NULL will be returned. The 25*cdf0e10cSrcweir returned string is only temporary so the caller 26*cdf0e10cSrcweir has to copy it if he needs the string further. 27*cdf0e10cSrcweir */ 28*cdf0e10cSrcweir virtual const char* what() const throw(); 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir /** 31*cdf0e10cSrcweir @descr Returns the error code. 32*cdf0e10cSrcweir */ 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir long GetErrorCode() const; 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir private: 37*cdf0e10cSrcweir long m_ErrorCode; 38*cdf0e10cSrcweir void* m_ErrorMsg; 39*cdf0e10cSrcweir }; 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir //####################################### 42*cdf0e10cSrcweir // Thrown when a Registry key is accessed 43*cdf0e10cSrcweir // that is closed 44*cdf0e10cSrcweir //####################################### 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir class RegistryIOException : public RegistryException 47*cdf0e10cSrcweir { 48*cdf0e10cSrcweir public: 49*cdf0e10cSrcweir RegistryIOException(long ErrorCode); 50*cdf0e10cSrcweir }; 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir //####################################### 53*cdf0e10cSrcweir // Thrown when trying to write to a readonly registry key 54*cdf0e10cSrcweir //####################################### 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir class RegistryNoWriteAccessException : public RegistryException 57*cdf0e10cSrcweir { 58*cdf0e10cSrcweir public: 59*cdf0e10cSrcweir RegistryNoWriteAccessException(long ErrorCode); 60*cdf0e10cSrcweir }; 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir //####################################### 63*cdf0e10cSrcweir // Thrown when trying to access an registry key, with improper 64*cdf0e10cSrcweir // access rights 65*cdf0e10cSrcweir //####################################### 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir class RegistryAccessDeniedException : public RegistryException 68*cdf0e10cSrcweir { 69*cdf0e10cSrcweir public: 70*cdf0e10cSrcweir RegistryAccessDeniedException(long ErrorCode); 71*cdf0e10cSrcweir }; 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir //####################################### 74*cdf0e10cSrcweir // A specified registry value could not be read because it is not 75*cdf0e10cSrcweir // available 76*cdf0e10cSrcweir //####################################### 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir class RegistryValueNotFoundException : public RegistryException 79*cdf0e10cSrcweir { 80*cdf0e10cSrcweir public: 81*cdf0e10cSrcweir RegistryValueNotFoundException(long ErrorCode); 82*cdf0e10cSrcweir }; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir //####################################### 85*cdf0e10cSrcweir // A specified registry key was not found 86*cdf0e10cSrcweir //####################################### 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir class RegistryKeyNotFoundException : public RegistryException 89*cdf0e10cSrcweir { 90*cdf0e10cSrcweir public: 91*cdf0e10cSrcweir RegistryKeyNotFoundException(long ErrorCode); 92*cdf0e10cSrcweir }; 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir //####################################### 95*cdf0e10cSrcweir // A specified registry operation is invalid 96*cdf0e10cSrcweir //####################################### 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir class RegistryInvalidOperationException : public RegistryException 99*cdf0e10cSrcweir { 100*cdf0e10cSrcweir public: 101*cdf0e10cSrcweir RegistryInvalidOperationException(long ErrorCode); 102*cdf0e10cSrcweir }; 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir #endif 105