filemanager/src/fmbkupengine/src/CMMCScBkupDataOwnerCollection.cpp
branchRCL_3
changeset 20 491b3ed49290
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
       
     1 /*
       
     2 * Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: CMMCScBkupDataOwnerCollection implementation
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 #include "CMMCScBkupDataOwnerCollection.h"
       
    20 
       
    21 // User includes
       
    22 #include "MMCScBkupLogger.h"
       
    23 #include "TMMCScBkupDriveAndSize.h"
       
    24 #include "CMMCScBkupDataOwnerInfo.h"
       
    25 #include "MMCScBkupSBEUtils.h"
       
    26 #include "MMMCScBkupDriver.h"
       
    27 #include "CMMCScBkupDriveDataSizeManager.h"
       
    28 #include "RMMCScBkupProgressSizer.h"
       
    29 #ifdef RD_FILE_MANAGER_BACKUP
       
    30 #include "CMMCScBkupArchiveInfo.h"
       
    31 #include "BkupEngine.hrh"
       
    32 #endif
       
    33 
       
    34 // Constants
       
    35 const TInt KMMCScBkupDataOwnerGranularity = 20;
       
    36 
       
    37 
       
    38 
       
    39 
       
    40 // ========================= MEMBER FUNCTIONS ================================
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // CMMCScBkupDataOwnerCollection::CMMCScBkupDataOwnerCollection()
       
    44 // 
       
    45 // C++ constructor.
       
    46 // ---------------------------------------------------------------------------
       
    47 CMMCScBkupDataOwnerCollection::CMMCScBkupDataOwnerCollection( MMMCScBkupDriver& aDriver, TBitFlags aCategory )
       
    48 :   iDriver( aDriver ), iOwners(KMMCScBkupDataOwnerGranularity), iCategory( aCategory )
       
    49     {
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // CMMCScBkupDataOwnerCollection::~CMMCScBkupDataOwnerCollection()
       
    54 // 
       
    55 // Destructor.
       
    56 // ---------------------------------------------------------------------------
       
    57 CMMCScBkupDataOwnerCollection::~CMMCScBkupDataOwnerCollection()
       
    58     {
       
    59     Reset();
       
    60     iOwners.Close();
       
    61     delete iRestoreSizer;
       
    62     }
       
    63 
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // CMMCScBkupDataOwnerCollection::ConstructL()
       
    67 // 
       
    68 // 
       
    69 // ---------------------------------------------------------------------------
       
    70 void CMMCScBkupDataOwnerCollection::ConstructL()
       
    71     {
       
    72     // The restore sizer data type is not relevant. It holds
       
    73     // the combined disk space requirements for all drives
       
    74     // for all data types. 
       
    75     iRestoreSizer = CMMCScBkupDriveSizer::NewLC( EMMCScBkupOwnerDataTypeAny );
       
    76     CleanupStack::Pop( iRestoreSizer );
       
    77     }
       
    78 
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // CMMCScBkupDataOwnerCollection::NewL()
       
    82 // 
       
    83 // 
       
    84 // ---------------------------------------------------------------------------
       
    85 CMMCScBkupDataOwnerCollection* CMMCScBkupDataOwnerCollection::NewL( MMMCScBkupDriver& aDriver, TBitFlags aCategory )
       
    86     {
       
    87     CMMCScBkupDataOwnerCollection* self = new(ELeave) CMMCScBkupDataOwnerCollection( aDriver, aCategory );
       
    88     CleanupStack::PushL(self);
       
    89     self->ConstructL();
       
    90     CleanupStack::Pop(self);
       
    91     return self;
       
    92     }
       
    93 
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // CMMCScBkupDataOwnerCollection::AssignL()
       
    97 // 
       
    98 // 
       
    99 // ---------------------------------------------------------------------------
       
   100 #ifdef RD_FILE_MANAGER_BACKUP
       
   101 TBool CMMCScBkupDataOwnerCollection::AssignL( const CMMCScBkupDataOwnerInfo& dataOwnerInfo )
       
   102     {
       
   103     const CMMCScBkupArchiveInfo& archive = iDriver.DrvParamsBase().ArchiveInfo( Category() );
       
   104     const RArray<TSecureId>& secureIds = archive.SIDs( Category() );
       
   105     const RArray<TSecureId>& excludedSecureIds = archive.ExcludedSIDs( Category() );
       
   106     TBitFlags flags = archive.SpecialFlags();
       
   107     TBitFlags excludedFlags = archive.ExcludedSpecialFlags();
       
   108 
       
   109     // Check whether data owner belongs to this category
       
   110     if( BelongsToL( dataOwnerInfo, flags, excludedFlags, secureIds, excludedSecureIds) )
       
   111         {
       
   112         iOwners.AppendL(&dataOwnerInfo);
       
   113         return ETrue;
       
   114         }
       
   115     
       
   116     return EFalse;
       
   117     }
       
   118 #else
       
   119 void CMMCScBkupDataOwnerCollection::AssignL( RDataOwnerInfoArray& aArray )
       
   120     {
       
   121     const TInt count = aArray.Count();
       
   122     //
       
   123     for(TInt i=count-1; i>=0; i--)
       
   124         {
       
   125         // Ownership is immediately transferred to the backup owner info object
       
   126         // so we should remove it from the array prior to passing into NewLC
       
   127         conn::CDataOwnerInfo* sbDataOwner = aArray[i];
       
   128         aArray.Remove(i); // Ensures it won't be deleted twice
       
   129         //
       
   130         CMMCScBkupDataOwnerInfo* info = CMMCScBkupDataOwnerInfo::NewLC( sbDataOwner );
       
   131         iOwners.AppendL(info);
       
   132         CleanupStack::Pop(info);
       
   133         }
       
   134     }
       
   135 #endif
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // CMMCScBkupDataOwnerCollection::AppendL()
       
   139 // 
       
   140 // 
       
   141 // ---------------------------------------------------------------------------
       
   142 void CMMCScBkupDataOwnerCollection::AppendL( CMMCScBkupDataOwnerInfo* aNewEntry )
       
   143     {
       
   144     iOwners.AppendL( aNewEntry );
       
   145     }
       
   146 
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // CMMCScBkupDataOwnerCollection::Count()
       
   150 // 
       
   151 // 
       
   152 // ---------------------------------------------------------------------------
       
   153 TInt CMMCScBkupDataOwnerCollection::Count() const
       
   154     {
       
   155     return iOwners.Count();
       
   156     }
       
   157 
       
   158 
       
   159 // ---------------------------------------------------------------------------
       
   160 // CMMCScBkupDataOwnerCollection::Owner()
       
   161 // 
       
   162 // 
       
   163 // ---------------------------------------------------------------------------
       
   164 CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::Owner(TInt aIndex)
       
   165     {
       
   166     CMMCScBkupDataOwnerInfo* info = iOwners[aIndex];
       
   167     return *info;
       
   168     }
       
   169 
       
   170 
       
   171 // ---------------------------------------------------------------------------
       
   172 // CMMCScBkupDataOwnerCollection::Owner()
       
   173 // 
       
   174 // 
       
   175 // ---------------------------------------------------------------------------
       
   176 const CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::Owner(TInt aIndex) const
       
   177     {
       
   178     const CMMCScBkupDataOwnerInfo* info = iOwners[aIndex];
       
   179     return *info;
       
   180     }
       
   181 
       
   182 
       
   183 // ---------------------------------------------------------------------------
       
   184 // CMMCScBkupDataOwnerCollection::OwnerL()
       
   185 // 
       
   186 // 
       
   187 // ---------------------------------------------------------------------------
       
   188 CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::OwnerL( TSecureId aSID )
       
   189     {
       
   190     TInt index = KErrNotFound;
       
   191     CMMCScBkupDataOwnerInfo* ret = CMMCScBkupDataOwnerInfo::New( aSID );
       
   192     if  (ret)
       
   193         {
       
   194         TIdentityRelation<CMMCScBkupDataOwnerInfo> relation(CMMCScBkupDataOwnerInfo::CompareDataOwnerBySIDL);
       
   195         index = iOwners.Find( ret, relation );
       
   196         delete ret;
       
   197         ret = NULL;
       
   198         }
       
   199     //
       
   200     if  (index >= 0)
       
   201         {
       
   202         ret = iOwners[index];
       
   203         }
       
   204     else
       
   205         {
       
   206         User::Leave(KErrNotFound);
       
   207         }
       
   208     //
       
   209     return *ret;
       
   210     }
       
   211 
       
   212 
       
   213 // ---------------------------------------------------------------------------
       
   214 // CMMCScBkupDataOwnerCollection::OwnerL()
       
   215 // 
       
   216 // 
       
   217 // ---------------------------------------------------------------------------
       
   218 const CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::OwnerL( TSecureId aSID ) const
       
   219     {
       
   220     CMMCScBkupDataOwnerCollection& self = *const_cast<CMMCScBkupDataOwnerCollection*>(this);
       
   221     CMMCScBkupDataOwnerInfo& ret = self.OwnerL( aSID );
       
   222     return ret;
       
   223     }
       
   224 
       
   225 
       
   226 // ---------------------------------------------------------------------------
       
   227 // CMMCScBkupDataOwnerCollection::OwnerL()
       
   228 // 
       
   229 // 
       
   230 // ---------------------------------------------------------------------------
       
   231 CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::OwnerL( TUid aPackageId )
       
   232     {
       
   233     CMMCScBkupDataOwnerInfo* ret = NULL;
       
   234     const TInt count = iOwners.Count();
       
   235     //
       
   236     for(TInt i=0; i<count; i++)
       
   237         {
       
   238         CMMCScBkupDataOwnerInfo* entry = iOwners[ i ];
       
   239         //
       
   240         const TUid packageId = MMCScBkupSBEUtils::PackageIdFromGenericL( entry->Owner().Identifier() );
       
   241         if  ( packageId == aPackageId )
       
   242             {
       
   243             ret = entry;
       
   244             }
       
   245         }
       
   246     //
       
   247     if  ( !ret )
       
   248         {
       
   249         User::Leave(KErrNotFound);
       
   250         }
       
   251     //
       
   252     return *ret;
       
   253     }
       
   254 
       
   255 
       
   256 // ---------------------------------------------------------------------------
       
   257 // CMMCScBkupDataOwnerCollection::OwnerL()
       
   258 // 
       
   259 // 
       
   260 // ---------------------------------------------------------------------------
       
   261 const CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::OwnerL( TUid aPackageId ) const
       
   262     {
       
   263     CMMCScBkupDataOwnerCollection& self = *const_cast<CMMCScBkupDataOwnerCollection*>(this);
       
   264     CMMCScBkupDataOwnerInfo& ret = self.OwnerL( aPackageId );
       
   265     return ret;
       
   266     }
       
   267 
       
   268 
       
   269 // ---------------------------------------------------------------------------
       
   270 // CMMCScBkupDataOwnerCollection::OwnerL()
       
   271 // 
       
   272 // 
       
   273 // ---------------------------------------------------------------------------
       
   274 CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::OwnerL( const TDesC& aHash )
       
   275     {
       
   276     CMMCScBkupDataOwnerInfo* ret = NULL;
       
   277     const TInt count = iOwners.Count();
       
   278     //
       
   279     for(TInt i=0; i<count; i++)
       
   280         {
       
   281         CMMCScBkupDataOwnerInfo* entry = iOwners[ i ];
       
   282         
       
   283         // Check if its a java item...
       
   284         const TSBDerivedType type = entry->Owner().Identifier().DerivedTypeL();
       
   285         if  ( type == EJavaDerivedType || type == EJavaTransferDerivedType )
       
   286             {
       
   287             // Get hash
       
   288             HBufC* hash = MMCScBkupSBEUtils::JavaHashFromGenericLC( entry->Owner().Identifier() );
       
   289             const TBool foundMatch = ( *hash == aHash );
       
   290             CleanupStack::PopAndDestroy( hash );
       
   291 
       
   292             if  ( foundMatch )
       
   293                 {
       
   294                 ret = entry;
       
   295                 break;
       
   296                 }
       
   297             }
       
   298         }
       
   299     //
       
   300     if  ( !ret )
       
   301         {
       
   302         User::Leave(KErrNotFound);
       
   303         }
       
   304     //
       
   305     return *ret;
       
   306     }
       
   307 
       
   308 
       
   309 // ---------------------------------------------------------------------------
       
   310 // CMMCScBkupDataOwnerCollection::OwnerL()
       
   311 // 
       
   312 // 
       
   313 // ---------------------------------------------------------------------------
       
   314 const CMMCScBkupDataOwnerInfo& CMMCScBkupDataOwnerCollection::OwnerL( const TDesC& aHash ) const
       
   315     {
       
   316     CMMCScBkupDataOwnerCollection& self = *const_cast<CMMCScBkupDataOwnerCollection*>(this);
       
   317     CMMCScBkupDataOwnerInfo& ret = self.OwnerL( aHash );
       
   318     return ret;
       
   319     }
       
   320 
       
   321 
       
   322 // ---------------------------------------------------------------------------
       
   323 // CMMCScBkupDataOwnerCollection::Remove()
       
   324 // 
       
   325 // 
       
   326 // ---------------------------------------------------------------------------
       
   327 void CMMCScBkupDataOwnerCollection::Remove( TInt aIndex )
       
   328     {
       
   329     CMMCScBkupDataOwnerInfo* info = iOwners[aIndex];
       
   330     delete info;
       
   331     iOwners.Remove(aIndex);
       
   332     }
       
   333 
       
   334 
       
   335 // ---------------------------------------------------------------------------
       
   336 // CMMCScBkupDataOwnerCollection::Reset()
       
   337 // 
       
   338 // 
       
   339 // ---------------------------------------------------------------------------
       
   340 void CMMCScBkupDataOwnerCollection::Reset()
       
   341     {
       
   342     iOwners.ResetAndDestroy();
       
   343     }
       
   344 
       
   345 
       
   346 // ---------------------------------------------------------------------------
       
   347 // CMMCScBkupDataOwnerCollection::TotalOperationalSizeL()
       
   348 // 
       
   349 // 
       
   350 // ---------------------------------------------------------------------------
       
   351 TInt64 CMMCScBkupDataOwnerCollection::TotalOperationalSizeL() const
       
   352     {
       
   353     RMMCScBkupProgressSizer sizer( iDriver.DrvParamsBase().DriveAndOperations() );
       
   354     TInt64 size = 0;
       
   355     //
       
   356     const TInt count = Count();
       
   357     for(TInt i=0; i<count; i++)
       
   358         {
       
   359         const CMMCScBkupDataOwnerInfo& owner = Owner( i );
       
   360         //
       
   361         const TInt64 restoreSizeForDO = sizer.RestoreCombinedDataSizeL( owner );
       
   362 
       
   363         __LOG2("CMMCScBkupDataOwnerCollection::TotalOperationalSizeL() - data transfer amount required for DO: 0x%08x is: %8Ld", owner.SecureId().iId, restoreSizeForDO );
       
   364 
       
   365         size += restoreSizeForDO;
       
   366         }
       
   367     //
       
   368     return size;
       
   369     }
       
   370 
       
   371 
       
   372 // ---------------------------------------------------------------------------
       
   373 // CMMCScBkupDataOwnerCollection::RebootRequired()
       
   374 // 
       
   375 // 
       
   376 // ---------------------------------------------------------------------------
       
   377 TBool CMMCScBkupDataOwnerCollection::RebootRequired() const
       
   378     {
       
   379     TBool rebootRequired = EFalse;
       
   380     //
       
   381     const TInt count = iOwners.Count();
       
   382     for(TInt i=count-1; i>=0; i--)
       
   383         {
       
   384         // We check the SBE's common settings (for each Data Owner) to identify
       
   385         // if a reboot is required. So long as one data owner requires a
       
   386         // reboot, then we must reset the machine.. hence we break
       
   387         // out of the loop immediately.
       
   388         const CMMCScBkupDataOwnerInfo& info = *iOwners[i];
       
   389         const CDataOwnerInfo& sbeDataOwnerInfo = info.Owner();
       
   390         //
       
   391         if  ( sbeDataOwnerInfo.CommonSettings() & ERequiresReboot )
       
   392             {
       
   393             rebootRequired = ETrue;
       
   394             break;
       
   395             }
       
   396         }
       
   397     //
       
   398     return rebootRequired;
       
   399     }
       
   400 
       
   401 
       
   402 // ---------------------------------------------------------------------------
       
   403 // CMMCScBkupDataOwnerCollection::DiskSpaceRequiredForRestore()
       
   404 // 
       
   405 // 
       
   406 // ---------------------------------------------------------------------------
       
   407 TInt64 CMMCScBkupDataOwnerCollection::DiskSpaceRequiredForRestore( TDriveNumber aDrive ) const
       
   408     {
       
   409     return iRestoreSizer->Size( aDrive );
       
   410     }
       
   411 
       
   412 
       
   413 // ---------------------------------------------------------------------------
       
   414 // CMMCScBkupDataOwnerCollection::CalculateDiskSpaceRequiredForRestoreL()
       
   415 // 
       
   416 // 
       
   417 // ---------------------------------------------------------------------------
       
   418 void CMMCScBkupDataOwnerCollection::CalculateDiskSpaceRequiredForRestoreL()
       
   419     {
       
   420     iRestoreSizer->Reset();
       
   421     //
       
   422     RArray<TMMCScBkupDriveAndSize> driveSizes;
       
   423     CleanupClosePushL( driveSizes );
       
   424     //
       
   425     const TInt count = iOwners.Count();
       
   426     for(TInt i=count-1; i>=0; i--)
       
   427         {
       
   428         const CMMCScBkupDataOwnerInfo& owner = *iOwners[i];
       
   429         __LOG(" ");
       
   430         __LOG1("CMMCScBkupDataOwnerCollection::CalculateDiskSpaceRequiredForRestoreL() - owner: 0x%08x...", owner.SecureId().iId);
       
   431         //
       
   432         owner.OperationalSizesL( driveSizes );
       
   433         //
       
   434         const TInt driveSizesCount = driveSizes.Count();
       
   435         for( TInt j=0; j<driveSizesCount; j++ )
       
   436             {
       
   437             const TMMCScBkupDriveAndSize& entry = driveSizes[ j ];
       
   438             __LOG2("CMMCScBkupDataOwnerCollection::CalculateDiskSpaceRequiredForRestoreL() -    drive: %c:, size: %8Ld", entry.Drive() + 'A', entry.Size());
       
   439             //
       
   440             iRestoreSizer->AddToSizeL( entry.Size(), entry.Drive() );
       
   441             }
       
   442         }
       
   443     //
       
   444     CleanupStack::PopAndDestroy( &driveSizes );
       
   445 
       
   446 #ifdef __MMCSCBKUPLOGGING_ENABLED__
       
   447     __LOG(" ");
       
   448     __LOG(" ");
       
   449     __LOG(" ");
       
   450     __LOG(" ");
       
   451     __LOG("CMMCScBkupDataOwnerCollection::CalculateDiskSpaceRequiredForRestoreL() - SUMMARY:");
       
   452     __LOG(" ");
       
   453 
       
   454     for( TInt d = EDriveA; d<=EDriveZ; d++ )
       
   455         {
       
   456         // Get the size of each data type for this drive.
       
   457         const TDriveNumber drive = static_cast< TDriveNumber >( d );
       
   458         const TInt64 size = DiskSpaceRequiredForRestore( drive );
       
   459 
       
   460         if  ( size > 0 )
       
   461             {
       
   462             __LOG2("CMMCScBkupDataOwnerCollection::CalculateDiskSpaceRequiredForRestoreL() - %8Ld bytes required for drive: %c:", size, drive + 'A' );
       
   463             }
       
   464         }
       
   465 #endif
       
   466     }
       
   467 
       
   468 #ifdef RD_FILE_MANAGER_BACKUP
       
   469 // ---------------------------------------------------------------------------
       
   470 // CMMCScBkupDataOwnerCollection::BelongsToL()
       
   471 // 
       
   472 // 
       
   473 // ---------------------------------------------------------------------------
       
   474 TBool CMMCScBkupDataOwnerCollection::BelongsToL(const CMMCScBkupDataOwnerInfo& aInfo, 
       
   475     TBitFlags aFlags, TBitFlags aExcludedFlags,
       
   476     const RArray<TSecureId> aSecureIds, const RArray<TSecureId> aExcludedSecureIds) const
       
   477     {
       
   478     // First of all check if data owner has system or java data. If it has and these
       
   479     // types have been declared as excluded data types, then skip owner in this catecory.
       
   480     // Public data is more common to data owners together with other data types meaning it
       
   481     // cannot be a reason to invalidate data owner. System's user data folder (e.g. C:\Data) files
       
   482     // are being skipped later on in public data backup phase if category is not EBUCatUserFiles
       
   483     // It would be possible to just skip excluded types per data owner, but it
       
   484     // might make data owner unstable after restore
       
   485 
       
   486     if( ((aExcludedFlags.Value() & EBUCatSpecSystem) && aInfo.HasSystemDataL()) ||
       
   487         ((aExcludedFlags.Value() & EBUCatSpecJava) && aInfo.HasJavaDataL()) ||
       
   488         ((aExcludedFlags.Value() & EBUCatSpecPublic) && aInfo.HasPublicDataL()) )
       
   489         {
       
   490         return EFalse;
       
   491         }
       
   492         
       
   493     // Then check whether all specified and SID not in list of excluded owners
       
   494     if( (aFlags.Value() & EBUCatSpecAll) )
       
   495         {
       
   496         TBool excluded = EFalse;
       
   497         
       
   498         for(TInt i = 0; i < aExcludedSecureIds.Count(); i++)
       
   499             {
       
   500             if(aInfo.SecureId().iId == aExcludedSecureIds[i].iId)
       
   501                 {
       
   502                 excluded = ETrue;
       
   503                 break;
       
   504                 }
       
   505             }
       
   506             
       
   507         return !excluded;
       
   508         }
       
   509     
       
   510     // Then check whether special rules apply
       
   511     if( ((aFlags.Value() & EBUCatSpecSystem) && aInfo.HasSystemDataL()) ||
       
   512         ((aFlags.Value() & EBUCatSpecJava) && aInfo.HasJavaDataL()) ||
       
   513         ((aFlags.Value() & EBUCatSpecPublic) && aInfo.HasPublicDataL()) )
       
   514         {
       
   515         return ETrue;
       
   516         }
       
   517         
       
   518     // Finally check whether SID matches
       
   519     for(TInt i = 0; i < aSecureIds.Count(); i++)
       
   520         {
       
   521         if(aInfo.SecureId().iId == aSecureIds[i].iId)
       
   522             {
       
   523             return ETrue;
       
   524             }
       
   525         }
       
   526         
       
   527     return EFalse;
       
   528     }
       
   529 #endif
       
   530 
       
   531 // ---------------------------------------------------------------------------
       
   532 // CMMCScBkupDataOwnerCollection::InternalizeL()
       
   533 // 
       
   534 // 
       
   535 // ---------------------------------------------------------------------------
       
   536 void CMMCScBkupDataOwnerCollection::InternalizeL( RReadStream& aStream )
       
   537     {
       
   538     aStream.ReadInt32L(); // EStreamFormatVersion1 
       
   539     aStream.ReadInt32L(); // spare1
       
   540     aStream.ReadInt32L(); // spare2
       
   541     aStream.ReadInt32L(); // spare3
       
   542 
       
   543     CMMCScBkupDriveSizer* restoreSizer = CMMCScBkupDriveSizer::NewLC( aStream );
       
   544     delete iRestoreSizer;
       
   545     iRestoreSizer = restoreSizer;
       
   546     CleanupStack::Pop( restoreSizer );
       
   547     }
       
   548 
       
   549 
       
   550 // ---------------------------------------------------------------------------
       
   551 // CMMCScBkupDataOwnerCollection::ExternalizeL()
       
   552 // 
       
   553 // 
       
   554 // ---------------------------------------------------------------------------
       
   555 void CMMCScBkupDataOwnerCollection::ExternalizeL( RWriteStream& aStream ) const
       
   556     {
       
   557     aStream.WriteInt32L( EStreamFormatVersion1 );
       
   558     aStream.WriteInt32L( 0 ); // spare1
       
   559     aStream.WriteInt32L( 0 ); // spare2
       
   560     aStream.WriteInt32L( 0 ); // spare3
       
   561 
       
   562     aStream << *iRestoreSizer;
       
   563     }
       
   564 
       
   565 
       
   566 
       
   567