Changeset 53924 in vbox
- Timestamp:
- Jan 22, 2015 3:57:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/websrv-cpp.xsl
r50117 r53924 46 46 <xsl:variable name="G_setSuppressedInterfaces" 47 47 select="//interface[@wsmap='suppress']" /> 48 49 <!-- - - - - - - - - - - - - - - - - - - - - - - 50 Keys for more efficiently looking up of types. 51 - - - - - - - - - - - - - - - - - - - - - - --> 52 53 <xsl:key name="G_keyEnumsByName" match="//enum[@name]" use="@name"/> 54 <xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/> 48 55 49 56 <!-- - - - - - - - - - - - - - - - - - - - - - - … … 272 279 <xsl:call-template name="emitNewline" /> 273 280 274 <xsl:for-each select=" //interface[@name=$structname]/attribute">281 <xsl:for-each select="key('G_keyInterfacesByName', $structname)/attribute"> 275 282 <xsl:if test="not(@wsmap = 'suppress')"> 276 283 <xsl:value-of select="concat(' // -- ', $structname, '.', @name)" /> … … 390 397 </xsl:call-template> 391 398 </xsl:when> 392 <xsl:when test=" //enum[@name=$type]">399 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0"> 393 400 <xsl:call-template name="emitTypeOrArray"> 394 401 <xsl:with-param name="type" select="concat($type, '_T ')"/> … … 406 413 </xsl:choose> 407 414 </xsl:when> 408 <xsl:when test=" //interface[@name=$type]">409 <xsl:variable name="thatif" select=" //interface[@name=$type]" />415 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0"> 416 <xsl:variable name="thatif" select="key('G_keyInterfacesByName', $type)" /> 410 417 <xsl:variable name="thatifname" select="$thatif/@name" /> 411 418 <xsl:choose> … … 579 586 <xsl:value-of select="concat(' IUnknown *tmpObject2(tmpObject); tmpObject2->AddRef(); comcall_', $name, '[i] = tmpObject;')" /> 580 587 </xsl:when> 581 <xsl:when test=" //interface[@name=$type]">588 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0"> 582 589 <xsl:value-of select="concat(' ComPtr<', $type, '> tmpObject;')" /> 583 590 <xsl:call-template name="emitNewlineIndent8" /> … … 609 616 <xsl:value-of select="concat(' comcall_', $name, '[i] = ', $structprefix, $name, '[i];')" /> 610 617 </xsl:when> 611 <xsl:when test=" //enum[@name=$type]">618 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0"> 612 619 <xsl:call-template name="emitNewlineIndent8" /> 613 620 <xsl:value-of select="concat(' comcall_', $name, '[i] = ', $G_funcPrefixInputEnumConverter, $type, '(', $structprefix, $name, '[i]);')" /> … … 634 641 <xsl:value-of select="concat(' comcall_', $name, '(', $structprefix, $name, '.c_str())')" /> 635 642 </xsl:when> 636 <xsl:when test=" //enum[@name=$type]">643 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0"> 637 644 <xsl:value-of select="concat(' comcall_', $name, ' = ', $G_funcPrefixInputEnumConverter, $type, '(', $structprefix, $name, ')')" /> 638 645 </xsl:when> … … 644 651 <xsl:text> break</xsl:text> 645 652 </xsl:when> 646 <xsl:when test=" //interface[@name=$type]">653 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0"> 647 654 <!-- the type is one of our own interfaces: then it must have a wsmap attr --> 648 <xsl:variable name="thatif" select=" //interface[@name=$type]" />655 <xsl:variable name="thatif" select="key('G_keyInterfacesByName', $type)" /> 649 656 <xsl:variable name="wsmap" select="$thatif/@wsmap" /> 650 657 <xsl:variable name="thatifname" select="$thatif/@name" /> … … 771 778 or ($type='unsigned long long') 772 779 or ($type='result') 773 or ( //enum[@name=$type])">780 or (count(key('G_keyEnumsByName', $type)) > 0)"> 774 781 <xsl:text>&</xsl:text><xsl:value-of select="$varname" /> 775 782 </xsl:when> … … 900 907 <xsl:value-of select="$varname" /> 901 908 </xsl:when> 902 <xsl:when test=" //enum[@name=$type]">909 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0"> 903 910 <xsl:value-of select="concat($G_funcPrefixOutputEnumConverter, $type, '(', $varname, ')')" /> 904 911 </xsl:when> … … 906 913 <xsl:value-of select="concat('createOrFindRefFromComPtr(idThis, g_pcszIUnknown, ', $varname, ')')" /> 907 914 </xsl:when> 908 <xsl:when test=" //interface[@name=$type]">915 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0"> 909 916 <!-- the type is one of our own interfaces: then it must have a wsmap attr --> 910 <xsl:variable name="thatif" select=" //interface[@name=$type]" />917 <xsl:variable name="thatif" select="key('G_keyInterfacesByName', $type)" /> 911 918 <xsl:variable name="wsmap" select="$thatif/@wsmap" /> 912 919 <xsl:variable name="thatifname" select="$thatif/@name" /> … … 993 1000 <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename" /> 994 1001 <xsl:choose> 995 <xsl:when test=" //interface[@name=$type]">1002 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0"> 996 1003 <xsl:value-of select="concat(' ComPtr<', $type, '> tmpObject(', $varname, '[i]);')" /> 997 1004 </xsl:when> 998 <xsl:when test=" //enum[@name=$type]">1005 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0"> 999 1006 <xsl:value-of select="concat(' ', $type, '_T tmpObject(', $varname, '[i]);')" /> 1000 1007 </xsl:when> … … 1268 1275 <xsl:text> 1269 1276 * 1270 ****************************************************************************/ 1271 </xsl:text>1277 ****************************************************************************/</xsl:text> 1278 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1272 1279 1273 1280 <!--
Note:
See TracChangeset
for help on using the changeset viewer.