VirtualBox

Changeset 27900 in vbox


Ignore:
Timestamp:
Mar 31, 2010 2:07:18 PM (15 years ago)
Author:
vboxsync
Message:

Main/OVF: move another method

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r27895 r27900  
    420420}
    421421
    422 /**
    423  * Public method implementation.
    424  * @param path
    425  * @return
    426  */
    427 STDMETHODIMP Appliance::Read(IN_BSTR path, IProgress **aProgress)
    428 {
    429     if (!path) return E_POINTER;
    430     CheckComArgOutPointerValid(aProgress);
    431 
    432     AutoCaller autoCaller(this);
    433     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    434 
    435     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    436 
    437     if (!isApplianceIdle())
    438         return E_ACCESSDENIED;
    439 
    440     if (m->pReader)
    441     {
    442         delete m->pReader;
    443         m->pReader = NULL;
    444     }
    445 
    446     // see if we can handle this file; for now we insist it has an ".ovf" extension
    447     Utf8Str strPath (path);
    448     if (!strPath.endsWith(".ovf", Utf8Str::CaseInsensitive))
    449         return setError(VBOX_E_FILE_ERROR,
    450                         tr("Appliance file must have .ovf extension"));
    451 
    452     ComObjPtr<Progress> progress;
    453     HRESULT rc = S_OK;
    454     try
    455     {
    456         /* Parse all necessary info out of the URI */
    457         parseURI(strPath, m->locInfo);
    458         rc = readImpl(m->locInfo, progress);
    459     }
    460     catch (HRESULT aRC)
    461     {
    462         rc = aRC;
    463     }
    464 
    465     if (SUCCEEDED(rc))
    466         /* Return progress to the caller */
    467         progress.queryInterfaceTo(aProgress);
    468 
    469     return S_OK;
    470 }
    471 
    472422STDMETHODIMP Appliance::CreateVFSExplorer(IN_BSTR aURI, IVFSExplorer **aExplorer)
    473423{
  • trunk/src/VBox/Main/ApplianceImplImport.cpp

    r27895 r27900  
    5050//
    5151////////////////////////////////////////////////////////////////////////////////
     52
     53/**
     54 * Public method implementation.
     55 * @param path
     56 * @return
     57 */
     58STDMETHODIMP Appliance::Read(IN_BSTR path, IProgress **aProgress)
     59{
     60    if (!path) return E_POINTER;
     61    CheckComArgOutPointerValid(aProgress);
     62
     63    AutoCaller autoCaller(this);
     64    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     65
     66    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     67
     68    if (!isApplianceIdle())
     69        return E_ACCESSDENIED;
     70
     71    if (m->pReader)
     72    {
     73        delete m->pReader;
     74        m->pReader = NULL;
     75    }
     76
     77    // see if we can handle this file; for now we insist it has an ".ovf" extension
     78    Utf8Str strPath (path);
     79    if (!strPath.endsWith(".ovf", Utf8Str::CaseInsensitive))
     80        return setError(VBOX_E_FILE_ERROR,
     81                        tr("Appliance file must have .ovf extension"));
     82
     83    ComObjPtr<Progress> progress;
     84    HRESULT rc = S_OK;
     85    try
     86    {
     87        /* Parse all necessary info out of the URI */
     88        parseURI(strPath, m->locInfo);
     89        rc = readImpl(m->locInfo, progress);
     90    }
     91    catch (HRESULT aRC)
     92    {
     93        rc = aRC;
     94    }
     95
     96    if (SUCCEEDED(rc))
     97        /* Return progress to the caller */
     98        progress.queryInterfaceTo(aProgress);
     99
     100    return S_OK;
     101}
    52102
    53103/**
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