FBX C++ API Reference
FbxStatus Class Reference

#include <fbxstatus.h>

Class 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.

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

Definition at line 26 of file 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)
 
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...
 

Member Enumeration Documentation

◆ EStatusCode

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 32 of file fbxstatus.h.

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

Constructor & Destructor Documentation

◆ FbxStatus() [1/3]

FbxStatus ( )

Default constructor.

◆ FbxStatus() [2/3]

FbxStatus ( EStatusCode  pCode)

◆ FbxStatus() [3/3]

FbxStatus ( const FbxStatus rhs)

Member Function Documentation

◆ operator=()

FbxStatus& operator= ( const FbxStatus rhs)

◆ operator==() [1/2]

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 56 of file fbxstatus.h.

56 { return (mCode == rhs.mCode); }

◆ operator==() [2/2]

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 61 of file fbxstatus.h.

61 { return (mCode == pCode); }

◆ operator!=() [1/2]

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 66 of file fbxstatus.h.

66 { return (mCode != rhs.mCode); }

◆ operator!=() [2/2]

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 71 of file fbxstatus.h.

71 { return (mCode != rhs); }

◆ operator bool()

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 77 of file fbxstatus.h.

77 { return mCode==eSuccess; }
Operation was successful.
Definition: fbxstatus.h:33

◆ Error()

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 82 of file fbxstatus.h.

82 { return !this->operator bool(); }

◆ Clear()

void Clear ( )

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

◆ GetCode()

EStatusCode GetCode ( ) const
inline

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

Examples:
Common/Common.cxx.

Definition at line 88 of file fbxstatus.h.

88 { return mCode; }

◆ SetCode() [1/2]

void SetCode ( const EStatusCode  rhs)

Change the current code of the instance.

Parameters
rhsNew code value.

◆ SetCode() [2/2]

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.

◆ GetErrorString()

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.

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