FBX C++ API Reference
FbxStatus Class Reference

This class facilitates the testing/reporting of errors. More...

#include <fbxstatus.h>

Public Types

enum  EStatusCode {
  eSuccess = 0, eFailure, eInsufficientMemory, eInvalidParameter,
  eIndexOutOfRange, ePasswordError, eInvalidFileVersion, eInvalidFile,
  eSceneCheckFail
}
 Available status codes. More...
 

Public Member Functions

 FbxStatus ()
 Default constructor. More...
 
 FbxStatus (EStatusCode pCode)
 
 FbxStatus (const FbxStatus &rhs)
 
 ~FbxStatus ()
 
FbxStatusoperator= (const FbxStatus &rhs)
 
FbxStatusoperator+= (const FbxStatus &rhs)
 
bool operator== (const FbxStatus &rhs) const
 Equivalence operator. More...
 
bool operator== (const EStatusCode pCode) const
 Equivalence operator. More...
 
bool operator!= (const FbxStatus &rhs) const
 Non-Equivalence operator. More...
 
bool operator!= (const EStatusCode rhs) const
 Non-Equivalence operator. More...
 
 operator bool () const
 The conversion operator that converts a FbxStatus object to bool. More...
 
bool Error () const
 Determines whether there is an error. More...
 
void Clear ()
 Clear error code and message from the instance. After this call, it will behave as if it contained eSuccess. More...
 
EStatusCode GetCode () const
 Retrieve the type of error that occurred, as specified in the enumeration. More...
 
void SetCode (const EStatusCode rhs)
 Change the current code of the instance. More...
 
void SetCode (const EStatusCode rhs, const char *pErrorMsg,...)
 Change the current code of the instance. More...
 
const char * GetErrorString () const
 Get the error message string corresponding to the current code. More...
 
bool KeepErrorStringHistory (bool pState)
 Configure this object to remember all the error messages string. More...
 
void GetErrorStringHistory (FbxArray< FbxString * > &pHistory)
 Get the history of all the error messages that have been set. More...
 

Detailed Description

This class facilitates the testing/reporting of errors.

It encapsulates the status code and the internal FBXSDK error code as returned by the API functions. By default, the class will not accumulate all the error messages into the history array. If this history is desired, the object must be configured by calling KeepErrorStringHistory(true)

Examples:
ExportScene03/main.cxx, and ViewScene/SceneContext.cxx.

Definition at line 29 of file fbxstatus.h.

Member Enumeration Documentation

Available status codes.

Enumerator
eSuccess 

Operation was successful.

eFailure 

Operation failed.

eInsufficientMemory 

Operation failed due to insufficient memory.

eInvalidParameter 

An invalid parameter was provided.

eIndexOutOfRange 

Index value outside the valid range.

ePasswordError 

Operation on FBX file password failed.

eInvalidFileVersion 

File version not supported (anymore or yet)

eInvalidFile 

Operation on the file access failed.

eSceneCheckFail 

Scene validation failure.

Definition at line 35 of file fbxstatus.h.

35  {
36  eSuccess = 0,
37  eFailure,
43  eInvalidFile,
45  };
Index value outside the valid range.
Definition: fbxstatus.h:40
Operation was successful.
Definition: fbxstatus.h:36
An invalid parameter was provided.
Definition: fbxstatus.h:39
Operation on FBX file password failed.
Definition: fbxstatus.h:41
Operation on the file access failed.
Definition: fbxstatus.h:43
Scene validation failure.
Definition: fbxstatus.h:44
Operation failed.
Definition: fbxstatus.h:37
Operation failed due to insufficient memory.
Definition: fbxstatus.h:38
File version not supported (anymore or yet)
Definition: fbxstatus.h:42

Constructor & Destructor Documentation

FbxStatus ( )

Default constructor.

FbxStatus ( EStatusCode  pCode)
FbxStatus ( const FbxStatus rhs)
~FbxStatus ( )

Member Function Documentation

FbxStatus& operator= ( const FbxStatus rhs)
FbxStatus& operator+= ( const FbxStatus rhs)
bool operator== ( const FbxStatus rhs) const
inline

Equivalence operator.

Parameters
rhsStatus object to compare.
Returns
True if all the members of rhs are equal to this instance members and False otherwise.

Definition at line 61 of file fbxstatus.h.

61 { return (mCode == rhs.mCode); }
bool operator== ( const EStatusCode  pCode) const
inline

Equivalence operator.

Parameters
pCodeStatus code to compare.
Returns
True if the code member of this instance equals pCode and False otherwise.

Definition at line 66 of file fbxstatus.h.

66 { return (mCode == pCode); }
bool operator!= ( const FbxStatus rhs) const
inline

Non-Equivalence operator.

Parameters
rhsStatus object to compare.
Returns
True if at least one member of rhs is not equal to this instance member and True otherwise.

Definition at line 71 of file fbxstatus.h.

71 { return (mCode != rhs.mCode); }
bool operator!= ( const EStatusCode  rhs) const
inline

Non-Equivalence operator.

Parameters
rhsStatus code to compare.
Returns
True if the code member of this instance equals rhs and False otherwise.

Definition at line 76 of file fbxstatus.h.

76 { return (mCode != rhs); }
operator bool ( ) const
inline

The conversion operator that converts a FbxStatus object to bool.

The result it returns will be True if the FbxStatus does not contain an error, and False if it does.

Definition at line 82 of file fbxstatus.h.

82 { return mCode==eSuccess; }
Operation was successful.
Definition: fbxstatus.h:36
bool Error ( ) const
inline

Determines whether there is an error.

Returns
True if an error occured and False if the operation was sucessful.

Definition at line 87 of file fbxstatus.h.

87 { return !this->operator bool(); }
void Clear ( )

Clear error code and message from the instance. After this call, it will behave as if it contained eSuccess.

EStatusCode GetCode ( ) const
inline

Retrieve the type of error that occurred, as specified in the enumeration.

Examples:
Common/Common.cxx.

Definition at line 93 of file fbxstatus.h.

93 { return mCode; }
void SetCode ( const EStatusCode  rhs)

Change the current code of the instance.

Parameters
rhsNew code value.
void SetCode ( const EStatusCode  rhs,
const char *  pErrorMsg,
  ... 
)

Change the current code of the instance.

Parameters
rhsNew code value.
pErrorMsgOptional error description string. This string can have formatting characters The function will use the vsnprintf function to assemble the final string using an internal buffer of 4096 characters.
const char* GetErrorString ( ) const

Get the error message string corresponding to the current code.

Examples:
Common/Common.cxx, ConvertScene/main.cxx, ExportDocument/main.cxx, ExportScene03/main.cxx, and ExportScene05/main.cxx.
bool KeepErrorStringHistory ( bool  pState)

Configure this object to remember all the error messages string.

Parameters
pStateIf set to true, this object will record all the error messages that can later be access by calling GetErrorStringHistory(). If set to false, any recorded history is also cleared.
Returns
Previous state of the flag.
void GetErrorStringHistory ( FbxArray< FbxString * > &  pHistory)

Get the history of all the error messages that have been set.

Parameters
pHistoryArray that is going to be filled with the stored string.
Remarks
the strings are allocated with FbxNew so the pHistory array must be deleted using the statement FbxArrayDelete<FbxString*>(pHistory).
the error strings are returned in stack mode (last error -> first element)
Examples:
Common/Common.cxx.

The documentation for this class was generated from the following file: