filemanager/bkupengine/inc/RMMCScBkupArchiveStreams.h
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: Declaration for RMMCScBkupArchiveReadStream
       
    15 *     
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __RMMCSCBKUPARCHIVESTREAMS_H__
       
    20 #define __RMMCSCBKUPARCHIVESTREAMS_H__
       
    21 
       
    22 // System includes
       
    23 #include <s32strm.h>
       
    24 #include <s32file.h>
       
    25 
       
    26 // User includes
       
    27 #include "TMMCScBkupArchiveVector.h"
       
    28 
       
    29 // Classes referenced
       
    30 class CMMCScBkupArchiveDataManager;
       
    31 
       
    32 
       
    33 
       
    34 /**
       
    35 *
       
    36 *
       
    37 * @since 3.0
       
    38 */
       
    39 NONSHARABLE_CLASS(RMMCScBkupArchiveBuf) : public RFileBuf
       
    40     {
       
    41     public:
       
    42 
       
    43         /**
       
    44         *
       
    45         */
       
    46         RMMCScBkupArchiveBuf();
       
    47 
       
    48     public: // API
       
    49 
       
    50         /**
       
    51         *
       
    52         */
       
    53         void AttachL(CMMCScBkupArchiveDataManager& aADM, RFile64& aFile, TInt aPos, TBool aForWrite );
       
    54 
       
    55         /**
       
    56         *
       
    57         */
       
    58         IMPORT_C void Close();
       
    59 
       
    60         /**
       
    61         *
       
    62         */
       
    63         TBool IsOpen() const;
       
    64 
       
    65     private: // From MStreamBuf
       
    66 
       
    67         /**
       
    68         *
       
    69         */
       
    70         void DoRelease();
       
    71 
       
    72         /**
       
    73         *
       
    74         */
       
    75         void DoSynchL();
       
    76       
       
    77 #ifdef RD_FILE_MANAGER_BACKUP
       
    78         /**
       
    79         *
       
    80         */
       
    81         void DoWriteL(const TAny* aPtr,TInt aLength);
       
    82 #endif
       
    83       
       
    84     private:
       
    85 
       
    86         /**
       
    87         *
       
    88         */
       
    89         void UpdateInfoL();
       
    90 
       
    91     private: // Member data
       
    92 
       
    93         //
       
    94         TBool iWriteMode;
       
    95         //
       
    96         CMMCScBkupArchiveDataManager* iADM;
       
    97         //
       
    98         TMMCScBkupArchiveVector iInfo;
       
    99 
       
   100     };
       
   101 
       
   102 /**
       
   103 *
       
   104 *
       
   105 * @since 3.0
       
   106 */
       
   107 NONSHARABLE_CLASS(RMMCScBkupArchiveReadStream) : public RReadStream
       
   108     {
       
   109     public: // Constructors
       
   110 
       
   111         /**
       
   112         *
       
   113         */
       
   114         inline RMMCScBkupArchiveReadStream() { }
       
   115 
       
   116     public: // API
       
   117 
       
   118         /**
       
   119         *
       
   120         */
       
   121         void OpenLC(CMMCScBkupArchiveDataManager& aADM, RFile64& aArchiveFile, TInt aPos=0);
       
   122 
       
   123         /**
       
   124         *
       
   125         */
       
   126         TBool IsOpen() const;
       
   127 
       
   128     private: // Member data
       
   129         
       
   130         //
       
   131         RMMCScBkupArchiveBuf iSource;
       
   132     };
       
   133 
       
   134 
       
   135 
       
   136 /**
       
   137 *
       
   138 *
       
   139 * @since 3.0
       
   140 */
       
   141 NONSHARABLE_CLASS(RMMCScBkupArchiveWriteStream) : public RWriteStream
       
   142     {
       
   143     public: // Constructors
       
   144 
       
   145         /**
       
   146         *
       
   147         */
       
   148         inline RMMCScBkupArchiveWriteStream()
       
   149             {}
       
   150 
       
   151     public: // API
       
   152 
       
   153         /**
       
   154         *
       
   155         */
       
   156         void OpenLC(CMMCScBkupArchiveDataManager& aADM, RFile64& aArchiveFile, TInt aPos=0);
       
   157 
       
   158         /**
       
   159         *
       
   160         */
       
   161         TBool IsOpen() const;
       
   162 
       
   163     private: // Member data
       
   164         
       
   165         //
       
   166         RMMCScBkupArchiveBuf iSink;
       
   167     };
       
   168 
       
   169 
       
   170 
       
   171 #endif // __RMMCSCBKUPARCHIVESTREAMS_H__
       
   172 
       
   173 //End of File