~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to include/VBox/com/SupportErrorInfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
 */
224
224
class SupportErrorInfoBase
225
225
{
226
 
    static HRESULT setErrorInternal (HRESULT aResultCode, const GUID *aIID,
227
 
                                     const char *aComponent, const char *aText,
228
 
                                     bool aWarning,
229
 
                                     IVirtualBoxErrorInfo *aInfo = NULL);
 
226
    static HRESULT setErrorInternal(HRESULT aResultCode,
 
227
                                    const GUID *aIID,
 
228
                                    const char *aComponent,
 
229
                                    const Utf8Str &strText,
 
230
                                    bool aWarning,
 
231
                                    IVirtualBoxErrorInfo *aInfo = NULL);
230
232
 
231
233
protected:
232
234
 
291
293
     *         while setting error info itself, that error is returned instead
292
294
     *         of the @a aResultCode argument.
293
295
     */
294
 
    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
295
 
                             const char *aComponent, const char *aText)
296
 
    {
297
 
        return setErrorInternal (aResultCode, &aIID, aComponent, aText,
298
 
                                 false /* aWarning */);
 
296
    static HRESULT setError(HRESULT aResultCode,
 
297
                            const GUID &aIID,
 
298
                            const char *aComponent,
 
299
                            const char *aText)
 
300
    {
 
301
        return setErrorInternal(aResultCode,
 
302
                                &aIID,
 
303
                                aComponent,
 
304
                                aText,
 
305
                                false /* aWarning */);
 
306
    }
 
307
 
 
308
    static HRESULT setError(HRESULT aResultCode,
 
309
                            const GUID &aIID,
 
310
                            const char *aComponent,
 
311
                            const Utf8Str &strText)
 
312
    {
 
313
        return setErrorInternal(aResultCode,
 
314
                                &aIID,
 
315
                                aComponent,
 
316
                                strText,
 
317
                                false /* aWarning */);
299
318
    }
300
319
 
301
320
    /**
307
326
     * use ordinary E_XXX result code constants, for convenience. However, this
308
327
     * behavior may be non-standard on some COM platforms.
309
328
     */
310
 
    static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID,
311
 
                               const char *aComponent, const char *aText)
 
329
    static HRESULT setWarning(HRESULT aResultCode,
 
330
                              const GUID &aIID,
 
331
                              const char *aComponent,
 
332
                              const char *aText)
312
333
    {
313
 
        return setErrorInternal (aResultCode, &aIID, aComponent, aText,
314
 
                                 true /* aWarning */);
 
334
        return setErrorInternal(aResultCode,
 
335
                                &aIID,
 
336
                                aComponent,
 
337
                                aText,
 
338
                                true /* aWarning */);
315
339
    }
316
340
 
317
341
    /**
319
343
     * interprets the @a aText argument as a RTPrintf-like format string and the
320
344
     * @a aArgs argument as an argument list for this format string.
321
345
     */
322
 
    static HRESULT setErrorV (HRESULT aResultCode, const GUID &aIID,
323
 
                              const char *aComponent, const char *aText,
324
 
                              va_list aArgs)
 
346
    static HRESULT setErrorV(HRESULT aResultCode, const GUID &aIID,
 
347
                             const char *aComponent, const char *aText,
 
348
                             va_list aArgs)
325
349
    {
326
 
        return setErrorInternal (aResultCode, &aIID, aComponent,
327
 
                                 Utf8StrFmtVA (aText, aArgs),
328
 
                                 false /* aWarning */);
 
350
        return setErrorInternal(aResultCode, &aIID, aComponent,
 
351
                                Utf8StrFmtVA(aText, aArgs),
 
352
                                false /* aWarning */);
329
353
    }
330
354
 
331
355
    /**
333
357
     * but interprets the @a aText argument as a RTPrintf-like format string and
334
358
     * the @a aArgs argument as an argument list for this format string.
335
359
     */
336
 
    static HRESULT setWarningV (HRESULT aResultCode, const GUID &aIID,
337
 
                                const char *aComponent, const char *aText,
338
 
                                va_list aArgs)
 
360
    static HRESULT setWarningV(HRESULT aResultCode, const GUID &aIID,
 
361
                               const char *aComponent, const char *aText,
 
362
                               va_list aArgs)
339
363
    {
340
 
        return setErrorInternal (aResultCode, &aIID, aComponent,
341
 
                                 Utf8StrFmtVA (aText, aArgs),
342
 
                                 true /* aWarning */);
 
364
        return setErrorInternal(aResultCode, &aIID,
 
365
                                aComponent,
 
366
                                Utf8StrFmtVA(aText, aArgs),
 
367
                                true /* aWarning */);
343
368
    }
344
369
 
345
370
    /**
347
372
     * interprets the @a aText argument as a RTPrintf-like format string and
348
373
     * takes a variable list of arguments for this format string.
349
374
     */
350
 
    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
351
 
                             const char *aComponent, const char *aText,
352
 
                             ...);
 
375
    static HRESULT setError(HRESULT aResultCode,
 
376
                            const GUID &aIID,
 
377
                            const char *aComponent,
 
378
                            const char *aText,
 
379
                            ...);
353
380
 
354
381
    /**
355
382
     * Same as #setWarning (HRESULT, const GUID &, const char *, const char *)
356
383
     * but interprets the @a aText argument as a RTPrintf-like format string and
357
384
     * takes a variable list of arguments for this format string.
358
385
     */
359
 
    static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID,
360
 
                               const char *aComponent, const char *aText,
361
 
                               ...);
 
386
    static HRESULT setWarning(HRESULT aResultCode, const GUID &aIID,
 
387
                              const char *aComponent, const char *aText,
 
388
                              ...);
362
389
 
363
390
    /**
364
391
     * Sets the given error info object on the current thread.
369
396
     *
370
397
     * @param aInfo     Error info object to set (must not be NULL).
371
398
     */
372
 
    static HRESULT setErrorInfo (IVirtualBoxErrorInfo *aInfo)
 
399
    static HRESULT setErrorInfo(IVirtualBoxErrorInfo *aInfo)
373
400
    {
374
401
        AssertReturn (aInfo != NULL, E_FAIL);
375
 
        return setErrorInternal (0, NULL, NULL, NULL, false, aInfo);
 
402
        return setErrorInternal(0, NULL, NULL, Utf8Str::Null, false, aInfo);
376
403
    }
377
404
 
378
405
    /**
393
420
     *     return rc;
394
421
     * </code>
395
422
     */
396
 
    HRESULT setError (HRESULT aResultCode, const char *aText, ...);
 
423
    HRESULT setError(HRESULT aResultCode, const char *aText, ...);
 
424
 
 
425
    HRESULT setError(HRESULT aResultCode, const Utf8Str &strText);
397
426
 
398
427
    /**
399
428
     * Same as #setWarning (HRESULT, const GUID &, const char *, const char *,