//**************************************************************************************************
//
// ERROR SUPPORT — "$ErrorSign":
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"
namespace RuntimeForStatic {

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// "$ErrorSign"-CLASS — UNIVERSAL INFO FOR ERROR TYPE AND CODE(S):
//
//==================================================================================================
class $ErrorSign
{
public:
   $ErrorSign(); // empty (neutral) // $ErrorType::None

   $ErrorSign( $ErrorType type );

   $ErrorSign( $ErrorType type, $ErrorCode code );
   $ErrorSign( $ErrorType type, $ErrorCode code, $ErrorCode exCode );
   $ErrorSign( $ErrorType type, bool hasError, bool isWarning,
               $ErrorCode code, $ErrorCode exCode );

   $ErrorSign( $ErrorType type, int code );
   $ErrorSign( $ErrorType type, int code, int exCode );
   $ErrorSign( $ErrorType type, int code, DWORD exCode );
   $ErrorSign( $ErrorType type, bool hasError, bool isWarning,
               int code, int exCode );
   $ErrorSign( $ErrorType type, bool hasError, bool isWarning,
               int code, DWORD exCode );

   $ErrorSign( $ErrorType type, DWORD code );
   $ErrorSign( $ErrorType type, DWORD code, int exCode );
   $ErrorSign( $ErrorType type, DWORD code, DWORD exCode );
   $ErrorSign( $ErrorType type, bool hasError, bool isWarning,
               DWORD code, int exCode );
   $ErrorSign( $ErrorType type, bool hasError, bool isWarning,
               DWORD code, DWORD exCode );
public:
   __declspec(property(get = GetHasError          )) bool        HasError;
   __declspec(property(get = GetSuccess           )) bool        Success;
   __declspec(property(get = GetIsWarning         )) bool        IsWarning;
   __declspec(property(get = GetErrorType         )) $ErrorType  ErrorType;
   __declspec(property(get = GetIsWin32Error      )) bool        IsWin32Error;
   __declspec(property(get = GetIsCOMError        )) bool        IsCOMError;
   __declspec(property(get = GetIsWin32OrCOMError )) bool        IsWin32OrCOMError;
   __declspec(property(get = GetIsCustomError     )) bool        IsCustomError;
   __declspec(property(get = GetIsUnknownError    )) bool        IsUnknownError;
   __declspec(property(get = GetIntCode           )) int         IntCode;
   __declspec(property(get = GetDWordCode         )) DWORD       DWordCode;
   __declspec(property(get = GetExCode            )) $ErrorCode  ExCode;
   __declspec(property(get = GetWin32ErrorOrZero  )) DWORD       Win32ErrorOrZero;
   __declspec(property(get = GetCOMErrorOrZero    )) HRESULT     COMErrorOrZero;
public:
   bool GetHasError() const;
   bool GetSuccess() const;
   bool GetIsWarning() const;

   $ErrorType GetErrorType() const;

   bool GetIsWin32Error() const;
   bool GetIsCOMError() const;
   bool GetIsWin32OrCOMError() const;
   bool GetIsCustomError() const;
   bool GetIsUnknownError() const;

   int GetIntCode() const;
   DWORD GetDWordCode() const;

   $ErrorCode GetCode() const;
   $ErrorCode GetExCode() const;

   DWORD StrictWin32Error($O) const;
   HRESULT StrictCOMError($O) const;

   DWORD GetWin32ErrorOrZero() const;
   HRESULT GetCOMErrorOrZero() const;
public:
   static $ErrorSign CreateWin32();
   static $ErrorSign CreateWin32(DWORD dwError);

   static $ErrorSign CreateCOM();
   static $ErrorSign CreateCOM(HRESULT status);

   static $ErrorSign CreateCustom(int code);
   static $ErrorSign CreateCustom(bool hasError,bool isWarning,int code);
   static $ErrorSign CreateCustom(bool hasError,bool isWarning,int code,int exCode);

   static $ErrorSign CreateCustom(DWORD code);
   static $ErrorSign CreateCustom(bool hasError,bool isWarning,DWORD code);
   static $ErrorSign CreateCustom(bool hasError,bool isWarning,DWORD code,DWORD exCode);
private:
#include "..\private\ErrorSign.private.h"
}; // $ErrorSign
typedef $ErrorSign*        $PErrorSign;
typedef const $ErrorSign*  $PCErrorSign;
//==================================================================================================

} // RuntimeForStatic
