realtimenetprots/sipfw/SIP/Codec/src/CSIPPreParser.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name          : CSIPPreParser.h
       
    16 * Part of       : SIP Codec
       
    17 * Version       : SIP/6.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef CSIPPREPARSER_H
       
    29 #define CSIPPREPARSER_H
       
    30 
       
    31 #include <e32base.h>
       
    32 #include "_sipcodecdefs.h"
       
    33 
       
    34 class CSIPHeaderNameValue;
       
    35 
       
    36 
       
    37 class CSIPPreParser : public CBase
       
    38 	{
       
    39 public:
       
    40 	static CSIPPreParser* NewL (HBufC8* aSipMessageBuf);
       
    41 	static CSIPPreParser* NewLC (HBufC8* aSipMessageBuf);
       
    42 
       
    43 	~CSIPPreParser ();
       
    44 
       
    45     TPtrC8 FirstLineL ();
       
    46 	HBufC8* ContentL ();
       
    47 
       
    48 private:
       
    49 
       
    50 	CSIPPreParser (const TDesC8& aSipMessageDes);
       
    51 	void ConstructL (HBufC8* aSipMessageBuf);
       
    52 
       
    53 	TUint HeaderCount ();
       
    54 	CSIPHeaderNameValue* ParseNameValueL (TInt aIndex);
       
    55 	TPtrC8 GetLineL (TInt aLineStartPosition);
       
    56 
       
    57 	void ParseL ();
       
    58 	void CreateHeaderBufL (const TDesC8& aSipMessageDes);
       
    59     void FindHeaderPartEndPositionL (const TDesC8& aSipMessageDes,
       
    60                                      TInt& aPosition);
       
    61 
       
    62 	TBool HandleCrL ();
       
    63 	TBool HandleLfL ();
       
    64 	void SkipSpacesAndTabsL ();	
       
    65 	void MoveToNextLineL ();
       
    66 	inline TChar GetCharL();
       
    67 	inline TChar GetChar();
       
    68 	inline void UnGetChar();
       
    69 
       
    70 private: // Data
       
    71 
       
    72 	HBufC8*       iSipMessageBuf;
       
    73 	HBufC8*       iHeaderBuf;
       
    74 	TInt          iOriginalHeaderPartLength;
       
    75     RArray<TUint> iHeaderStartArray;
       
    76     TLex8         iLexBuf;
       
    77 
       
    78 	friend class TSIPHeaderNameValueIter;
       
    79 	
       
    80 private: // For testing purposes
       
    81 
       
    82 	UNIT_TEST(CSIPPreParserTest)
       
    83 	};
       
    84 
       
    85 #endif // CSIPPREPARSER_H
       
    86 
       
    87 // End of File