Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

HRESULT ImageMediumBase::saveSettings ( settings::Key aImagesNode  ) 

Saves image data by appending a new <Image> child node to the given <Images> parent node.

Parameters:
aImagesNode <Images> node.
Note:
Locks this object for reading.

Definition at line 1079 of file MediumImpl.cpp.

References settings::Key::appendKey(), AssertReturn, CheckComRCReturnRC, settings::Key::createKey(), and settings::Key::isNull().

{
    using namespace settings;

    AssertReturn (!aImagesNode.isNull(), E_FAIL);

    AutoCaller autoCaller (this);
    CheckComRCReturnRC (autoCaller.rc());

    AutoReadLock alock (this);

    Key imageNode = aImagesNode.appendKey ("Image");
    /* required */
    imageNode.setValue <Guid> ("uuid", m.id);
    /* required */
    imageNode.setValue <Bstr> ("location", m.locationFull);
    /* optional */
    if (!m.description.isNull())
    {
        Key descNode = aImagesNode.createKey ("Description");
        descNode.setKeyValue <Bstr> (m.description);
    }

    return S_OK;
}


Generated by  Doxygen 1.6.0   Back to index