xsi_status.h
Go to the documentation of this file.
00001 //*****************************************************************************
00011 //*****************************************************************************
00012 
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016 
00017 #ifndef __XSISTATUS_H__
00018 #define __XSISTATUS_H__
00019 
00020 #include "sicppsdk.h"
00021 #include "xsi_string.h"
00022 
00023 
00024 namespace XSI {
00025 
00026 
00027 //*****************************************************************************
00034 //*****************************************************************************
00035 
00036 class SICPPSDKDECL CStatus
00037 {
00038 public:
00039 
00041     enum Code
00042     {
00043         Undefined = 0xFFFFFFFF,         
00044         OK = 0,                         
00045         False = 1,                      
00046         Fail = 0x80004005L,             
00047         InvalidArgument = 0x80070057L,  
00048         OutOfMemory = 0x8007000EL,      
00049         AccessDenied = 0x80070005L,     
00050         Unexpected = 0x8000FFFFL,       
00051         NotImpl = 0x80004001L,          
00052         MemberNotFound = 0x80020003L,   
00053         Abort = 0x80004004L,            
00054         BadVarType = 0x80020008L        
00055     } ;
00056 
00060     CStatus(Code in_code=OK);
00061 
00062     CStatus(LONG in_code);
00063 
00067     Code GetCode() const;
00068 
00072     bool Succeeded() const;
00073 
00077     void PutCode(Code in_code);
00078 
00082     CString GetDescription() const;
00083 
00088     CStatus & operator = ( Code in_code );
00089 
00094     bool  operator== ( const CStatus & rhs ) const;
00095 
00100     bool  operator== ( Code rhs ) const;
00101 
00106     bool  operator!= ( const CStatus & rhs ) const;
00107 
00112     bool  operator!= ( Code rhs ) const;
00113 
00118     void AssertSucceeded( const CString& in_strText = CString()) const;
00119 
00120 private:
00121     Code m_code;
00122 };
00123 
00130 SICPPSDKDECL bool  operator== ( CStatus::Code lhs, const CStatus & rhs);
00131 
00138 SICPPSDKDECL bool  operator!= ( CStatus::Code lhs, const CStatus & rhs);
00139 
00140 
00141 //*****************************************************************************
00149 //*****************************************************************************
00150 class SICPPSDKDECL CScriptErrorDescriptor : public CStatus
00151 {
00152 public:
00156     CScriptErrorDescriptor(CStatus::Code in_code=OK);
00157 
00161     CScriptErrorDescriptor(LONG in_code);
00162 
00167     CString GetDescription() const ;
00168 
00173     ULONG GetErrorLineNumber() const ;
00174 
00175     void PutDescription(const CString & in_strDescription);
00176     void PutErrorLineNumber(ULONG in_ulLineNumber);
00177     ~CScriptErrorDescriptor();
00178     CScriptErrorDescriptor( const CScriptErrorDescriptor & ) ;
00179     CScriptErrorDescriptor& operator=( const CScriptErrorDescriptor & ) ;
00180 
00181 private:
00182     void * m_pData ;
00183 } ;
00184 
00185 
00186 };
00187 
00188 
00189 
00190 #endif // __XSISTATUS_H__