fbxsdk/core/base/fbxstatus.h Source File

fbxstatus.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_BASE_STATUS_H_
14 #define _FBXSDK_CORE_BASE_STATUS_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
27 {
28 public:
29 
30 
32  enum EStatusCode {
33  eSuccess = 0,
40  eInvalidFile
41  };
42 
44  FbxStatus();
45 
46  FbxStatus(EStatusCode pCode);
47  FbxStatus(const FbxStatus& rhs);
48 
49  FbxStatus& operator=(const FbxStatus& rhs);
50 
55  bool operator==(const FbxStatus& rhs) const { return (mCode == rhs.mCode); }
60  bool operator==(const EStatusCode pCode) const { return (mCode == pCode); }
65  bool operator!=(const FbxStatus& rhs) const { return (mCode != rhs.mCode); }
70  bool operator!=(const EStatusCode rhs) const { return (mCode != rhs); }
71 
76  operator bool() const { return mCode==eSuccess; }
77 
81  bool Error() const { return !this->operator bool(); }
82 
84  void Clear();
85 
87  EStatusCode GetCode() const { return mCode; }
88 
92  void SetCode(const EStatusCode rhs);
93 
100  void SetCode(const EStatusCode rhs, const char* pErrorMsg, ...);
101 
103  const char* GetErrorString() const;
104 
105 /*****************************************************************************************************************************
106 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
107 *****************************************************************************************************************************/
108 #ifndef DOXYGEN_SHOULD_SKIP_THIS
109 
110 private:
111  EStatusCode mCode;
112  FbxString mErrorString;
113 
114 #endif /* !DOXYGEN_SHOULD_SKIP_THIS */
115 };
116 
117 #include <fbxsdk/fbxsdk_nsend.h>
118 
119 #endif /* _FBXSDK_CORE_BASE_STATUS_H_ */
Index value outside the valid range.
Definition: fbxstatus.h:37
FBX SDK environment definition.
bool operator==(const EStatusCode pCode) const
Equivalence operator.
Definition: fbxstatus.h:60
Utility class to manipulate strings.
Definition: fbxstring.h:66
An invalid parameter was provided.
Definition: fbxstatus.h:36
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
bool operator!=(const FbxStatus &rhs) const
Non-Equivalence operator.
Definition: fbxstatus.h:65
Operation on FBX file password failed.
Definition: fbxstatus.h:38
bool operator==(const FbxStatus &rhs) const
Equivalence operator.
Definition: fbxstatus.h:55
EStatusCode
Available status codes.
Definition: fbxstatus.h:32
#define FBXSDK_DLL
Definition: fbxarch.h:173
bool Error() const
Determines whether there is an error.
Definition: fbxstatus.h:81
Operation failed.
Definition: fbxstatus.h:34
Operation failed due to insufficient memory.
Definition: fbxstatus.h:35
EStatusCode GetCode() const
Retrieve the type of error that occurred, as specified in the enumeration.
Definition: fbxstatus.h:87
bool operator!=(const EStatusCode rhs) const
Non-Equivalence operator.
Definition: fbxstatus.h:70
File version not supported (anymore or yet)
Definition: fbxstatus.h:39