realtimenetprots/sipfw/SIP/Codec/src/TSIPHeaderNameValueIter.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2004-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 // Name          : TSIPHeaderNameValueIter.cpp
       
    15 // Part of       : SIP Codec
       
    16 // Version       : SIP/4.0 
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #include "TSIPHeaderNameValueIter.h"
       
    23 #include "CSIPPreParser.h"
       
    24 //#include "CSIPHeaderNameValue.h"
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // TSIPHeaderNameValueIter::TSIPHeaderNameValueIter
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 TSIPHeaderNameValueIter::TSIPHeaderNameValueIter (CSIPPreParser& aPreParser)
       
    31  : iPreParser(aPreParser),
       
    32    iCurrIndex(0)
       
    33 	{
       
    34 	}
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // TSIPHeaderNameValueIter::NextL
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CSIPHeaderNameValue* TSIPHeaderNameValueIter::NextL ()
       
    41 	{
       
    42 	__ASSERT_ALWAYS (iCurrIndex < iPreParser.HeaderCount(),
       
    43 					User::Leave (KErrOverflow));
       
    44 
       
    45 	CSIPHeaderNameValue* headerNameValue = 0;
       
    46 	headerNameValue = iPreParser.ParseNameValueL (iCurrIndex++);
       
    47 	return headerNameValue;
       
    48 	}
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // TSIPHeaderNameValueIter::End
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 TBool TSIPHeaderNameValueIter::End ()
       
    55 	{
       
    56 	if (iCurrIndex == iPreParser.HeaderCount()) 
       
    57         {
       
    58         return ETrue;
       
    59         }
       
    60 	return EFalse;
       
    61 	}
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // TSIPHeaderNameValueIter::SetToFirst
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 void TSIPHeaderNameValueIter::SetToFirst ()
       
    68 	{
       
    69 	iCurrIndex = 0;
       
    70 	}