Update README.md
[nemesis.git] / Platform / SystemException.h
1 /*
2  Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
3
4  Governed by the TrueCrypt License 3.0 the full text of which is contained in
5  the file License.txt included in TrueCrypt binary and source code distribution
6  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 page took 0.033713 seconds and 3 git commands to generate. Download a nemesis OSX (sierra+high sierra, tested/working) binary, with fuse-ext3 via e2fsprogs, at this link. application and installer are signed by screwjack, llc. must install fuse with macFUSE layer first.