VirtualBox

Changeset 85315 in vbox for trunk/src/VBox/Main/idl


Ignore:
Timestamp:
Jul 13, 2020 5:32:13 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139293
Message:

Main/comimpl.xsl: Use Utf8Str to store strings internally in the event objects, normally saves a bit of space and puts off the string conversion till the attributes are queried. Fixed some missing error handling in the getter methods. bugref:9790

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/comimpl.xsl

    r85310 r85315  
    147147            </xsl:when>
    148148            <xsl:otherwise>
    149               <xsl:value-of select="'Bstr'"/>
     149              <xsl:value-of select="'Utf8Str'"/>
    150150            </xsl:otherwise>
    151151          </xsl:choose>
     
    263263      <xsl:value-of select="concat('         ', $member, ' = ', $param, ';&#10;')"/>
    264264      <xsl:if test="$internal!='yes'">
    265         <xsl:text>         return S_OK;&#10;</xsl:text>
     265        <xsl:text>        return S_OK;&#10;</xsl:text>
    266266      </xsl:if>
    267267    </xsl:otherwise>
     
    283283        </xsl:call-template>
    284284      </xsl:variable>
    285       <xsl:value-of select="concat('         SafeArray&lt;', $elemtype,'&gt; result;&#10;')"/>
    286       <xsl:value-of select="concat('         ', $member, '.cloneTo(result);&#10;')"/>
    287       <xsl:value-of select="concat('         result.detachTo(ComSafeArrayOutArg(', $param, '));&#10;')"/>
     285<!-- @todo String arrays probably needs work, I doubt we're generating sensible code for them at the moment. -->
     286      <xsl:text>        SafeArray&lt;</xsl:text><xsl:value-of select="$elemtype"/><xsl:text>&gt; result;&#10;</xsl:text>
     287      <xsl:text>        HRESULT hrc = </xsl:text><xsl:value-of select="$member"/><xsl:text>.cloneTo(result);&#10;</xsl:text>
     288      <xsl:text>        if (SUCCEEDED(hrc))&#10;</xsl:text>
     289      <xsl:text>            result.detachTo(ComSafeArrayOutArg(</xsl:text><xsl:value-of select="$param"/><xsl:text>));&#10;</xsl:text>
     290      <xsl:text>        return hrc;&#10;</xsl:text>
    288291    </xsl:when>
    289292    <xsl:otherwise>
    290293      <xsl:choose>
    291294        <xsl:when test="($type='wstring') or ($type = 'uuid')">
    292           <xsl:value-of select="concat('         ', $member, '.cloneTo(', $param, ');&#10;')"/>
     295          <xsl:text>        return </xsl:text><xsl:value-of select="$member"/><xsl:text>.cloneToEx(</xsl:text>
     296          <xsl:value-of select="$param"/><xsl:text>);&#10;</xsl:text>
    293297        </xsl:when>
    294298        <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0">
    295           <xsl:value-of select="concat('         ', $member, '.queryInterfaceTo(', $param, ');&#10;')"/>
     299          <xsl:text>        return </xsl:text><xsl:value-of select="$member"/><xsl:text>.queryInterfaceTo(</xsl:text>
     300          <xsl:value-of select="$param"/><xsl:text>);&#10;</xsl:text>
    296301        </xsl:when>
    297302        <xsl:otherwise>
    298           <xsl:value-of select="concat('         *', $param, ' = ', $member, ';&#10;')"/>
     303          <xsl:text>        *</xsl:text><xsl:value-of select="$param"/><xsl:text> = </xsl:text>
     304          <xsl:value-of select="$member"/><xsl:text>;&#10;</xsl:text>
     305          <xsl:text>        return S_OK;&#10;</xsl:text>
    299306        </xsl:otherwise>
    300307      </xsl:choose>
     
    544551      <xsl:with-param name="safearray" select="@safearray" />
    545552    </xsl:call-template>
    546     <xsl:value-of select="       '         return S_OK;&#10;'" />
    547553    <xsl:value-of select="       '    }&#10;'" />
    548554
Note: See TracChangeset for help on using the changeset viewer.

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