filemanager/bkupengine/src/CMMCScBkupArchiveInfo.cpp
changeset 0 6a9f87576119
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2005 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: CMMCScBkupArchiveInfo Implementation
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 #include "CMMCScBkupArchiveInfo.h"
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 // ========================= MEMBER FUNCTIONS ================================
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CMMCScBkupArchiveInfo::CMMCScBkupArchiveInfo()
       
    28 // 
       
    29 // C++ constructor.
       
    30 // ---------------------------------------------------------------------------
       
    31 CMMCScBkupArchiveInfo::CMMCScBkupArchiveInfo()
       
    32     {
       
    33     }
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // CMMCScBkupArchiveInfo::~CMMCScBkupArchiveInfo()
       
    37 // 
       
    38 // Destructor.
       
    39 // ---------------------------------------------------------------------------
       
    40 CMMCScBkupArchiveInfo::~CMMCScBkupArchiveInfo()
       
    41     {
       
    42     delete iFileInfo;
       
    43     iSecureIds.Close();
       
    44     iExcludedSecureIds.Close();
       
    45     }
       
    46 
       
    47 
       
    48 // ---------------------------------------------------------------------------
       
    49 // CMMCScBkupArchiveInfo::ConstructL()
       
    50 // 
       
    51 // 
       
    52 // ---------------------------------------------------------------------------
       
    53 void CMMCScBkupArchiveInfo::ConstructL( const TEntry& aEntry )
       
    54     {
       
    55     iFileInfo = CMMCScBkupFileInfo::NewL( aEntry, 0 );
       
    56     }
       
    57 
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // CMMCScBkupArchiveInfo::NewL()
       
    61 // 
       
    62 // 
       
    63 // ---------------------------------------------------------------------------
       
    64 CMMCScBkupArchiveInfo* CMMCScBkupArchiveInfo::NewL( const TEntry& aEntry )
       
    65     {
       
    66     CMMCScBkupArchiveInfo* self = NewLC( aEntry );
       
    67     CleanupStack::Pop(self);
       
    68     return self;
       
    69     }
       
    70 
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // CMMCScBkupArchiveInfo::NewLC()
       
    74 // 
       
    75 // 
       
    76 // ---------------------------------------------------------------------------
       
    77 CMMCScBkupArchiveInfo* CMMCScBkupArchiveInfo::NewLC( const TEntry& aEntry )
       
    78     {
       
    79     CMMCScBkupArchiveInfo* self = new(ELeave) CMMCScBkupArchiveInfo( );
       
    80     CleanupStack::PushL(self);
       
    81     self->ConstructL(aEntry);
       
    82     return self;
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // CMMCScBkupArchiveInfo::SetSIDs()
       
    87 // 
       
    88 // 
       
    89 // ---------------------------------------------------------------------------
       
    90 void CMMCScBkupArchiveInfo::SetSIDs( RArray<TSecureId>& aSIDs )
       
    91     {
       
    92     TInt count = aSIDs.Count();
       
    93     
       
    94     for(TInt i = 0; i < count; i++ )
       
    95         {
       
    96         iSecureIds.Append(aSIDs[i]);
       
    97         }
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // CMMCScBkupArchiveInfo::SetExcludedSIDs()
       
   102 // 
       
   103 // 
       
   104 // ---------------------------------------------------------------------------
       
   105 void CMMCScBkupArchiveInfo::SetExcludedSIDs( RArray<TSecureId>& aExcludedSIDs )
       
   106     {
       
   107     TInt count = aExcludedSIDs.Count();
       
   108     
       
   109     for(TInt i = 0; i < count; i++ )
       
   110         {
       
   111         iExcludedSecureIds.Append(aExcludedSIDs[i]);
       
   112         }
       
   113     }
       
   114 
       
   115 // ---------------------------------------------------------------------------
       
   116 // CMMCScBkupArchiveInfo::SIDs()
       
   117 // 
       
   118 // 
       
   119 // ---------------------------------------------------------------------------
       
   120 const RArray<TSecureId>& CMMCScBkupArchiveInfo::SIDs( TBitFlags aCategory ) const
       
   121     {
       
   122     __ASSERT_ALWAYS(aCategory == iCategory, User::Invariant());
       
   123     
       
   124     return iSecureIds;
       
   125     }
       
   126     
       
   127 // ---------------------------------------------------------------------------
       
   128 // CMMCScBkupArchiveInfo::ExcludeSIDs()
       
   129 // 
       
   130 // 
       
   131 // ---------------------------------------------------------------------------
       
   132 const RArray<TSecureId>& CMMCScBkupArchiveInfo::ExcludedSIDs( TBitFlags aCategory ) const
       
   133     {
       
   134     __ASSERT_ALWAYS(aCategory == iCategory, User::Invariant());
       
   135     
       
   136     return iExcludedSecureIds;
       
   137     }
       
   138     
       
   139 // ---------------------------------------------------------------------------
       
   140 // CMMCScBkupArchiveInfo::Category()
       
   141 // 
       
   142 // 
       
   143 // ---------------------------------------------------------------------------
       
   144 EXPORT_C TBitFlags CMMCScBkupArchiveInfo::Category() const
       
   145     {
       
   146     return iCategory;
       
   147     }
       
   148         
       
   149 // ---------------------------------------------------------------------------
       
   150 // CMMCScBkupArchiveInfo::FileName()
       
   151 // 
       
   152 // 
       
   153 // ---------------------------------------------------------------------------
       
   154 EXPORT_C const TDesC& CMMCScBkupArchiveInfo::FileName() const
       
   155     {
       
   156     return iFileInfo->FileName();
       
   157     }
       
   158 
       
   159 // ---------------------------------------------------------------------------
       
   160 // CMMCScBkupArchiveInfo::DateTime()
       
   161 // 
       
   162 // 
       
   163 // ---------------------------------------------------------------------------
       
   164 EXPORT_C const TTime& CMMCScBkupArchiveInfo::DateTime() const
       
   165     {
       
   166     return iFileInfo->DateTime();
       
   167     }
       
   168 
       
   169 // ---------------------------------------------------------------------------
       
   170 // CMMCScBkupArchiveInfo::Drive()
       
   171 // 
       
   172 // 
       
   173 // ---------------------------------------------------------------------------
       
   174 EXPORT_C TDriveNumber CMMCScBkupArchiveInfo::Drive() const
       
   175     {
       
   176     return iFileInfo->Drive();
       
   177     }