third_party/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
/**
 *  Searches for a shared folder with the given logical name
 *  in the collection of shared folders.
 *
 *  @param aName            logical name of the shared folder
 *  @param aSharedFolder    where to return the found object
 *  @param aSetError        whether to set the error info if the folder is
 *                          not found
 *  @return
 *      S_OK when found or VBOX_E_OBJECT_NOT_FOUND when not found
 *
 *  @note
 *      must be called from under the object's lock!
 */
Searches for a shared folder with the given logical name
in the collection of shared folders.

@param aName            logical name of the shared folder
@param aSharedFolder    where to return the found object
@param aSetError        whether to set the error info if the folder is
not found
@return
S_OK when found or VBOX_E_OBJECT_NOT_FOUND when not found

@note
must be called from under the object's lock!
Searches for a shared folder with the given logical name in the collection of shared folders . @param aName logical name of the shared folder @param aSharedFolder where to return the found object @param aSetError whether to set the error info if the folder is not found @return S_OK when found or VBOX_E_OBJECT_NOT_FOUND when not found @note must be called from under the object ' s lock!
HRESULT Machine::i_findSharedFolder(const Utf8Str &aName,
                                    ComObjPtr<SharedFolder> &aSharedFolder,
                                    bool aSetError )
{
    HRESULT rc = VBOX_E_OBJECT_NOT_FOUND;
    for (HWData::SharedFolderList::const_iterator
         it = mHWData->mSharedFolders.begin();
         it != mHWData->mSharedFolders.end();
         ++it)
    {
        SharedFolder *pSF = *it;
        AutoCaller autoCaller(pSF);
        if (pSF->i_getName() == aName)
        {
            aSharedFolder = pSF;
            rc = S_OK;
            break;
        }
    }
    if (aSetError && FAILED(rc))
        setError(rc, tr("Could not find a shared folder named '%s'"), aName.c_str());
    return rc;
}
HRESULT Machine :: i_findSharedFolder ( const Utf8Str & aName , ComObjPtr < SharedFolder > & aSharedFolder , bool aSetError ) { HRESULT rc = VBOX_E_OBJECT_NOT_FOUND ; for ( HWData :: SharedFolderList :: const_iterator it = mHWData -> mSharedFolders . begin ( ) ; it != mHWData -> mSharedFolders . end ( ) ; ++ it ) { SharedFolder * pSF = * it ; AutoCaller autoCaller ( pSF ) ; if ( pSF -> i_getName ( ) == aName ) { aSharedFolder = pSF ; rc = S_OK ; break ; } } if ( aSetError && FAILED ( rc ) ) setError ( rc , tr ( " " ) , aName . c_str ( ) ) ; return rc ; }
Searches for a shared folder with the given logical name
  in the collection of shared folders.
Searches for a shared folder with the given logical name in the collection of shared folders .
/* = false */