equal
deleted
inserted
replaced
|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CHTTPCONTENTREADER_H__ |
|
17 #define __CHTTPCONTENTREADER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <f32file.h> |
|
21 class MHttpDataSender; |
|
22 |
|
23 class CHttpFileReader : public CActive |
|
24 { |
|
25 public: |
|
26 static CHttpFileReader* New(RFile aFile, MHttpDataSender& aReceiver); |
|
27 ~CHttpFileReader(); |
|
28 |
|
29 void Read(); |
|
30 TInt Size() const |
|
31 { |
|
32 return iTotalSize; |
|
33 } |
|
34 private: |
|
35 // From CActive |
|
36 |
|
37 void RunL(); |
|
38 void DoCancel(); |
|
39 TInt RunError(TInt aError); |
|
40 |
|
41 |
|
42 CHttpFileReader(RFile aFile, MHttpDataSender& aReceiver); |
|
43 TInt Construct(); |
|
44 private: |
|
45 RBuf8 iContentBuffer; |
|
46 RFile iFile; |
|
47 MHttpDataSender& iDataSender; |
|
48 TInt iReadBytes; |
|
49 TInt iTotalSize; |
|
50 }; |
|
51 |
|
52 |
|
53 |
|
54 #endif // __CHTTPCONTENTREADER_H__ |