filemanager/src/fmbkupengine/inc/TMMCScBkupDriveAndSize.h
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: Declaration for TMMCScBkupDriveAndSize
       
    15 *     
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __TMMCSCBKUPDRIVEANDSIZE_H__
       
    20 #define __TMMCSCBKUPDRIVEANDSIZE_H__
       
    21 
       
    22 // System includes
       
    23 #include <s32strm.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 
       
    27 
       
    28 /**
       
    29 *
       
    30 * @since 3.0
       
    31 */
       
    32 NONSHARABLE_CLASS(TMMCScBkupDriveAndSize)
       
    33     {
       
    34     public:
       
    35 
       
    36         /**
       
    37         * C++ default constructor
       
    38         */
       
    39         inline TMMCScBkupDriveAndSize() : iDrive( EDriveC ), iSize( 0 ) { }
       
    40 
       
    41         /**
       
    42         * C++ default constructor
       
    43         */
       
    44         inline TMMCScBkupDriveAndSize( TDriveNumber aDrive, TInt aSize ) : iDrive( aDrive), iSize( aSize ) { }
       
    45 
       
    46     public:
       
    47 
       
    48         /**
       
    49         * Internalize object from stream
       
    50         */
       
    51         void InternalizeL( RReadStream& aStream );
       
    52 
       
    53         /**
       
    54         * Externalize object to stream
       
    55         */
       
    56         void ExternalizeL( RWriteStream& aStream ) const;
       
    57 
       
    58     public: // API
       
    59 
       
    60         /**
       
    61         *
       
    62         */
       
    63         inline TInt64 Size() const { return iSize; }
       
    64 
       
    65         /**
       
    66         *
       
    67         */
       
    68         inline TDriveNumber Drive() const { return iDrive; }
       
    69 
       
    70         /**
       
    71         *
       
    72         */
       
    73         inline void SetSize( TInt64 aSize ) { iSize = aSize; }
       
    74 
       
    75         /**
       
    76         *
       
    77         */
       
    78         inline void AddToSize( TInt64 aAmount ) { iSize += aAmount; }
       
    79 
       
    80         /**
       
    81         *
       
    82         */
       
    83         inline void SetDrive( TDriveNumber aDrive ) { iDrive = aDrive; }
       
    84 
       
    85     private: // Internal enumerations
       
    86         enum
       
    87             {
       
    88             EStreamFormatVersion1 = 1
       
    89             //EStreamFormatVersion2 = 2 // If 64-bit handling will be supported in the future.
       
    90                                         // That will mean in practice a break in archive file format.
       
    91                                         // Change are also needed in TMMCScBkupArchiveVector class
       
    92                                         // to support larger than 2 GB files and data in it.
       
    93             };
       
    94 
       
    95     private: // Data members
       
    96         TDriveNumber iDrive;
       
    97         TInt64 iSize;
       
    98     };
       
    99 
       
   100 
       
   101 
       
   102 
       
   103 
       
   104 #endif // __TMMCSCBKUPDRIVEANDSIZE_H__
       
   105 
       
   106 //End of File