VirtualBox

Changeset 16234 in vbox


Ignore:
Timestamp:
Jan 26, 2009 2:20:26 PM (16 years ago)
Author:
vboxsync
Message:

coding style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r16233 r16234  
    206206    ComObjPtr<Appliance> appliance;
    207207    appliance.createObject();
    208     rc = appliance->init (this, bstrPath);
     208    rc = appliance->init(this, bstrPath);
    209209//     ComAssertComRCThrowRC(rc);
    210210
     
    427427    VirtualSystem d;
    428428
    429     const xml::Node *pIdAttr = pelmVirtualSystem->findAttribute("type");
     429    const xml::Node *pIdAttr = pelmVirtualSystem->findAttribute("id");
    430430    if (pIdAttr)
    431431        d.strName = pIdAttr->getValue();
     
    745745 */
    746746
    747 HRESULT Appliance::init (VirtualBox *aVirtualBox, IN_BSTR &path)
     747HRESULT Appliance::init(VirtualBox *aVirtualBox, IN_BSTR &path)
    748748{
    749749    HRESULT rc;
     
    751751    /* Enclose the state transition NotReady->InInit->Ready */
    752752    AutoInitSpan autoInitSpan(this);
    753     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     753    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    754754
    755755    /* Weakly reference to a VirtualBox object */
    756     unconst (mVirtualBox) = aVirtualBox;
     756    unconst(mVirtualBox) = aVirtualBox;
    757757
    758758    // initialize data
     
    809809
    810810    rc = construeAppliance();
    811     if (FAILED (rc))
     811    if (FAILED(rc))
    812812        return rc;
    813813
     
    893893STDMETHODIMP Appliance::COMGETTER(VirtualSystemDescriptions)(ComSafeArrayOut(IVirtualSystemDescription*, aVirtualSystemDescriptions))
    894894{
    895     CheckComArgOutSafeArrayPointerValid (aVirtualSystemDescriptions);
    896 
    897     AutoCaller autoCaller (this);
    898     CheckComRCReturnRC (autoCaller.rc());
    899 
    900     AutoReadLock alock (this);
    901 
    902     SafeIfaceArray<IVirtualSystemDescription> sfaVSD (m->virtualSystemDescriptions);
    903     sfaVSD.detachTo (ComSafeArrayOutArg (aVirtualSystemDescriptions));
     895    CheckComArgOutSafeArrayPointerValid(aVirtualSystemDescriptions);
     896
     897    AutoCaller autoCaller(this);
     898    CheckComRCReturnRC(autoCaller.rc());
     899
     900    AutoReadLock alock(this);
     901
     902    SafeIfaceArray<IVirtualSystemDescription> sfaVSD(m->virtualSystemDescriptions);
     903    sfaVSD.detachTo(ComSafeArrayOutArg(aVirtualSystemDescriptions));
    904904
    905905    return S_OK;
     
    923923
    924924        /* Guest OS type */
    925         list<VirtualSystemDescriptionEntry> vsdeOS = vsd->findByType (VirtualSystemDescriptionType_OS);
    926         Assert (vsdeOS.size() == 1);
     925        list<VirtualSystemDescriptionEntry> vsdeOS = vsd->findByType(VirtualSystemDescriptionType_OS);
     926        Assert(vsdeOS.size() == 1);
    927927        string osTypeVBox = vsdeOS.front().strFinalValue;
    928928
    929929        /* Now that we know the base system get our internal defaults based on that. */
    930930        IGuestOSType *osType = NULL;
    931         rc = mVirtualBox->GetGuestOSType (Bstr (Utf8Str (osTypeVBox.c_str())), &osType);
    932         ComAssertComRCThrowRC (rc);
     931        rc = mVirtualBox->GetGuestOSType(Bstr(Utf8Str(osTypeVBox.c_str())), &osType);
     932        ComAssertComRCThrowRC(rc);
    933933
    934934        /* Create the machine */
    935935        /* First get the name */
    936         list<VirtualSystemDescriptionEntry> vsdeName = vsd->findByType (VirtualSystemDescriptionType_Name);
    937         Assert (vsdeName.size() == 1);
     936        list<VirtualSystemDescriptionEntry> vsdeName = vsd->findByType(VirtualSystemDescriptionType_Name);
     937        Assert(vsdeName.size() == 1);
    938938        string nameVBox = vsdeName.front().strFinalValue;
    939939        IMachine *newMachine = NULL;
    940         rc = mVirtualBox->CreateMachine (Bstr (nameVBox.c_str()), Bstr (osTypeVBox.c_str()),
    941                                          Bstr (), Guid(),
    942                                          &newMachine);
    943         ComAssertComRCThrowRC (rc);
     940        rc = mVirtualBox->CreateMachine(Bstr(nameVBox.c_str()), Bstr(osTypeVBox.c_str()),
     941                                        Bstr(), Guid(),
     942                                        &newMachine);
     943        ComAssertComRCThrowRC(rc);
    944944
    945945        /* CPU count (ignored for now) */
     
    949949        /* RAM */
    950950        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */
    951         list<VirtualSystemDescriptionEntry> vsdeRAM = vsd->findByType (VirtualSystemDescriptionType_Memory);
    952         Assert (vsdeRAM.size() == 1);
     951        list<VirtualSystemDescriptionEntry> vsdeRAM = vsd->findByType(VirtualSystemDescriptionType_Memory);
     952        Assert(vsdeRAM.size() == 1);
    953953        string memoryVBox = vsdeRAM.front().strFinalValue;
    954         uint64_t tt = RTStrToUInt64 (memoryVBox.c_str()) / _1M;
     954        uint64_t tt = RTStrToUInt64(memoryVBox.c_str()) / _1M;
    955955
    956956        rc = newMachine->COMSETTER(MemorySize)(tt);
    957         ComAssertComRCThrowRC (rc);
     957        ComAssertComRCThrowRC(rc);
    958958
    959959        /* VRAM */
     
    961961        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestVRAM) */
    962962        ULONG vramVBox;
    963         rc = osType->COMGETTER(RecommendedVRAM) (&vramVBox);
    964         ComAssertComRCThrowRC (rc);
     963        rc = osType->COMGETTER(RecommendedVRAM)(&vramVBox);
     964        ComAssertComRCThrowRC(rc);
    965965        /* Set the VRAM */
    966         rc = newMachine->COMSETTER(VRAMSize) (vramVBox);
    967         ComAssertComRCThrowRC (rc);
     966        rc = newMachine->COMSETTER(VRAMSize)(vramVBox);
     967        ComAssertComRCThrowRC(rc);
    968968
    969969        /* Change the network adapters */
    970         list<VirtualSystemDescriptionEntry> vsdeNW = vsd->findByType (VirtualSystemDescriptionType_NetworkAdapter);
     970        list<VirtualSystemDescriptionEntry> vsdeNW = vsd->findByType(VirtualSystemDescriptionType_NetworkAdapter);
    971971        if (vsdeNW.size() == 0)
    972972        {
    973973            /* No network adapters, so we have to disable our default one */
    974974            INetworkAdapter *nwVBox = NULL;
    975             rc = newMachine->GetNetworkAdapter (0, &nwVBox);
    976             ComAssertComRCThrowRC (rc);
    977             rc = nwVBox->COMSETTER(Enabled) (false);
    978             ComAssertComRCThrowRC (rc);
     975            rc = newMachine->GetNetworkAdapter(0, &nwVBox);
     976            ComAssertComRCThrowRC(rc);
     977            rc = nwVBox->COMSETTER(Enabled)(false);
     978            ComAssertComRCThrowRC(rc);
    979979        }
    980980        else
     
    989989            {
    990990                string nwTypeVBox = nwIt->strFinalValue;
    991                 uint32_t tt1 = RTStrToUInt32 (nwTypeVBox.c_str());
     991                uint32_t tt1 = RTStrToUInt32(nwTypeVBox.c_str());
    992992                INetworkAdapter *nwVBox = NULL;
    993                 rc = newMachine->GetNetworkAdapter ((ULONG)a, &nwVBox);
    994                 ComAssertComRCThrowRC (rc);
     993                rc = newMachine->GetNetworkAdapter((ULONG)a, &nwVBox);
     994                ComAssertComRCThrowRC(rc);
    995995                /* Enable the network card & set the adapter type */
    996996                /* NAT is set as default */
    997                 rc = nwVBox->COMSETTER(Enabled) (true);
    998                 ComAssertComRCThrowRC (rc);
    999                 rc = nwVBox->COMSETTER(AdapterType) (static_cast<NetworkAdapterType_T> (tt1));
    1000                 ComAssertComRCThrowRC (rc);
     997                rc = nwVBox->COMSETTER(Enabled)(true);
     998                ComAssertComRCThrowRC(rc);
     999                rc = nwVBox->COMSETTER(AdapterType)(static_cast<NetworkAdapterType_T>(tt1));
     1000                ComAssertComRCThrowRC(rc);
    10011001            }
    10021002        }
    10031003        /* Now its time to register the machine before we add any hard disks */
    1004         rc = mVirtualBox->RegisterMachine (newMachine);
    1005         ComAssertComRCThrowRC (rc);
     1004        rc = mVirtualBox->RegisterMachine(newMachine);
     1005        ComAssertComRCThrowRC(rc);
    10061006
    10071007        /* @todo: Unregister on failure */
     
    10331033    /* We need the default path for storing disk images */
    10341034    ISystemProperties *systemProps = NULL;
    1035     rc = mVirtualBox->COMGETTER(SystemProperties) (&systemProps);
    1036     ComAssertComRCThrowRC (rc);
     1035    rc = mVirtualBox->COMGETTER(SystemProperties)(&systemProps);
     1036    ComAssertComRCThrowRC(rc);
    10371037    BSTR defaultHardDiskLocation;
    1038     rc = systemProps->COMGETTER(DefaultHardDiskFolder) (&defaultHardDiskLocation);
    1039     ComAssertComRCThrowRC (rc);
     1038    rc = systemProps->COMGETTER(DefaultHardDiskFolder)(&defaultHardDiskLocation);
     1039    ComAssertComRCThrowRC(rc);
    10401040
    10411041    list<VirtualSystem>::const_iterator it;
     
    12351235                }
    12361236        }
    1237         vsd->addEntry (VirtualSystemDescriptionType_OS, 0, toString<ULONG> (vs.cimos), osTypeVBox);
     1237        vsd->addEntry(VirtualSystemDescriptionType_OS, 0, toString<ULONG>(vs.cimos), osTypeVBox);
    12381238
    12391239        /* VM name */
     
    12431243        if (nameVBox == "")
    12441244            nameVBox = osTypeVBox;
    1245         searchUniqueVMName (nameVBox);
    1246         vsd->addEntry (VirtualSystemDescriptionType_Name, 0, vs.strName, nameVBox);
     1245        searchUniqueVMName(nameVBox);
     1246        vsd->addEntry(VirtualSystemDescriptionType_Name, 0, vs.strName, nameVBox);
    12471247
    12481248        /* Now that we know the base system get our internal defaults based on that. */
    12491249        IGuestOSType *osType = NULL;
    1250         rc = mVirtualBox->GetGuestOSType (Bstr (Utf8Str (osTypeVBox.c_str())), &osType);
    1251         ComAssertComRCThrowRC (rc);
     1250        rc = mVirtualBox->GetGuestOSType(Bstr(Utf8Str(osTypeVBox.c_str())), &osType);
     1251        ComAssertComRCThrowRC(rc);
    12521252
    12531253        /* CPU count */
     
    12561256        if (vs.cCPUs == 0)
    12571257            cpuCountVBox = 1;
    1258         vsd->addEntry (VirtualSystemDescriptionType_CPU, 0, toString<ULONG> (vs.cCPUs), toString<ULONG> (cpuCountVBox));
     1258        vsd->addEntry(VirtualSystemDescriptionType_CPU, 0, toString<ULONG>(vs.cCPUs), toString<ULONG>(cpuCountVBox));
    12591259
    12601260        /* RAM */
     
    12661266            ULONG memSizeVBox2;
    12671267            rc = osType->COMGETTER(RecommendedRAM)(&memSizeVBox2);
    1268             ComAssertComRCThrowRC (rc);
     1268            ComAssertComRCThrowRC(rc);
    12691269            /* VBox stores that in MByte */
    12701270            ullMemSizeVBox = memSizeVBox2 * _1M;
    12711271        }
    1272         vsd->addEntry (VirtualSystemDescriptionType_Memory, 0, toString<uint64_t> (vs.ullMemorySize), toString<uint64_t> (ullMemSizeVBox));
     1272        vsd->addEntry(VirtualSystemDescriptionType_Memory, 0, toString<uint64_t>(vs.ullMemorySize), toString<uint64_t>(ullMemSizeVBox));
    12731273
    12741274        /* Hard disk Controller */
     
    12871287                        /* Use PIIX4 as default */
    12881288                        IDEControllerType_T hdcController = IDEControllerType_PIIX4;
    1289                         if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX3"))
     1289                        if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX3"))
    12901290                            hdcController = IDEControllerType_PIIX3;
    1291                         else if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX4"))
     1291                        else if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4"))
    12921292                            hdcController = IDEControllerType_PIIX4;
    1293                         vsd->addEntry (VirtualSystemDescriptionType_HarddiskControllerIDE, hdc.idController, hdc.strControllerType, toString<ULONG> (hdcController));
     1293                        vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerIDE, hdc.idController, hdc.strControllerType, toString<ULONG>(hdcController));
    12941294                        break;
    12951295                    }
     
    12981298                        // @todo: figure out the SATA types
    12991299                        /* We only support a plain AHCI controller, so use them always */
    1300                         vsd->addEntry (VirtualSystemDescriptionType_HarddiskControllerSATA, hdc.idController, hdc.strControllerType, "AHCI");
     1300                        vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerSATA, hdc.idController, hdc.strControllerType, "AHCI");
    13011301                        break;
    13021302                    }
     
    13051305                        string hdcController = "LsiLogic";
    13061306                        // @todo: figure out the SCSI types
    1307                         if (!RTStrICmp (hdc.strControllerType.c_str(), "LsiLogic"))
     1307                        if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic"))
    13081308                            hdcController = "LsiLogic";
    1309                         else if (!RTStrICmp (hdc.strControllerType.c_str(), "BusLogic"))
     1309                        else if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic"))
    13101310                            hdcController = "BusLogic";
    1311                         vsd->addEntry (VirtualSystemDescriptionType_HarddiskControllerSCSI, hdc.idController, hdc.strControllerType, hdcController);
     1311                        vsd->addEntry(VirtualSystemDescriptionType_HarddiskControllerSCSI, hdc.idController, hdc.strControllerType, hdcController);
    13121312                        break;
    13131313                    }
     
    13361336                //  - figure out if there is a url specifier for vhd already
    13371337                //  - we need a url specifier for the vdi format
    1338                 if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse"))
     1338                if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse"))
    13391339                    fSupported = true;
    13401340                /* enable compressed formats for the first tests also */
    1341                 else if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed"))
     1341                else if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed"))
    13421342                    fSupported = true;
    13431343                if (fSupported)
    13441344                {
    13451345                    /* Construct the path */
    1346                     string path = Utf8StrFmt ("%ls%c%s", defaultHardDiskLocation, RTPATH_DELIMITER, di.strHref.c_str()).raw();
    1347                     vsd->addEntry (VirtualSystemDescriptionType_Harddisk, hd.idController, di.strHref, path);
     1346                    string path = Utf8StrFmt("%ls%c%s", defaultHardDiskLocation, RTPATH_DELIMITER, di.strHref.c_str()).raw();
     1347                    vsd->addEntry(VirtualSystemDescriptionType_Harddisk, hd.idController, di.strHref, path);
    13481348                }
    13491349            }
     
    13561356            /* Get the default network adapter type for the selected guest OS */
    13571357            NetworkAdapterType_T nwAdapterVBox = NetworkAdapterType_Am79C970A;
    1358             rc = osType->COMGETTER(AdapterType) (&nwAdapterVBox);
    1359             ComAssertComRCThrowRC (rc);
     1358            rc = osType->COMGETTER(AdapterType)(&nwAdapterVBox);
     1359            ComAssertComRCThrowRC(rc);
    13601360            list<string>::const_iterator nwIt;
    13611361            /* Iterate through all abstract networks. We support 8 network
     
    13671367            {
    13681368                // string nwController = *nwIt; // @todo: not used yet
    1369                 vsd->addEntry (VirtualSystemDescriptionType_NetworkAdapter, 0, "", toString<ULONG> (nwAdapterVBox));
     1369                vsd->addEntry(VirtualSystemDescriptionType_NetworkAdapter, 0, "", toString<ULONG>(nwAdapterVBox));
    13701370            }
    13711371        }
    1372         m->virtualSystemDescriptions.push_back (vsd);
     1372        m->virtualSystemDescriptions.push_back(vsd);
    13731373    }
    13741374
     
    13761376}
    13771377
    1378 HRESULT Appliance::searchUniqueVMName (std::string& aName)
     1378HRESULT Appliance::searchUniqueVMName(std::string& aName)
    13791379{
    13801380    IMachine *machine = NULL;
    1381     char *tmpName = RTStrDup (aName.c_str());
     1381    char *tmpName = RTStrDup(aName.c_str());
    13821382    int i = 1;
    13831383    /* @todo: Maybe to cost intensive; try to find a lighter way */
    1384     while (mVirtualBox->FindMachine (Bstr (tmpName), &machine) != VBOX_E_OBJECT_NOT_FOUND)
     1384    while (mVirtualBox->FindMachine(Bstr(tmpName), &machine) != VBOX_E_OBJECT_NOT_FOUND)
    13851385    {
    1386         RTStrFree (tmpName);
    1387         RTStrAPrintf (&tmpName, "%s_%d", aName.c_str(), i);
     1386        RTStrFree(tmpName);
     1387        RTStrAPrintf(&tmpName, "%s_%d", aName.c_str(), i);
    13881388        ++i;
    13891389    }
    13901390    aName = tmpName;
    1391     RTStrFree (tmpName);
     1391    RTStrFree(tmpName);
    13921392
    13931393    return S_OK;
     
    14081408{
    14091409    /* Enclose the state transition NotReady->InInit->Ready */
    1410     AutoInitSpan autoInitSpan (this);
    1411     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     1410    AutoInitSpan autoInitSpan(this);
     1411    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    14121412
    14131413    /* Initialize data */
     
    14261426}
    14271427
    1428 STDMETHODIMP VirtualSystemDescription::GetDescription (ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
    1429                                                        ComSafeArrayOut(ULONG, aRefs),
    1430                                                        ComSafeArrayOut(BSTR, aOrigValues),
    1431                                                        ComSafeArrayOut(BSTR, aAutoValues),
    1432                                                        ComSafeArrayOut(BSTR, aConfigurations))
    1433 {
    1434     if (ComSafeArrayOutIsNull (aTypes) ||
    1435         ComSafeArrayOutIsNull (aRefs) ||
    1436         ComSafeArrayOutIsNull (aOrigValues) ||
    1437         ComSafeArrayOutIsNull (aAutoValues) ||
    1438         ComSafeArrayOutIsNull (aConfigurations))
     1428STDMETHODIMP VirtualSystemDescription::GetDescription(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
     1429                                                      ComSafeArrayOut(ULONG, aRefs),
     1430                                                      ComSafeArrayOut(BSTR, aOrigValues),
     1431                                                      ComSafeArrayOut(BSTR, aAutoValues),
     1432                                                      ComSafeArrayOut(BSTR, aConfigurations))
     1433{
     1434    if (ComSafeArrayOutIsNull(aTypes) ||
     1435        ComSafeArrayOutIsNull(aRefs) ||
     1436        ComSafeArrayOutIsNull(aOrigValues) ||
     1437        ComSafeArrayOutIsNull(aAutoValues) ||
     1438        ComSafeArrayOutIsNull(aConfigurations))
    14391439        return E_POINTER;
    14401440
    1441     AutoCaller autoCaller (this);
    1442     CheckComRCReturnRC (autoCaller.rc());
    1443 
    1444     AutoReadLock alock (this);
     1441    AutoCaller autoCaller(this);
     1442    CheckComRCReturnRC(autoCaller.rc());
     1443
     1444    AutoReadLock alock(this);
    14451445
    14461446    ULONG c = (ULONG)m->descriptions.size();
    1447     com::SafeArray<VirtualSystemDescriptionType_T> sfaTypes (c);
    1448     com::SafeArray<ULONG> sfaRefs (c);
    1449     com::SafeArray<BSTR> sfaOrigValues (c);
    1450     com::SafeArray<BSTR> sfaAutoValues (c);
    1451     com::SafeArray<BSTR> sfaConfigurations (c);
     1447    com::SafeArray<VirtualSystemDescriptionType_T> sfaTypes(c);
     1448    com::SafeArray<ULONG> sfaRefs(c);
     1449    com::SafeArray<BSTR> sfaOrigValues(c);
     1450    com::SafeArray<BSTR> sfaAutoValues(c);
     1451    com::SafeArray<BSTR> sfaConfigurations(c);
    14521452
    14531453    list<VirtualSystemDescriptionEntry>::const_iterator it;
     
    14631463        sfaRefs [i] = vsde.ref;
    14641464        /* Original value */
    1465         Bstr bstr = Utf8Str (vsde.strOriginalValue.c_str());
    1466         bstr.cloneTo (&sfaOrigValues [i]);
     1465        Bstr bstr = Utf8Str(vsde.strOriginalValue.c_str());
     1466        bstr.cloneTo(&sfaOrigValues [i]);
    14671467        /* Auto value */
    1468         bstr = Utf8Str (vsde.strAutoValue.c_str());
    1469         bstr.cloneTo (&sfaAutoValues [i]);
     1468        bstr = Utf8Str(vsde.strAutoValue.c_str());
     1469        bstr.cloneTo(&sfaAutoValues [i]);
    14701470        /* Configuration */
    1471         bstr = Utf8Str (vsde.strConfiguration.c_str());
    1472         bstr.cloneTo (&sfaConfigurations [i]);
     1471        bstr = Utf8Str(vsde.strConfiguration.c_str());
     1472        bstr.cloneTo(&sfaConfigurations [i]);
    14731473    }
    14741474
    1475     sfaTypes.detachTo (ComSafeArrayOutArg (aTypes));
    1476     sfaRefs.detachTo (ComSafeArrayOutArg (aRefs));
    1477     sfaOrigValues.detachTo (ComSafeArrayOutArg (aOrigValues));
    1478     sfaAutoValues.detachTo (ComSafeArrayOutArg (aAutoValues));
    1479     sfaConfigurations.detachTo (ComSafeArrayOutArg (aConfigurations));
     1475    sfaTypes.detachTo(ComSafeArrayOutArg(aTypes));
     1476    sfaRefs.detachTo(ComSafeArrayOutArg(aRefs));
     1477    sfaOrigValues.detachTo(ComSafeArrayOutArg(aOrigValues));
     1478    sfaAutoValues.detachTo(ComSafeArrayOutArg(aAutoValues));
     1479    sfaConfigurations.detachTo(ComSafeArrayOutArg(aConfigurations));
    14801480
    14811481    return S_OK;
    14821482}
    14831483
    1484 STDMETHODIMP VirtualSystemDescription::SetFinalValues (ComSafeArrayIn (IN_BSTR, aFinalValues))
    1485 {
    1486     CheckComArgSafeArrayNotNull (aFinalValues);
    1487 
    1488     AutoCaller autoCaller (this);
    1489     CheckComRCReturnRC (autoCaller.rc());
    1490 
    1491     AutoWriteLock alock (this);
    1492 
    1493     com::SafeArray <IN_BSTR> values (ComSafeArrayInArg (aFinalValues));
     1484STDMETHODIMP VirtualSystemDescription::SetFinalValues(ComSafeArrayIn(IN_BSTR, aFinalValues))
     1485{
     1486    CheckComArgSafeArrayNotNull(aFinalValues);
     1487
     1488    AutoCaller autoCaller(this);
     1489    CheckComRCReturnRC(autoCaller.rc());
     1490
     1491    AutoWriteLock alock(this);
     1492
     1493    com::SafeArray <IN_BSTR> values(ComSafeArrayInArg(aFinalValues));
    14941494    if (values.size() != m->descriptions.size())
    14951495        return E_INVALIDARG;
     
    15021502    {
    15031503        VirtualSystemDescriptionEntry vsde = (*it);
    1504         vsde.strFinalValue = Utf8Str (values [i]).raw();
     1504        vsde.strFinalValue = Utf8Str(values[i]).raw();
    15051505    }
    15061506
     
    15081508}
    15091509
    1510 void VirtualSystemDescription::addEntry (VirtualSystemDescriptionType_T aType, ULONG aRef, std::string aOrigValue, std::string aAutoValue)
     1510void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType, ULONG aRef, std::string aOrigValue, std::string aAutoValue)
    15111511{
    15121512    VirtualSystemDescriptionEntry vsde;
     
    15181518    vsde.strFinalValue = aAutoValue;
    15191519
    1520     m->descriptions.push_back (vsde);
    1521 }
    1522 
    1523 list<VirtualSystemDescriptionEntry> VirtualSystemDescription::findByType (VirtualSystemDescriptionType_T aType)
     1520    m->descriptions.push_back(vsde);
     1521}
     1522
     1523list<VirtualSystemDescriptionEntry> VirtualSystemDescription::findByType(VirtualSystemDescriptionType_T aType)
    15241524{
    15251525    list<VirtualSystemDescriptionEntry> vsd;
     
    15301530         ++it)
    15311531        if (it->type == aType)
    1532             vsd.push_back (*it);
     1532            vsd.push_back(*it);
    15331533
    15341534    return vsd;
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