realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.cpp
changeset 34 3c8db403127f
parent 0 307788aac0a8
equal deleted inserted replaced
27:740ceea8e153 34:3c8db403127f
    18 
    18 
    19 
    19 
    20 
    20 
    21 
    21 
    22 #include "SIPSyntaxCheck.h"
    22 #include "SIPSyntaxCheck.h"
    23 #include "TSIPChar.h"
       
    24 #include "sipcodecerr.h"
    23 #include "sipcodecerr.h"
    25 #include <uriutils.h>
    24 #include <uriutils.h>
    26 
    25 
    27 _LIT8(KSIP, "SIP");
    26 _LIT8(KSIP, "SIP");
    28 _LIT8(KTwoDots, "..");
    27 _LIT8(KTwoDots, "..");
    29 
    28 
    30 // -----------------------------------------------------------------------------
    29 // -----------------------------------------------------------------------------
    31 // SIPSyntaxCheck::Token
    30 // SIPSyntaxCheck::Token
    32 // -----------------------------------------------------------------------------
    31 // -----------------------------------------------------------------------------
    33 //
    32 //
    34 TBool SIPSyntaxCheck::Token (const TDesC8& aValue)
    33 TBool SIPSyntaxCheck::Token (const TDesC8& aValue, RArray<TSIPChar>* aArray)
    35 	{
    34 	{
       
    35 	
    36 	if (aValue.Length() == 0) 
    36 	if (aValue.Length() == 0) 
    37 		{
    37 		{
    38 		return EFalse;
    38 		return EFalse;
    39 		}
    39 		}
    40 	TLex8 lex(aValue);
    40 	TLex8 lex(aValue);
    41 	TSIPChar sipChr = lex.Get();
    41 	TSIPChar sipChr = lex.Get();
    42 	while (sipChr)
    42 	while (sipChr)
    43 		{
    43 		{
    44 		if (!sipChr.IsTokenChar()) 
    44 		if (!sipChr.IsTokenChar( aArray ) )
    45 			{
    45 			{
    46 			return EFalse;
    46 			return EFalse;
    47 			}
    47 			}
    48 		sipChr = lex.Get();
    48 		sipChr = lex.Get();
    49 		}
    49 		}