"Fossies" - the Fresh Open Source Software Archive

Member "src/Platform/SystemException.h" (10 Oct 2018, 1624 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "SystemException.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Derived from source code of TrueCrypt 7.1a, which is
    3  Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4  by the TrueCrypt License 3.0.
    5 
    6  Modifications and additions to the original source code (contained in this file)
    7  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8  and are governed by the Apache License 2.0 the full text of which is
    9  contained in the file License.txt included in VeraCrypt binary and source
   10  code distribution packages.
   11 */
   12 
   13 #ifndef TC_HEADER_Platform_SystemException
   14 #define TC_HEADER_Platform_SystemException
   15 
   16 #include "PlatformBase.h"
   17 #include "Exception.h"
   18 
   19 namespace VeraCrypt
   20 {
   21     class SystemException : public Exception
   22     {
   23     public:
   24         SystemException ();
   25         SystemException (const string &message);
   26         SystemException (const string &message, const string &subject);
   27         SystemException (const string &message, const wstring &subject);
   28         SystemException (const string &message, int64 errorCode)
   29             : Exception (message), ErrorCode (errorCode) { }
   30         virtual ~SystemException () throw () { }
   31 
   32         TC_SERIALIZABLE_EXCEPTION (SystemException);
   33 
   34         int64 GetErrorCode () const { return ErrorCode; }
   35         bool IsError () const;
   36         wstring SystemText () const;
   37 
   38     protected:
   39         int64 ErrorCode;
   40     };
   41 
   42 #undef TC_EXCEPTION_SET
   43 #define TC_EXCEPTION_SET \
   44     TC_EXCEPTION_NODECL (SystemException);
   45 }
   46 
   47 #define throw_sys_if(condition) do { if (condition) throw SystemException (SRC_POS); } while (false)
   48 #define throw_sys_sub_if(condition,subject) do { if (condition) throw SystemException (SRC_POS, (subject)); } while (false)
   49 
   50 #endif // TC_HEADER_Platform_SystemException