williamr@2: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file THTTPHdrFieldIter.h williamr@2: @warning : This file contains Rose Model ID comments - please do not delete williamr@2: */ williamr@2: williamr@2: #ifndef __THTTPHDRFIELDITER_H__ williamr@2: #define __THTTPHDRFIELDITER_H__ williamr@2: williamr@2: // System includes williamr@2: #include williamr@2: #include williamr@2: williamr@2: // Forward declarations williamr@2: class CHeaders; williamr@2: williamr@2: williamr@2: //##ModelId=3A914DFD005C williamr@2: class THTTPHdrFieldIter williamr@2: /** williamr@2: Iterator class to iterate the fields within a RHTTPHeaders. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: /** Construct an iterator for the fields of the supplied header collection. williamr@2: @param aHeaders The header collection whose fields we want to iterate williamr@2: */ williamr@2: //##ModelId=3A914DFD0087 williamr@2: THTTPHdrFieldIter(const CHeaders* aHeaders); williamr@2: /** Class destructor williamr@2: */ williamr@2: //##ModelId=3A914DFD0086 williamr@2: IMPORT_C ~THTTPHdrFieldIter(); williamr@2: williamr@2: /** Reset iterator to point at the first field in the header collection williamr@2: */ williamr@2: //##ModelId=3A914DFD0085 williamr@2: IMPORT_C void First(); williamr@2: williamr@2: /** Check if the iterator is at the end of the collection. If so, williamr@2: further calls to operator() will return NULL. williamr@2: @return True if the iterator has reached the end of the header williamr@2: fields williamr@2: */ williamr@2: //##ModelId=3A914DFD0084 williamr@2: IMPORT_C TBool AtEnd() const; williamr@2: williamr@2: /** Advance the iterator to the next field. williamr@2: @return True if the iterator still points at a valid part williamr@2: after advancing. williamr@2: */ williamr@2: //##ModelId=3A914DFD007E williamr@2: IMPORT_C void operator++(); williamr@2: williamr@2: /** Obtain the name of the header field currently pointed at by williamr@2: the iterator. williamr@2: @return The field name; or if the iterator has williamr@2: gone off the end of the header collection williamr@2: */ williamr@2: //##ModelId=3A914DFD007D williamr@2: IMPORT_C RStringTokenF operator()(); williamr@2: williamr@2: private: williamr@2: williamr@2: /** Check the iterator state for invalidity following deletions in the collection williamr@2: */ williamr@2: //##ModelId=3BA613240002 williamr@2: void CheckInvalidation(); williamr@2: williamr@2: /** The headers whose fields we are iterating. williamr@2: */ williamr@2: //##ModelId=3A914DFD007A williamr@2: const CHeaders* iHeaders; williamr@2: /** The index of the field in the header that is currently pointed williamr@2: at by the iterator williamr@2: */ williamr@2: //##ModelId=3A914DFD0072 williamr@2: TInt iPosIdx; williamr@2: }; williamr@2: williamr@2: inline THTTPHdrFieldIter::THTTPHdrFieldIter(const CHeaders* aHeaders) williamr@2: : iHeaders(aHeaders) williamr@2: { williamr@2: First(); williamr@2: } williamr@2: williamr@2: williamr@2: #endif // __THTTPHDRFIELDITER_H__