{
}
-Standard_Boolean StdStorage_RootData::Read(Storage_BaseDriver& theDriver)
+Standard_Boolean StdStorage_RootData::Read(const Handle(Storage_BaseDriver)& theDriver)
{
// Check driver open mode
- if (theDriver.OpenMode() != Storage_VSRead
- && theDriver.OpenMode() != Storage_VSReadWrite)
+ if (theDriver->OpenMode() != Storage_VSRead
+ && theDriver->OpenMode() != Storage_VSReadWrite)
{
myErrorStatus = Storage_VSModeError;
myErrorStatusExt = "OpenMode";
}
// Read root section
- myErrorStatus = theDriver.BeginReadRootSection();
+ myErrorStatus = theDriver->BeginReadRootSection();
if (myErrorStatus != Storage_VSOk)
{
myErrorStatusExt = "BeginReadRootSection";
TCollection_AsciiString aRootName, aTypeName;
Standard_Integer aRef;
- Standard_Integer len = theDriver.RootSectionSize();
+ Standard_Integer len = theDriver->RootSectionSize();
for (Standard_Integer i = 1; i <= len; i++)
{
try
{
OCC_CATCH_SIGNALS
- theDriver.ReadRoot(aRootName, aRef, aTypeName);
+ theDriver->ReadRoot(aRootName, aRef, aTypeName);
}
catch (Storage_StreamTypeMismatchError const&)
{
myObjects.Add(aRootName, aRoot);
}
- myErrorStatus = theDriver.EndReadRootSection();
+ myErrorStatus = theDriver->EndReadRootSection();
if (myErrorStatus != Storage_VSOk)
{
myErrorStatusExt = "EndReadRootSection";
return Standard_True;
}
-Standard_Boolean StdStorage_RootData::Write(Storage_BaseDriver& theDriver)
+Standard_Boolean StdStorage_RootData::Write(const Handle(Storage_BaseDriver)& theDriver)
{
// Check driver open mode
- if (theDriver.OpenMode() != Storage_VSWrite
- && theDriver.OpenMode() != Storage_VSReadWrite)
+ if (theDriver->OpenMode() != Storage_VSWrite
+ && theDriver->OpenMode() != Storage_VSReadWrite)
{
myErrorStatus = Storage_VSModeError;
myErrorStatusExt = "OpenMode";
}
// Write root section
- myErrorStatus = theDriver.BeginWriteRootSection();
+ myErrorStatus = theDriver->BeginWriteRootSection();
if (myErrorStatus != Storage_VSOk)
{
myErrorStatusExt = "BeginWriteRootSection";
return Standard_False;
}
- theDriver.SetRootSectionSize(NumberOfRoots());
+ theDriver->SetRootSectionSize(NumberOfRoots());
for (StdStorage_MapOfRoots::Iterator anIt(myObjects); anIt.More(); anIt.Next())
{
const Handle(StdStorage_Root)& aRoot = anIt.Value();
try
{
OCC_CATCH_SIGNALS
- theDriver.WriteRoot(aRoot->Name(), aRoot->Reference(), aRoot->Type());
+ theDriver->WriteRoot(aRoot->Name(), aRoot->Reference(), aRoot->Type());
}
catch (Storage_StreamTypeMismatchError const&)
{
}
}
- myErrorStatus = theDriver.EndWriteRootSection();
+ myErrorStatus = theDriver->EndWriteRootSection();
if (myErrorStatus != Storage_VSOk)
{
myErrorStatusExt = "EndWriteRootSection";