Changeset 42667 in vbox for trunk/src/VBox/Main/webservice
- Timestamp:
- Aug 7, 2012 3:51:08 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 79865
- Location:
- trunk/src/VBox/Main/webservice
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/websrv-cpp.xsl
r42129 r42667 245 245 <xsl:value-of select="concat('// COM interface ', $structname, ', which has wsmap="struct", to SOAP structures')" /> 246 246 <xsl:call-template name="emitNewline" /> 247 <xsl:value-of select="concat('vbox__', $structname, '* ', $G_funcPrefixOutput EnumConverter, $structname, '(')" />247 <xsl:value-of select="concat('vbox__', $structname, '* ', $G_funcPrefixOutputStructConverter, $structname, '(')" /> 248 248 <xsl:call-template name="emitNewline" /> 249 249 <xsl:value-of select="' struct soap *soap,'" /> … … 265 265 <xsl:value-of select="concat(' resp = soap_new_vbox__', $structname, '(soap, -1);')" /> 266 266 <xsl:call-template name="emitNewline" /> 267 <xsl:text> if (!in) </xsl:text> 268 <xsl:text> { </xsl:text> 269 <xsl:text> // @todo ambiguous. Problem is the MOR for the object converted to struct </xsl:text> 270 <xsl:text> RaiseSoapInvalidObjectFault(soap, ""); </xsl:text> 271 <xsl:text> break; </xsl:text> 272 <xsl:text> } </xsl:text> 267 273 <xsl:call-template name="emitNewline" /> 268 274 … … 630 636 <xsl:text> break</xsl:text> 631 637 </xsl:when> 632 <xsl:when test=" (//interface[@name=$type]) or (//collection[@name=$type])">638 <xsl:when test="//interface[@name=$type]"> 633 639 <!-- the type is one of our own interfaces: then it must have a wsmap attr --> 634 <xsl:variable name="thatif" select=" (//interface[@name=$type]) | (//collection[@name=$type])" />640 <xsl:variable name="thatif" select="//interface[@name=$type]" /> 635 641 <xsl:variable name="wsmap" select="$thatif/@wsmap" /> 636 642 <xsl:variable name="thatifname" select="$thatif/@name" /> … … 908 914 <!-- <xsl:call-template name="fatalError"><xsl:with-param name="msg" select="concat('emitOutputArgBackConverter2: attempted infinite recursion for type "', $type, '" in arg "', $name, '" of method "', $ifname, '::', $method)" /></xsl:call-template> --> 909 915 <xsl:if test="not($callerprefix)"> 910 <xsl:value-of select="concat('/* convert COM interface to struct */ ', $G_funcPrefixOutput EnumConverter, $type, '(soap, idThis, rc, ', $varname, ')')" />916 <xsl:value-of select="concat('/* convert COM interface to struct */ ', $G_funcPrefixOutputStructConverter, $type, '(soap, idThis, rc, ', $varname, ')')" /> 911 917 </xsl:if> 912 918 </xsl:when> … … 917 923 </xsl:otherwise> 918 924 </xsl:choose> 919 </xsl:when>920 <xsl:when test="//collection[@name=$type]">921 <!-- the type is a collection of our own types: then build an array from it -->922 <xsl:variable name="collectiontype" select="//collection[@name=$type]/@type" />923 <xsl:variable name="targetwsmap" select="//interface[@name=$collectiontype]/@wsmap" />924 <xsl:value-of select="concat('soap_new_vbox__ArrayOf', $collectiontype, '(soap, -1);')" />925 <xsl:call-template name="emitNewlineIndent8" />926 <xsl:variable name="enumerator" select="concat('comcall_', $callerprefix, $name, '_enum')" />927 <xsl:value-of select="concat('ComPtr<', $collectiontype, 'Enumerator> ', $enumerator, ';')" />928 <xsl:call-template name="emitNewlineIndent8" />929 <xsl:value-of select="concat('CHECK_ERROR_BREAK( comcall_', $callerprefix, $name, ', Enumerate(', $enumerator, '.asOutParam()) );')" />930 <xsl:call-template name="emitNewlineIndent8" />931 <xsl:value-of select="concat('BOOL comcall_', $callerprefix, $name, '_hasmore = FALSE;')" />932 <xsl:call-template name="emitNewlineIndent8" />933 <xsl:value-of select="'do {'" />934 <xsl:call-template name="emitNewlineIndent8" />935 <xsl:value-of select="concat(' CHECK_ERROR_BREAK( ', $enumerator, ', HasMore(&comcall_', $callerprefix, $name, '_hasmore) );')" />936 <xsl:call-template name="emitNewlineIndent8" />937 <xsl:value-of select="concat(' if (!comcall_', $callerprefix, $name, '_hasmore) break;')" />938 <xsl:call-template name="emitNewlineIndent8" />939 <xsl:value-of select="concat(' ComPtr<', $collectiontype, '> arrayitem;')" />940 <xsl:call-template name="emitNewlineIndent8" />941 <xsl:value-of select="concat(' CHECK_ERROR_BREAK( ', $enumerator, ', GetNext(arrayitem.asOutParam()) );')" />942 <xsl:call-template name="emitNewlineIndent8" />943 <xsl:value-of select="concat(' // collection of "', $collectiontype, '", target interface wsmap: "', $targetwsmap, '"')" />944 <xsl:call-template name="emitNewlineIndent8" />945 <xsl:value-of select="concat(' ', $G_responseElementVarName, '->', $G_result)" />946 <xsl:value-of select="'->array.push_back('" />947 <xsl:choose>948 <xsl:when test="($targetwsmap='managed')">949 <xsl:value-of select="concat('createOrFindRefFromComPtr(idThis, g_pcsz', $collectiontype, ', arrayitem));')" />950 </xsl:when>951 <xsl:when test="$targetwsmap='struct'">952 <xsl:value-of select="concat($G_funcPrefixOutputEnumConverter, $collectiontype, '(soap, idThis, rc, arrayitem));')" />953 </xsl:when>954 <xsl:otherwise>955 <xsl:call-template name="fatalError">956 <xsl:with-param name="msg" select="concat('emitOutputArgBackConverter2: Type "', $collectiontype, '" of collection "', $type, '", used in method "', $method, '", has unsupported wsmap "', $targetwsmap, '".')" />957 </xsl:call-template>958 </xsl:otherwise>959 </xsl:choose>960 <xsl:call-template name="emitNewlineIndent8" />961 <xsl:value-of select="'} while (1)'" />962 925 </xsl:when> 963 926 <xsl:otherwise> -
trunk/src/VBox/Main/webservice/websrv-shared.inc.xsl
r32728 r42667 151 151 select='"_USCOREthis"' /> 152 152 153 <!-- type to represent enums with 153 <!-- type to represent enums within C++ COM callers --> 154 154 <xsl:variable name="G_funcPrefixInputEnumConverter" 155 155 select='"EnumSoap2Com_"' /> 156 156 <xsl:variable name="G_funcPrefixOutputEnumConverter" 157 157 select='"EnumCom2Soap_"' /> 158 159 <!-- type to represent structs within C++ COM callers --> 160 <xsl:variable name="G_funcPrefixOutputStructConverter" 161 select='"StructCom2Soap_"' /> 158 162 159 163 <xsl:variable name="G_aSharedTypes">
Note:
See TracChangeset
for help on using the changeset viewer.