third_party/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
/**
 * Returns a storage controller object with the given name.
 *
 *  @param aName                 storage controller name to find
 *  @param aStorageController    where to return the found storage controller
 *  @param aSetError             true to set extended error info on failure
 */
Returns a storage controller object with the given name.
@param aName                 storage controller name to find
@param aStorageController    where to return the found storage controller
@param aSetError             true to set extended error info on failure
Returns a storage controller object with the given name . @param aName storage controller name to find @param aStorageController where to return the found storage controller @param aSetError true to set extended error info on failure
HRESULT Machine::i_getStorageControllerByName(const Utf8Str &aName,
                                              ComObjPtr<StorageController> &aStorageController,
                                              bool aSetError )
{
    AssertReturn(!aName.isEmpty(), E_INVALIDARG);
    for (StorageControllerList::const_iterator
         it = mStorageControllers->begin();
         it != mStorageControllers->end();
         ++it)
    {
        if ((*it)->i_getName() == aName)
        {
            aStorageController = (*it);
            return S_OK;
        }
    }
    if (aSetError)
        return setError(VBOX_E_OBJECT_NOT_FOUND,
                        tr("Could not find a storage controller named '%s'"),
                        aName.c_str());
    return VBOX_E_OBJECT_NOT_FOUND;
}
HRESULT Machine :: i_getStorageControllerByName ( const Utf8Str & aName , ComObjPtr < StorageController > & aStorageController , bool aSetError ) { AssertReturn ( ! aName . isEmpty ( ) , E_INVALIDARG ) ; for ( StorageControllerList :: const_iterator it = mStorageControllers -> begin ( ) ; it != mStorageControllers -> end ( ) ; ++ it ) { if ( ( * it ) -> i_getName ( ) == aName ) { aStorageController = ( * it ) ; return S_OK ; } } if ( aSetError ) return setError ( VBOX_E_OBJECT_NOT_FOUND , tr ( " " ) , aName . c_str ( ) ) ; return VBOX_E_OBJECT_NOT_FOUND ; }
Returns a storage controller object with the given name.
Returns a storage controller object with the given name .
/* = false */