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

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// "$ErrorInfo"-CLASS — COMPOUND ERROR INFO (TYPE, CODE/CODES AND MESSAGE):
//
//==================================================================================================
class $ErrorInfo: public $Disposable
{
public:
   $ErrorInfo() $tenacious;
   $ErrorInfo( $ErrorSign sign ) $tenacious;
   $ErrorInfo($A, $ErrorSign sign, PCWSTR message $not_null ) $tenacious;
   $ErrorInfo($A, const $ErrorInfo& errorInfo );
public:
   $ErrorSign ErrorSign($O) const;
   $DynText Message($O) const $tenacious;
   $DynText Message($O,bool& messageGenerationProblem $out) const $tenacious;
   $DynText OriginalMessage($O) const $tenacious;
   $DynText OriginalMessage($O,bool& messageGenerationProblem $out) const $tenacious;
   bool MessageGenerationProblem($O) const;
public:
   bool HasError($O) const;
   bool Success($O) const;
   bool IsWarning($O) const;

   $ErrorType ErrorType($O) const;

   bool IsWin32Error($O) const;
   bool IsCOMError($O) const;
   bool IsWin32OrCOMError($O) const;
   bool IsCustomError($O) const;

   int IntCode($O) const;
   DWORD DWordCode($O) const;

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

   DWORD Win32ErrorOrZero($O) const;
   HRESULT COMErrorOrZero($O) const;
public:
   bool AppendMessage($OA,PCWSTR message) $tenacious;
   bool AppendMessageFmt($OA,PCWSTR messageFmt, ... ) $tenacious;
   bool AppendMessageVA($OA,PCWSTR messageFmt,va_list argList) $tenacious;
   bool AppendLastErrorMessage($O) $tenacious;

   void SetMessageGenerationProblem($O);
public:
   bool ApplyToLastError($O);
protected:
   virtual void DoDispose($CI_REF) override;
private:
#include "..\private\ErrorInfo.private.h"
}; // $ErrorInfo
//==================================================================================================

} // RuntimeForStatic
