VirtualBox

Changeset 101180 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Sep 19, 2023 5:18:37 PM (17 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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