reman3/Rayman_X/cpa/public/ERO/ErO_Err.hpp

172 lines
6.8 KiB
C++

/* Err.h : main header file for the ERR DLL*/
/*//////////////////////////////////////////////////*/
#ifndef _ERROR_OPERATOR_MAIN_INCLUDE_
#define _ERROR_OPERATOR_MAIN_INCLUDE_
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000*/
/****************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/****************************************/
#include "ErO_DgEr.hpp"
#include "ErO_Op.hpp"
extern CPA_EXPORT void ERROR_g_fn_vSetGlobalInfo( CString,
CString,
enum ERROR_eErrorGravity,
CString,
CString _csModuleName = "");
extern CPA_EXPORT void ERROR_g_fn_vSetSourceInfo( CString,
short,
CString);
extern CPA_EXPORT void ERROR_g_fn_vResetGlobalInfo();
extern CPA_EXPORT void ERROR_g_fn_vResetSourceInfo();
extern CPA_EXPORT void ERROR_g_fn_vSetScriptInfo(CString, short);
extern CPA_EXPORT void ERROR_g_fn_vResetScriptInfo();
extern CPA_EXPORT void ERROR_g_fn_vAddAModuleDescriptor(CString _csModuleName,
CString _csModuleVersion,
CString _csMainProgrammerName,
CString _csMainProgrammerPhoneNumber,
CString _csMainProgrammerEMailAddress,
CString _csResponsibleName,
CString _csResponsiblePhoneNumber,
CString _csResponsibleEMailAddress,
CString _csSecondProgrammerName,
CString _csSecondProgrammerPhoneNumber,
CString _csSecondProgrammerEMailAddress
);
/*--------------------------------------------------------------------------------*/
/*------------------------------------ Debug version -----------------------------*/
/*--------------------------------------------------------------------------------*/
#ifdef _DEBUG
/*=========================================*/
/*================ ASSERT =================*/
/*=========================================*/
#define ERROR_ASSERT( BoolValueToEvaluate ) \
if ( !( BoolValueToEvaluate ) ) \
{ \
ERROR_g_fn_vSetSourceInfo(__FILE__, \
__LINE__, \
__TIMESTAMP__); \
ERROR_Dialog_ErrorInformations ErrInfoDial; \
\
if ( ErrInfoDial.DoModal() == IDOK ) \
{ \
AfxDebugBreak(); \
} \
\
ERROR_g_fn_vResetSourceInfo(); \
} \
\
ERROR_g_fn_vResetGlobalInfo();
/*=========================================*/
/*================ VERIFY =================*/
/*=========================================*/
#define ERROR_VERIFY( BoolValueToEvaluate ) ERROR_ASSERT( BoolValueToEvaluate )
/*--------------------------------------------------------------------------------*/
/*----------------------------------- Release version ----------------------------*/
/*--------------------------------------------------------------------------------*/
#else /*_DEBUG*/
/*///////////////////*/
/*Does nothing*/
/*=========================================*/
/*================ ASSERT =================*/
/*=========================================*/
#define ERROR_ASSERT( BoolValueToEvaluate )
/*=========================================*/
/*================ VERIFY =================*/
/*=========================================*/
/*///////////////////*/
/*Just realizes the Action*/
#define ERROR_VERIFY( BoolValueToEvaluate ) BoolValueToEvaluate;
#endif /*_DEBUG*/
/*--------------------------------------------------------------------------------*/
/*----------------------------------- Both versions ------------------------------*/
/*--------------------------------------------------------------------------------*/
/*///////////////////*/
/*Always tests the Action, and displays a message in case of FALSE value*/
/*=========================================*/
/*================= CHECK =================*/
/*=========================================*/
#define ERROR_CHECK( BoolValueToEvaluate ) \
if ( !( BoolValueToEvaluate ) ) \
{ \
ERROR_g_fn_vSetSourceInfo(__FILE__, \
__LINE__, \
__TIMESTAMP__); \
ERROR_Dialog_ErrorInformations ErrInfoDial; \
\
if ( ErrInfoDial.DoModal() == IDOK ) \
{ \
AfxDebugBreak(); \
} \
\
ERROR_g_fn_vResetSourceInfo(); \
} \
\
ERROR_g_fn_vResetGlobalInfo();
/*///////////////////*/
/* Global info*/
/*=========================================*/
#define ERROR_PREPARE(Action, \
Function, \
ErrorGravity, \
MoreInfo) \
ERROR_g_fn_vSetGlobalInfo(Action, Function, ErrorGravity, MoreInfo);
/*=========================================*/
#define ERROR_PREPARE_M(Module, \
Action, \
Function, \
ErrorGravity, \
MoreInfo) \
ERROR_g_fn_vSetGlobalInfo(Action, Function, ErrorGravity, MoreInfo, Module);
/*///////////////////*/
/* For scripts*/
/*=========================================*/
#define ERROR_SET_SCRIPT_INFO(File) \
ERROR_g_fn_vSetScriptInfo(File->a_szOpenFileName, \
fnp_st_Cxt_Compute(0)->stPosition.uiLineInFile);
#define ERROR_RESET_SCRIPT_INFO \
ERROR_g_fn_vResetScriptInfo();
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
#endif /* _ERROR_OPERATOR_MAIN_INCLUDE_*/