VirtualBox

Ignore:
Timestamp:
Feb 15, 2008 5:32:46 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt: Added support for warning result codes (#2673).

Location:
trunk/src/VBox/Frontends/VirtualBox/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/COMDefs.h

    r6900 r6975  
    195195     *  Returns error info set by the last unsuccessfully invoked interface
    196196     *  method. Returned error info is useful only if CInterface::lastRC()
    197      *  represents a failure (i.e. CInterface::isOk() is false).
     197     *  represents a failure or a warning (i.e. CInterface::isReallyOk() is
     198     *  false).
    198199     */
    199200    virtual COMErrorInfo errorInfo() const { return COMErrorInfo(); }
     
    473474     *  Returns error info set by the last unsuccessfully invoked interface
    474475     *  method. Returned error info is useful only if CInterface::lastRC()
    475      *  represents a failure (i.e. CInterface::isOk() is false).
     476     *  represents a failure or a warning (i.e. CInterface::isReallyOk() is
     477     *  false).
    476478     */
    477479    COMErrorInfo errorInfo() const { return mErrInfo; }
     
    517519
    518520    bool isNull() const { return mErrInfo.isNull(); }
    519     bool isOk() const { return mErrInfo.isNull() && SUCCEEDED (mRC); }
     521
     522    /**
     523     * Returns @c true if the result code repesents success (with or without
     524     * warnings).
     525     */
     526    bool isOk() const { return SUCCEEDED (mRC); }
     527
     528    /**
     529     * Returns @c true if the result code represends success with one or more
     530     * warnings.
     531     */
     532    bool isWarning() const { return SUCCEEDED_WARNING (mRC); }
     533
     534    /**
     535     * Returns @c true if the result code represends success with no warnings.
     536     */
     537    bool isReallyOk() const { return mRC == S_OK; }
    520538
    521539    COMErrorInfo errorInfo() const { return mErrInfo; }
     
    624642    bool isNull() const { return mIface == NULL; }
    625643
     644    /**
     645     * Returns @c true if the result code repesents success (with or without
     646     * warnings).
     647     */
    626648    bool isOk() const { return !isNull() && SUCCEEDED (B::mRC); }
     649
     650    /**
     651     * Returns @c true if the result code represends success with one or more
     652     * warnings.
     653     */
     654    bool isWarning() const { return !isNull() && SUCCEEDED_WARNING (B::mRC); }
     655
     656    /**
     657     * Returns @c true if the result code represends success with no warnings.
     658     */
     659    bool isReallyOk() const { return !isNull() && B::mRC == S_OK; }
    627660
    628661    /* utility operators */
  • trunk/src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl

    r6907 r6975  
    906906        <xsl:otherwise>
    907907            <xsl:if test="$supports='strict' or $supports='yes'">
    908                 <xsl:text>    if (FAILED (mRC))&#x0A;    {&#x0A;</xsl:text>
     908                <xsl:text>    if (mRC != S_OK)&#x0A;    {&#x0A;</xsl:text>
    909909                <xsl:text>        fetchErrorInfo (mIface, &amp;COM_IIDOF (Base::Iface));&#x0A;</xsl:text>
    910910                <xsl:if test="$supports='strict'">
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r5999 r6975  
    289289    static QString formatErrorInfo (const COMBase &aWrapper)
    290290    {
    291         Assert (FAILED (aWrapper.lastRC()));
     291        Assert (aWrapper.lastRC() != S_OK);
    292292        return formatErrorInfo (aWrapper.errorInfo(), aWrapper.lastRC());
    293293    }
     
    295295    static QString formatErrorInfo (const COMResult &aRC)
    296296    {
    297         Assert (FAILED (aRC.rc()));
     297        Assert (aRC.rc() != S_OK);
    298298        return formatErrorInfo (aRC.errorInfo(), aRC.rc());
    299299    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette