Changeset 101180 in vbox for trunk/src/VBox
- Timestamp:
- Sep 19, 2023 5:18:37 PM (16 months ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r101167 r101180 2192 2192 { 2193 2193 com::SafeArray<BSTR> GuestOSFamilies; 2194 CHECK_ERROR(pVirtualBox, GetGuestOSFamilies(ComSafeArrayAsOutParam(GuestOSFamilies)));2194 CHECK_ERROR(pVirtualBox, COMGETTER(GuestOSFamilies)(ComSafeArrayAsOutParam(GuestOSFamilies))); 2195 2195 if (SUCCEEDED(hrc)) 2196 2196 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r101171 r101180 2869 2869 <attribute name="progressOperations" type="IProgress" readonly="yes" safearray="yes"/> 2870 2870 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> 2872 2885 2873 2886 <attribute name="sharedFolders" type="ISharedFolder" readonly="yes" safearray="yes"> … … 3495 3508 <param name="type" type="IGuestOSType" dir="return"> 3496 3509 <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 all3506 available guest OS type objects. Each object has an3507 <link to="IGuestOSType::familyId"/> attribute which contains3508 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>3513 3510 </param> 3514 3511 </method> -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r101166 r101180 346 346 HRESULT getFloppyImages(std::vector<ComPtr<IMedium> > &aFloppyImages); 347 347 HRESULT getProgressOperations(std::vector<ComPtr<IProgress> > &aProgressOperations); 348 HRESULT getGuestOSFamilies(std::vector<com::Utf8Str> &aOSFamilies); 348 349 HRESULT getGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aGuestOSTypes); 349 350 HRESULT getSharedFolders(std::vector<ComPtr<ISharedFolder> > &aSharedFolders); … … 399 400 HRESULT getGuestOSType(const com::Utf8Str &aId, 400 401 ComPtr<IGuestOSType> &aType); 401 HRESULT getGuestOSFamilies(std::vector<com::Utf8Str> &aOSFamilies);402 402 HRESULT getGuestOSVariantsByFamilyId(const Utf8Str &strOSFamily, 403 403 std::vector<com::Utf8Str> &aOSVariants); -
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.