mtpfws/mtpfw/datatypes/interface/cmtptypefile.h
branchRCL_3
changeset 1 f8e15b44d440
parent 0 d0791faffa3f
child 12 523717cdb0ad
equal deleted inserted replaced
0:d0791faffa3f 1:f8e15b44d440
    31 @publishedPartner
    31 @publishedPartner
    32 @released 
    32 @released 
    33 */
    33 */
    34 class CMTPTypeFile : public CActive, public MMTPType
    34 class CMTPTypeFile : public CActive, public MMTPType
    35     {
    35     {
       
    36 
       
    37 class CFileWriter : public CActive
       
    38     {
       
    39 public:
       
    40     
       
    41     static CFileWriter* NewL(RFile&  aFile, RBuf8& aWriteBuf);
       
    42     /*
       
    43      * Get the buffer for transport to receive data.
       
    44      */
       
    45     void GetWriteBuf(TPtr8& aChunk);
       
    46     /*
       
    47      * Get the file write result.
       
    48      */
       
    49     TInt GetResult() const;
       
    50     /*
       
    51      * Issue a async request to write aLength Data
       
    52      * 
       
    53      */
       
    54     void Write(TInt aLength);
       
    55     /*
       
    56      * Wait until the async write complete.
       
    57      */
       
    58     void WaitForWriteComplete();
       
    59     void RunL();
       
    60     ~CFileWriter();
       
    61     
       
    62 private:
       
    63     void DoCancel();
       
    64     CFileWriter(RFile&  aFile, RBuf8& aBuf);
       
    65     void ConstructL();
       
    66     
       
    67 private:
       
    68     TInt    iWriteResult;
       
    69     RFile&  iFile;
       
    70     RBuf8&  iBuf;
       
    71     };
       
    72 
    36 public:
    73 public:
    37 
    74 
    38     IMPORT_C static CMTPTypeFile* NewL(RFs& aFs, const TDesC& aFileName, TFileMode aFileMode);
    75     IMPORT_C static CMTPTypeFile* NewL(RFs& aFs, const TDesC& aFileName, TFileMode aFileMode);
    39     IMPORT_C static CMTPTypeFile* NewLC(RFs& aFs, const TDesC& aFileName, TFileMode aFileMode);
    76     IMPORT_C static CMTPTypeFile* NewLC(RFs& aFs, const TDesC& aFileName, TFileMode aFileMode);
    40 	IMPORT_C static CMTPTypeFile* NewL(RFs& aFs, const TDesC& aFileName, TFileMode aFileMode, TInt64 aRequiredSize, TInt64 aOffSet = 0);
    77 	IMPORT_C static CMTPTypeFile* NewL(RFs& aFs, const TDesC& aFileName, TFileMode aFileMode, TInt64 aRequiredSize, TInt64 aOffSet = 0);
   165     TUint           iWriteSequenceState;
   202     TUint           iWriteSequenceState;
   166 
   203 
   167 	TInt64          iOffSet;
   204 	TInt64          iOffSet;
   168     
   205     
   169     mutable TInt64          iByteSent;
   206     mutable TInt64          iByteSent;
       
   207     /*
       
   208      * Use the writer to controll buffer1 write.
       
   209      */
       
   210     CFileWriter    *iFileWriter1;
       
   211     /*
       
   212      * Use the writer to controll buffer2 write.
       
   213      */
       
   214     CFileWriter    *iFileWriter2;
   170 
   215 
   171     };
   216     };
   172     
   217     
   173 #endif // CMTPTYPEFILE_H
   218 #endif // CMTPTYPEFILE_H
   174 
   219