|
1 // Copyright (c) 2008-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 __CRESPONSE_H__ |
|
17 #define __CRESPONSE_H__ |
|
18 |
|
19 #include <stringpool.h> |
|
20 |
|
21 #include "rresponse.h" |
|
22 #include "CMessage.h" |
|
23 |
|
24 /** An HTTP Response. Provides the real implementation of a response, |
|
25 as proxied in the public API by RResponse. |
|
26 @see RResponse |
|
27 */ |
|
28 class CResponse : public CMessage |
|
29 { |
|
30 public: |
|
31 /** Constructs a response |
|
32 */ |
|
33 IMPORT_C static CResponse* NewL(CHeaderCodec& aCodec, RStringPool& aStringPool); |
|
34 |
|
35 /** Destructor |
|
36 */ |
|
37 IMPORT_C ~CResponse(); |
|
38 |
|
39 /** Returns the status (returned as a reference; use this call to set it) |
|
40 */ |
|
41 inline TInt& Status(); |
|
42 |
|
43 /** Returns the status string (returned as a reference, which you can set) |
|
44 */ |
|
45 inline RStringF& StatusString(); |
|
46 |
|
47 /** Returns ETrue if the HTTP protocol version is 1.0 |
|
48 */ |
|
49 inline TBool IsHTTP10() const; |
|
50 |
|
51 /** Obtain a handle for this response that can be used by the client. |
|
52 */ |
|
53 inline RResponse Handle(); |
|
54 |
|
55 /** Returns the string pool. |
|
56 */ |
|
57 RStringPool& StringPool(); |
|
58 |
|
59 /** Returns the string pool. |
|
60 */ |
|
61 const RStringPool& StringPool() const; |
|
62 |
|
63 /** Returns the HTTP version (returned as a reference, which you can set) |
|
64 */ |
|
65 inline TVersion& Version(); |
|
66 |
|
67 /** Resets the request object. |
|
68 */ |
|
69 inline void Reset(); |
|
70 |
|
71 private: |
|
72 /** Constructor |
|
73 */ |
|
74 CResponse(RStringPool& aStringPool); |
|
75 |
|
76 private: |
|
77 |
|
78 /** The HTTP status code obtained from the HTTP server's response |
|
79 */ |
|
80 TInt iStatus; |
|
81 |
|
82 /** The HTTP status description string obtained from the HTTP server's response |
|
83 */ |
|
84 RStringF iStatusString; |
|
85 |
|
86 /** The HTTP version number (major/minor) obtained from the HTTP server's response |
|
87 */ |
|
88 TVersion iVersion; |
|
89 |
|
90 /** The string pool |
|
91 */ |
|
92 RStringPool& iStringPool; |
|
93 |
|
94 }; |
|
95 |
|
96 #include "CResponse.inl" |
|
97 |
|
98 |
|
99 #endif // __CRESPONSE_H__ |