|
1 // Copyright (c) 2001-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file THTTPHdrFieldIter.h |
|
20 @warning : This file contains Rose Model ID comments - please do not delete |
|
21 */ |
|
22 |
|
23 #ifndef __THTTPHDRFIELDITER_H__ |
|
24 #define __THTTPHDRFIELDITER_H__ |
|
25 |
|
26 // System includes |
|
27 #include <e32std.h> |
|
28 #include <stringpool.h> |
|
29 |
|
30 // Forward declarations |
|
31 class CHeaders; |
|
32 |
|
33 |
|
34 //##ModelId=3A914DFD005C |
|
35 class THTTPHdrFieldIter |
|
36 /** |
|
37 Iterator class to iterate the fields within a RHTTPHeaders. |
|
38 @publishedAll |
|
39 @released |
|
40 */ |
|
41 { |
|
42 public: |
|
43 /** Construct an iterator for the fields of the supplied header collection. |
|
44 @param aHeaders The header collection whose fields we want to iterate |
|
45 */ |
|
46 //##ModelId=3A914DFD0087 |
|
47 THTTPHdrFieldIter(const CHeaders* aHeaders); |
|
48 /** Class destructor |
|
49 */ |
|
50 //##ModelId=3A914DFD0086 |
|
51 IMPORT_C ~THTTPHdrFieldIter(); |
|
52 |
|
53 /** Reset iterator to point at the first field in the header collection |
|
54 */ |
|
55 //##ModelId=3A914DFD0085 |
|
56 IMPORT_C void First(); |
|
57 |
|
58 /** Check if the iterator is at the end of the collection. If so, |
|
59 further calls to operator() will return NULL. |
|
60 @return True if the iterator has reached the end of the header |
|
61 fields |
|
62 */ |
|
63 //##ModelId=3A914DFD0084 |
|
64 IMPORT_C TBool AtEnd() const; |
|
65 |
|
66 /** Advance the iterator to the next field. |
|
67 @return True if the iterator still points at a valid part |
|
68 after advancing. |
|
69 */ |
|
70 //##ModelId=3A914DFD007E |
|
71 IMPORT_C void operator++(); |
|
72 |
|
73 /** Obtain the name of the header field currently pointed at by |
|
74 the iterator. |
|
75 @return The field name; or <empty string> if the iterator has |
|
76 gone off the end of the header collection |
|
77 */ |
|
78 //##ModelId=3A914DFD007D |
|
79 IMPORT_C RStringTokenF operator()(); |
|
80 |
|
81 private: |
|
82 |
|
83 /** Check the iterator state for invalidity following deletions in the collection |
|
84 */ |
|
85 //##ModelId=3BA613240002 |
|
86 void CheckInvalidation(); |
|
87 |
|
88 /** The headers whose fields we are iterating. |
|
89 */ |
|
90 //##ModelId=3A914DFD007A |
|
91 const CHeaders* iHeaders; |
|
92 /** The index of the field in the header that is currently pointed |
|
93 at by the iterator |
|
94 */ |
|
95 //##ModelId=3A914DFD0072 |
|
96 TInt iPosIdx; |
|
97 }; |
|
98 |
|
99 inline THTTPHdrFieldIter::THTTPHdrFieldIter(const CHeaders* aHeaders) |
|
100 : iHeaders(aHeaders) |
|
101 { |
|
102 First(); |
|
103 } |
|
104 |
|
105 |
|
106 #endif // __THTTPHDRFIELDITER_H__ |