// create storage based on the temporary stream
XStorage xTempStorage = m_aTestHelper.createStorageFromStream( m_xStorageFactory,
xTempFileStream,
ElementModes.WRITE ); if ( xTempStorage == null )
{
m_aTestHelper.Error( "Can't create temporary storage representation!" ); returnfalse;
}
// open a new substorage
XStorage xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage, "SubStorage1",
ElementModes.WRITE ); if ( xTempSubStorage == null )
{
m_aTestHelper.Error( "Can't create substorage!" ); returnfalse;
}
byte pBytes1[] = { 1, 1, 1, 1, 1 };
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream1", "MediaType1", true,
pBytes1,
aRelations ) ) returnfalse;
// set Relations for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, true,
ElementModes.WRITE,
aRelations ) ) returnfalse;
// set Relations for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage, false,
ElementModes.WRITE,
aRelations ) ) returnfalse;
// commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) returnfalse;
// commit the root storage so the contents must be stored now if ( !m_aTestHelper.commitStorage( xTempStorage ) ) returnfalse;
// dispose used storage to free resources if ( !m_aTestHelper.disposeStorage( xTempStorage ) ) returnfalse;
// now check all the written information
// close the output part of the temporary stream // the output part must present since we already wrote to the stream if ( !m_aTestHelper.closeOutput( xTempFileStream ) ) returnfalse;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.