Changeset 101180 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Sep 19, 2023 5:18:37 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r101179 r101180 1947 1947 return S_OK; 1948 1948 } 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 */ 1958 HRESULT 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 1949 1985 // Wrapped IVirtualBox methods 1950 1986 ///////////////////////////////////////////////////////////////////////////// … … 4431 4467 4432 4468 /** 4433 * Walk the list of GuestOSType objects and return a list of all known guest4434 * 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 /**4468 4469 * Walk the list of GuestOSType objects and return a list of guest OS 4469 4470 * variants which correspond to the supplied guest OS family ID.
Note:
See TracChangeset
for help on using the changeset viewer.