|
|
1.1 ! root 1: /* ! 2: Copyright (c) 2008 TrueCrypt Foundation. All rights reserved. ! 3: ! 4: Governed by the TrueCrypt License 2.4 the full text of which is contained ! 5: in the file License.txt included in TrueCrypt binary and source code ! 6: distribution packages. ! 7: */ ! 8: ! 9: #ifndef TC_HEADER_Platform_SystemException ! 10: #define TC_HEADER_Platform_SystemException ! 11: ! 12: #include "PlatformBase.h" ! 13: #include "Exception.h" ! 14: ! 15: namespace TrueCrypt ! 16: { ! 17: class SystemException : public Exception ! 18: { ! 19: public: ! 20: SystemException () { } ! 21: SystemException (const string &message); ! 22: SystemException (const string &message, const string &subject); ! 23: SystemException (const string &message, const wstring &subject); ! 24: SystemException (const string &message, int64 errorCode) ! 25: : Exception (message), ErrorCode (errorCode) { } ! 26: virtual ~SystemException () throw () { } ! 27: ! 28: TC_SERIALIZABLE_EXCEPTION (SystemException); ! 29: ! 30: int64 GetErrorCode () const { return ErrorCode; } ! 31: bool IsError () const; ! 32: wstring SystemText () const; ! 33: ! 34: protected: ! 35: int64 ErrorCode; ! 36: }; ! 37: ! 38: #undef TC_EXCEPTION_SET ! 39: #define TC_EXCEPTION_SET \ ! 40: TC_EXCEPTION_NODECL (SystemException); ! 41: } ! 42: ! 43: #define throw_sys_if(condition) do { if (condition) throw SystemException (SRC_POS); } while (false) ! 44: #define throw_sys_sub_if(condition,subject) do { if (condition) throw SystemException (SRC_POS, (subject)); } while (false) ! 45: ! 46: #endif // TC_HEADER_Platform_SystemException
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.