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