108
106
* pointer available.
110
108
explicit ErrorInfo()
111
: mIsBasicAvailable (false), mIsFullAvailable (false)
116
* Constructs a new, "interfaceless" ErrorInfo instance that takes
117
* the error information possibly set on the current thread by an
118
* interface method of the given interface pointer.
120
* If the given interface does not support providing error information or,
121
* for some reason didn't set any error information, both
122
* #isFullAvailable() and #isBasicAvailable() will return |false|.
124
* @param aPtr pointer to the interface whose method returned an
127
template <class I> ErrorInfo (I *aPtr)
128
: mIsBasicAvailable (false), mIsFullAvailable (false)
130
{ init (aPtr, COM_IIDOF(I)); }
133
* Constructs a new ErrorInfo instance from the smart interface pointer.
134
* See template <class I> ErrorInfo (I *aPtr) for details
136
* @param aPtr smart pointer to the interface whose method returned
139
template <class I> ErrorInfo (const ComPtr <I> &aPtr)
140
: mIsBasicAvailable (false), mIsFullAvailable (false)
142
{ init (static_cast <I*> (aPtr), COM_IIDOF(I)); }
109
: mIsBasicAvailable(false),
110
mIsFullAvailable(false),
117
ErrorInfo(IUnknown *pObj, const GUID &aIID)
118
: mIsBasicAvailable(false),
119
mIsFullAvailable(false),
144
126
/** Specialization for the IVirtualBoxErrorInfo smart pointer */
145
127
ErrorInfo (const ComPtr <IVirtualBoxErrorInfo> &aPtr)
188
188
* The appropriate methods of this class provide meaningful info only when
189
189
* this method returns true (otherwise they simply return NULL-like values).
191
bool isFullAvailable() const { return mIsFullAvailable; }
194
* Returns @c true if both isBasicAvailable() and isFullAvailable() are
197
bool isNull() const { return !mIsBasicAvailable && !mIsFullAvailable; }
191
bool isFullAvailable() const
193
return mIsFullAvailable;
200
197
* Returns the COM result code of the failed operation.
202
HRESULT getResultCode() const { return mResultCode; }
199
HRESULT getResultCode() const
205
205
* Returns the IID of the interface that defined the error.
207
const Guid &getInterfaceID() const { return mInterfaceID; }
207
const Guid& getInterfaceID() const
210
213
* Returns the name of the component that generated the error.
212
const Bstr &getComponent() const { return mComponent; }
215
const Bstr& getComponent() const
215
221
* Returns the textual description of the error.
217
const Bstr &getText() const { return mText; }
223
const Bstr& getText() const
220
229
* Returns the next error information object or @c NULL if there is none.
222
const ErrorInfo *getNext() const { return mNext.get(); }
231
const ErrorInfo* getNext() const
225
237
* Returns the name of the interface that defined the error
227
const Bstr &getInterfaceName() const { return mInterfaceName; }
239
const Bstr& getInterfaceName() const
241
return mInterfaceName;
230
245
* Returns the IID of the interface that returned the error.
232
247
* This method returns a non-null IID only if the instance was created
233
* using #template <class I> ErrorInfo (I *i) or
234
* template <class I> ErrorInfo (const ComPtr <I> &i) constructor.
248
* using #template <class I> ErrorInfo(I *i) or
249
* template <class I> ErrorInfo(const ComPtr<I> &i) constructor.
236
const Guid &getCalleeIID() const { return mCalleeIID; }
251
const Guid& getCalleeIID() const
239
257
* Returns the name of the interface that returned the error
241
259
* This method returns a non-null name only if the instance was created
242
* using #template <class I> ErrorInfo (I *i) or
243
* template <class I> ErrorInfo (const ComPtr <I> &i) constructor.
260
* using #template <class I> ErrorInfo(I *i) or
261
* template <class I> ErrorInfo(const ComPtr<I> &i) constructor.
245
const Bstr &getCalleeName() const { return mCalleeName; }
263
const Bstr& getCalleeName() const
248
* Resets all collected error information. #isNull() will
249
* return @c true after this method is called.
269
* Resets all collected error information. #isBasicAvailable() and
270
* #isFullAvailable will return @c true after this method is called.
253
mIsBasicAvailable = false;
254
mIsFullAvailable = false;
257
mInterfaceID.clear();
258
mComponent.setNull();
261
mInterfaceName.setNull();
263
mCalleeName.setNull();
264
mErrorInfo.setNull();
269
ErrorInfo (bool /* aDummy */)
270
: mIsBasicAvailable (false), mIsFullAvailable (false)
274
void init (bool aKeepObj = false);
275
void init (IUnknown *aUnk, const GUID &aIID, bool aKeepObj = false);
276
void init (IVirtualBoxErrorInfo *aInfo);
279
ErrorInfo(bool /* aDummy */)
280
: mIsBasicAvailable(false),
281
mIsFullAvailable(false),
286
void copyFrom(const ErrorInfo &x);
289
void init(bool aKeepObj = false);
290
void init(IUnknown *aUnk, const GUID &aIID, bool aKeepObj = false);
291
void init(IVirtualBoxErrorInfo *aInfo);
278
293
bool mIsBasicAvailable : 1;
279
294
bool mIsFullAvailable : 1;