// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#include "Precompiled.h"
#include "SharedIncludes.h"
#include "LE.internal.h"
namespace RuntimeForStatic {
//==================================================================================================

bool $LE::SetError(PCWSTR message $optional) $ret_false
{
   return SetError( false, (int)0, (int)0, message );
}

//--------------------------------------------------------------------------------------------------

bool $LE::SetError(int code,PCWSTR message $optional) $ret_false
{
   return SetError( false, code, (int)0, message );
}
bool $LE::SetError(bool isWarning,int code,PCWSTR message $optional) $ret_false
{
   return SetError( isWarning, code, (int)0, message );
}
bool $LE::SetError(bool isWarning,int code,int exCode,PCWSTR message $optional) $ret_false
{
   return SetErrorEx(
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      message );
}
bool $LE::SetError(bool isWarning,int code,DWORD exCode,PCWSTR message $optional) $ret_false
{
   return SetErrorEx(
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      message );
}

//--------------------------------------------------------------------------------------------------

bool $LE::SetError(DWORD code,PCWSTR message $optional) $ret_false
{
   return SetError( false, code, (DWORD)0, message );
}
bool $LE::SetError(bool isWarning,DWORD code,PCWSTR message $optional) $ret_false
{
   return SetError( isWarning, code, (DWORD)0, message );
}
bool $LE::SetError(bool isWarning,DWORD code,int exCode,PCWSTR message $optional) $ret_false
{
   return SetErrorEx(
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      message );
}
bool $LE::SetError(bool isWarning,DWORD code,DWORD exCode,PCWSTR message $optional) $ret_false
{
   return SetErrorEx(
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      message );
}

//--------------------------------------------------------------------------------------------------

bool $LE::SetError($A, const $ErrorInfo& errorInfo) $ret_false
{
   return SetErrorEx( errorInfo.ErrorSign($ci), errorInfo.Message($ci).T($) );
}

//==================================================================================================

bool $LE::SetErrorFmt($A,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}

bool $LE::SetErrorFmt($A,int code, PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, code, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}
bool $LE::SetErrorFmt($A,bool isWarning,int code,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, isWarning, code, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}
bool $LE::SetErrorFmt($A,bool isWarning,int code,int exCode,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, isWarning, code, exCode, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}
bool $LE::SetErrorFmt($A,bool isWarning,int code,DWORD exCode,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, isWarning, code, exCode, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}

//--------------------------------------------------------------------------------------------------

bool $LE::SetErrorFmt($A,DWORD code,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, code, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}
bool $LE::SetErrorFmt($A,bool isWarning,DWORD code,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, isWarning, code, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}
bool $LE::SetErrorFmt($A,bool isWarning,DWORD code,int exCode,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, isWarning, code, exCode, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}
bool $LE::SetErrorFmt($A,bool isWarning,DWORD code,DWORD exCode,PCWSTR messageFmt, ... ) $ret_false
{
   $$VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   SetErrorFmtVA($ci, isWarning, code, exCode, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return false;
}

//==================================================================================================

bool $LE::SetErrorFmtVA($A,PCWSTR messageFmt,va_list argList) $ret_false
{
   return SetErrorFmtVA($ci, false, (int)0, (int)0, messageFmt, argList );
}

bool $LE::SetErrorFmtVA($A,int code,PCWSTR messageFmt,va_list argList) $ret_false
{
   return SetErrorFmtVA($ci, false, code, (int)0, messageFmt, argList );
}
bool $LE::SetErrorFmtVA($A,bool isWarning,int code,PCWSTR messageFmt,va_list argList) $ret_false
{
   return SetErrorFmtVA($ci, isWarning, code, (int)0, messageFmt, argList );
}
bool $LE::SetErrorFmtVA($A, bool isWarning, int code, int exCode,
                            PCWSTR messageFmt, va_list argList ) $ret_false
{
   return SetErrorExFmtVA($ci,
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      messageFmt, argList );
}
bool $LE::SetErrorFmtVA($A, bool isWarning, int code, DWORD exCode,
                            PCWSTR messageFmt, va_list argList ) $ret_false
{
   return SetErrorExFmtVA($ci,
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      messageFmt, argList );
}

//--------------------------------------------------------------------------------------------------

bool $LE::SetErrorFmtVA($A,DWORD code,PCWSTR messageFmt,va_list argList) $ret_false
{
   return SetErrorFmtVA($ci, false, (DWORD)0, (DWORD)0, messageFmt, argList );
}
bool $LE::SetErrorFmtVA($A,bool isWarning,DWORD code,PCWSTR messageFmt,va_list argList) $ret_false
{
   return SetErrorFmtVA($ci, isWarning, code, (DWORD)0, messageFmt, argList );
}
bool $LE::SetErrorFmtVA($A, bool isWarning, DWORD code, int exCode,
                            PCWSTR messageFmt, va_list argList ) $ret_false
{
   return SetErrorExFmtVA($ci,
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      messageFmt, argList );
}
bool $LE::SetErrorFmtVA($A, bool isWarning, DWORD code, DWORD exCode,
                            PCWSTR messageFmt, va_list argList ) $ret_false
{
   return SetErrorExFmtVA($ci,
      $ErrorSign( $ErrorType::General, !isWarning, isWarning, code, exCode ),
      messageFmt, argList );
}

//==================================================================================================
} // RuntimeForStatic
