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); |