VirtualBox

Changeset 21819 in vbox for trunk


Ignore:
Timestamp:
Jul 27, 2009 3:59:56 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50433
Message:

API/webservice: eliminate the last traces of special UUID data type handling.

Location:
trunk/src/VBox/Main/webservice
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/glue-jaxws.xsl

    r21783 r21819  
    211211  <xsl:param name="safearray"/>
    212212  <xsl:choose>
    213     <xsl:when test="$idltype='uuid'">
    214       <xsl:choose>
    215         <xsl:when test="$safearray">
    216           <xsl:value-of select="concat('Helper.uuidWrap(',$value,')')" />
    217         </xsl:when>
    218         <xsl:otherwise>
    219           <xsl:value-of select="concat('UUID.fromString(',$value,')')" />
    220         </xsl:otherwise>
    221       </xsl:choose>
    222     </xsl:when>
    223213    <xsl:when test="//collection[@name=$idltype]">
    224214      <xsl:variable name="elemtype">
     
    305295      </xsl:choose>
    306296    </xsl:when>
    307     <xsl:when test="$paramtype='uuid'">
    308       <xsl:value-of select="concat($paramname, '.toString()')" />
    309     </xsl:when>
    310297    <xsl:otherwise>
    311298      <xsl:value-of select="$paramname" />
     
    416403import java.util.ArrayList;
    417404import java.util.Collections;
    418 import java.util.UUID;
    419405import java.lang.reflect.Constructor;
    420406import java.lang.reflect.InvocationTargetException;
     
    442428    }
    443429
    444     public static List<UUID> uuidWrap(List<String> uuidVals) {
    445          List<UUID> ret = new ArrayList<UUID>(uuidVals.size());
    446          for (String uuid : uuidVals) {
    447               ret.add(UUID.fromString(uuid));
    448          }
    449          return ret;
    450     }
    451 
    452430    public static <T extends IUnknown> List<String> unwrap(List<T> thisPtrs) {
    453431        if (thisPtrs==null)  return Collections.emptyList();
     
    476454import java.util.Map;
    477455import java.util.HashMap;
    478 import java.util.UUID;
    479456import javax.xml.namespace.QName;
    480457import javax.xml.ws.BindingProvider;
     
    800777      <xsl:text>import java.math.BigInteger;&#10;</xsl:text>
    801778      <xsl:text>import java.util.List;&#10;</xsl:text>
    802       <xsl:text>import java.util.UUID;&#10;</xsl:text>
    803779      <xsl:text>import javax.xml.ws.Holder;&#10;</xsl:text>
    804780      <xsl:text>import javax.xml.ws.WebServiceException;&#10;</xsl:text>
  • trunk/src/VBox/Main/webservice/websrv-python.xsl

    r21640 r21819  
    5353    <xsl:when test="$type='unsigned long long'">UnsignedLong</xsl:when>
    5454    <xsl:when test="$type='result'">UnsignedInt</xsl:when>
    55     <xsl:when test="$type='uuid'">UUID</xsl:when>
    5655    <xsl:when test="$type='$unknown'">IUnknown</xsl:when>
    5756    <xsl:when test="$type='$dispatched'">IUnknown</xsl:when>
     
    538537
    539538
    540 class UUID:
    541   def __init__(self, mgr, handle, isarray = False):
    542       self.handle = handle
    543       self.mgr = mgr
    544       self.isarray = isarray
    545  
    546   def __next(self):
    547       if self.isarray:
    548           return self.handle.__next()
    549       raise TypeError, "iteration over non-sequence"
    550 
    551   def __size(self):
    552       if self.isarray:         
    553           return self.handle.__size()
    554       raise TypeError, "iteration over non-sequence"
    555 
    556   def __len__(self):
    557       if self.isarray:
    558           return self.handle.__len__()
    559       raise TypeError, "iteration over non-sequence"
    560 
    561   def __getitem__(self, index):
    562       if self.isarray:
    563           return UUID(self.mgr, self.handle[index])
    564       raise TypeError, "iteration over non-sequence"       
    565 
    566   def __str__(self):
    567       return self.handle
    568 
    569   def __eq__(self,other):
    570       if self.isarray:
    571          return isinstance(other,UUID) and self.handle == other.handle
    572       if isinstance(other,UUID):
    573          return self.handle == other.handle
    574       if isinstance(other,basestring):
    575          return self.handle == other
    576       return False
    577 
    578   def __ne__(self,other):
    579       if self.isarray:
    580          return not isinstance(other,UUID) or self.handle == other.handle     
    581       if isinstance(other,UUID):
    582          return self.handle != other.handle
    583       if isinstance(other,basestring):
    584          return self.handle != other
    585       return True
    586 
    587539class Boolean:
    588540  def __init__(self, mgr, handle, isarray = False):       
  • trunk/src/VBox/Main/webservice/websrv-shared.inc.xsl

    r20888 r21819  
    171171  <type idlname="float"              xmlname="float"         cname="float"            gluename=""        javaname="Float" />
    172172  <type idlname="wstring"            xmlname="string"        cname="std::string"      gluename=""        javaname="String" />
    173   <type idlname="uuid"               xmlname="string"        cname="std::string"      gluename=""        javaname="UUID" />
    174173  <type idlname="result"             xmlname="unsignedInt"   cname="unsigned int"     gluename="HRESULT" javaname="Long" />
    175174</xsl:variable>
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