filemanager/src/fmbkupengine/inc/CMMCScBkupFileInfo.h
branchRCL_3
changeset 21 65326cf895ed
parent 20 491b3ed49290
child 22 f5c50b8af68c
equal deleted inserted replaced
20:491b3ed49290 21:65326cf895ed
     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: Declaration for CMMCScBkupFileInfo
       
    15 *     
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __CMMCSCBKUPFILEINFO_H__
       
    20 #define __CMMCSCBKUPFILEINFO_H__
       
    21 
       
    22 // System includes
       
    23 #include <f32file.h>
       
    24 #include <s32strm.h>
       
    25 
       
    26 
       
    27 /**
       
    28 * Represents a public file within an archive. Each public file
       
    29 * has an associated data owner. This is encapsulated by the SID
       
    30 * of the owning process.
       
    31 *
       
    32 * @since 3.0
       
    33 */
       
    34 NONSHARABLE_CLASS(CMMCScBkupFileInfo) : public CBase
       
    35     {
       
    36     public:
       
    37 
       
    38         /**
       
    39         * Static constructor
       
    40         */
       
    41         static CMMCScBkupFileInfo* NewL( const TEntry& aEntry, TSecureId aAssociatedSID );
       
    42 
       
    43         /**
       
    44         * Static constructor
       
    45         */
       
    46         static CMMCScBkupFileInfo* NewLC( const TEntry& aEntry, TSecureId aAssociatedSID );
       
    47 
       
    48         /**
       
    49         * Static constructor
       
    50         */
       
    51         static CMMCScBkupFileInfo* NewLC( RReadStream& aStream );
       
    52 
       
    53         /**
       
    54         * C++ destructor
       
    55         */
       
    56         ~CMMCScBkupFileInfo();
       
    57 
       
    58     private:
       
    59 
       
    60         /**
       
    61         * C++ default constructor
       
    62         */
       
    63         CMMCScBkupFileInfo();
       
    64 
       
    65         /**
       
    66         * C++ default constructor
       
    67         */
       
    68         CMMCScBkupFileInfo( const TEntry& aEntry, TSecureId aAssociatedSID );
       
    69 
       
    70         /**
       
    71         *
       
    72         */
       
    73         void ConstructL( const TEntry& aEntry );
       
    74 
       
    75     public: // API - Getters
       
    76 
       
    77         /**
       
    78         *
       
    79         */
       
    80         inline const TDesC& FileName() const { return *iFileName; }
       
    81 
       
    82         /**
       
    83         *
       
    84         */
       
    85         inline TInt Size() const { return iSize; }
       
    86 
       
    87         /**
       
    88         *
       
    89         */
       
    90         inline const TTime& DateTime() const { return iDateTime; }
       
    91 
       
    92         /**
       
    93         *
       
    94         */
       
    95         inline TUint Attributes() const { return iAttributes; }
       
    96 
       
    97         /**
       
    98         *
       
    99         */
       
   100         inline TSecureId SecureId() const { return iSecureId; }
       
   101 
       
   102         /**
       
   103         *
       
   104         */
       
   105         TDriveNumber Drive() const;
       
   106 
       
   107     public: // Store/Restore
       
   108 
       
   109         /**
       
   110         *
       
   111         */
       
   112         void InternalizeL(RReadStream& aStream);
       
   113 
       
   114         /**
       
   115         *
       
   116         */
       
   117         void ExternalizeL(RWriteStream& aStream) const;
       
   118 
       
   119     private: // Internal enumerations
       
   120         enum
       
   121             {
       
   122             EStreamFormatVersion1 = 1
       
   123             };
       
   124 
       
   125     public: // Comparison support
       
   126 
       
   127         /**
       
   128         *
       
   129         */
       
   130         static TInt OrderByFileName(const CMMCScBkupFileInfo& aLeft, const CMMCScBkupFileInfo& aRight);
       
   131 
       
   132         /**
       
   133         *
       
   134         */
       
   135         static TBool CompareByFileName(const CMMCScBkupFileInfo& aLeft, const CMMCScBkupFileInfo& aRight);
       
   136 
       
   137     private: // Member data
       
   138 
       
   139         // File name
       
   140         HBufC* iFileName;
       
   141         //
       
   142         TInt iSize;
       
   143         //
       
   144         TTime iDateTime;
       
   145         //
       
   146         TUint iAttributes;
       
   147         //
       
   148         TSecureId iSecureId;
       
   149     };
       
   150 
       
   151 
       
   152 
       
   153 
       
   154 #endif // __CMMCSCBKUPFILEINFO_H__
       
   155 
       
   156 //End of File