VirtualBox

Changeset 101180 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 19, 2023 5:18:37 PM (16 months ago)
Author:
vboxsync
Message:

Frontends/VBoxManage,Main/VirtualBox: Change the newly added IVirtualBox
method getGuestOSFamilies() to be an attribute instead as there are no
"in" arguments passed to this function. bugref:5936

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    r101167 r101180  
    21922192        {
    21932193            com::SafeArray<BSTR> GuestOSFamilies;
    2194             CHECK_ERROR(pVirtualBox, GetGuestOSFamilies(ComSafeArrayAsOutParam(GuestOSFamilies)));
     2194            CHECK_ERROR(pVirtualBox, COMGETTER(GuestOSFamilies)(ComSafeArrayAsOutParam(GuestOSFamilies)));
    21952195            if (SUCCEEDED(hrc))
    21962196            {
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r101171 r101180  
    28692869    <attribute name="progressOperations" type="IProgress" readonly="yes" safearray="yes"/>
    28702870
    2871     <attribute name="guestOSTypes" type="IGuestOSType" readonly="yes" safearray="yes"/>
     2871    <attribute name="guestOSTypes" type="IGuestOSType" readonly="yes" safearray="yes">
     2872      <desc>
     2873        Array of guest OS type objects known to this VirtualBox installation.
     2874      </desc>
     2875    </attribute>
     2876
     2877    <attribute name="guestOSFamilies" type="wstring" readonly="yes" safearray="yes">
     2878      <desc>
     2879        Array of guest OS family identifiers known to this VirtualBox installation.
     2880
     2881        The guest OS family identifier corrresponds to the <link to="IGuestOSType::familyId"/>
     2882        attribute.
     2883      </desc>
     2884    </attribute>
    28722885
    28732886    <attribute name="sharedFolders" type="ISharedFolder" readonly="yes" safearray="yes">
     
    34953508      <param name="type" type="IGuestOSType" dir="return">
    34963509        <desc>Guest OS type object.</desc>
    3497       </param>
    3498     </method>
    3499 
    3500     <method name="getGuestOSFamilies">
    3501       <rest request="get" path="/server/methods/"/>
    3502       <desc>
    3503         Returns a list of all known guest OS family IDs.
    3504 
    3505         The <link to="IVirtualBox::guestOSTypes"/> collection contains all
    3506         available guest OS type objects. Each object has an
    3507         <link to="IGuestOSType::familyId"/> attribute which contains
    3508         the guest OS family identifier string that this object describes.
    3509 
    3510       </desc>
    3511       <param name="guestOSFamilies" type="wstring" safearray="yes" dir="return">
    3512         <desc>Array of all known guest OS family IDs.</desc>
    35133510      </param>
    35143511    </method>
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r101166 r101180  
    346346    HRESULT getFloppyImages(std::vector<ComPtr<IMedium> > &aFloppyImages);
    347347    HRESULT getProgressOperations(std::vector<ComPtr<IProgress> > &aProgressOperations);
     348    HRESULT getGuestOSFamilies(std::vector<com::Utf8Str> &aOSFamilies);
    348349    HRESULT getGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aGuestOSTypes);
    349350    HRESULT getSharedFolders(std::vector<ComPtr<ISharedFolder> > &aSharedFolders);
     
    399400    HRESULT getGuestOSType(const com::Utf8Str &aId,
    400401                           ComPtr<IGuestOSType> &aType);
    401     HRESULT getGuestOSFamilies(std::vector<com::Utf8Str> &aOSFamilies);
    402402    HRESULT getGuestOSVariantsByFamilyId(const Utf8Str &strOSFamily,
    403403                                         std::vector<com::Utf8Str> &aOSVariants);
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r101179 r101180  
    19471947    return S_OK;
    19481948}
     1949
     1950/**
     1951 * Walk the list of GuestOSType objects and return a list of all known guest
     1952 * OS families.
     1953 *
     1954 * @param aOSFamilies    Where to store the list of guest OS families.
     1955 *
     1956 * @note Locks the guest OS types list for reading.
     1957 */
     1958HRESULT VirtualBox::getGuestOSFamilies(std::vector<com::Utf8Str> &aOSFamilies)
     1959{
     1960    std::list<com::Utf8Str> allOSFamilies;
     1961
     1962    AutoReadLock alock(m->allGuestOSTypes.getLockHandle() COMMA_LOCKVAL_SRC_POS);
     1963
     1964    for (GuestOSTypesOList::const_iterator it = m->allGuestOSTypes.begin();
     1965         it != m->allGuestOSTypes.end(); ++it)
     1966    {
     1967        const Utf8Str &familyId = (*it)->i_familyId();
     1968        AssertMsg(!familyId.isEmpty(), ("familfyId must not be NULL"));
     1969        allOSFamilies.push_back(familyId);
     1970    }
     1971
     1972    /* throw out any duplicates */
     1973    allOSFamilies.sort();
     1974    allOSFamilies.unique();
     1975
     1976    aOSFamilies.resize(allOSFamilies.size());
     1977    size_t i = 0;
     1978    for (std::list<com::Utf8Str>::const_iterator it = allOSFamilies.begin();
     1979         it != allOSFamilies.end(); ++it, ++i)
     1980        aOSFamilies[i] = (*it);
     1981
     1982    return S_OK;
     1983}
     1984
    19491985// Wrapped IVirtualBox methods
    19501986/////////////////////////////////////////////////////////////////////////////
     
    44314467
    44324468/**
    4433  * Walk the list of GuestOSType objects and return a list of all known guest
    4434  * OS families.
    4435  *
    4436  * @param aOSFamilies    Where to store the list of guest OS families.
    4437  *
    4438  * @note Locks the guest OS types list for reading.
    4439  */
    4440 HRESULT VirtualBox::getGuestOSFamilies(std::vector<com::Utf8Str> &aOSFamilies)
    4441 {
    4442     std::list<com::Utf8Str> allOSFamilies;
    4443 
    4444     AutoReadLock alock(m->allGuestOSTypes.getLockHandle() COMMA_LOCKVAL_SRC_POS);
    4445 
    4446     for (GuestOSTypesOList::const_iterator it = m->allGuestOSTypes.begin();
    4447          it != m->allGuestOSTypes.end(); ++it)
    4448     {
    4449         const Utf8Str &familyId = (*it)->i_familyId();
    4450         AssertMsg(!familyId.isEmpty(), ("familfyId must not be NULL"));
    4451         allOSFamilies.push_back(familyId);
    4452     }
    4453 
    4454     /* throw out any duplicates */
    4455     allOSFamilies.sort();
    4456     allOSFamilies.unique();
    4457 
    4458     aOSFamilies.resize(allOSFamilies.size());
    4459     size_t i = 0;
    4460     for (std::list<com::Utf8Str>::const_iterator it = allOSFamilies.begin();
    4461          it != allOSFamilies.end(); ++it, ++i)
    4462         aOSFamilies[i] = (*it);
    4463 
    4464     return S_OK;
    4465 }
    4466 
    4467 /**
    44684469 * Walk the list of GuestOSType objects and return a list of guest OS
    44694470 * variants which correspond to the supplied guest OS family ID.
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