realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.h
changeset 0 307788aac0a8
child 26 822e1f077722
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2005-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          : SIPSyntaxCheck.h
       
    16 * Part of       : Codec
       
    17 * Parsing utilities class 
       
    18 * Version       : SIP/4.0 
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 /**
       
    26  @internalComponent
       
    27 */
       
    28 
       
    29 
       
    30 #ifndef SIPSYNTAXCHECK_H
       
    31 #define SIPSYNTAXCHECK_H
       
    32 
       
    33 #include "siphostport.h"
       
    34 #include <e32std.h>
       
    35 
       
    36 
       
    37 // Parsing utilities class
       
    38 class SIPSyntaxCheck
       
    39 	{
       
    40 public:
       
    41 
       
    42 	static TBool Token (const TDesC8& aValue);
       
    43 	static TBool AlphaMaxSize8 (const TDesC8& aValue);
       
    44 	static TBool Host (const TDesC8& aValue);
       
    45 	static TBool Word (const TDesC8& aValue);
       
    46 	static TBool User (const TDesC8& aUser);
       
    47 	static TBool Password (const TDesC8& aPassword);
       
    48 	static TBool StartsAndEndsWithQuotes (const TDesC8& aValue);
       
    49 	static TBool QuotedString (const TDesC8& aValue);
       
    50 	static TBool QuotedStringValue (const TDesC8& aValue, 
       
    51 	                                const TChar& aExtraChr = 0);
       
    52 	static TBool SIPVersion (const TDesC8& aValue);
       
    53 	static TBool ReasonPhrase (const TDesC8& aValue);
       
    54 	static TBool UInt (const TDesC8& aValue);
       
    55 	static TBool UInt (const TDesC8& aValue, TUint& aResult);
       
    56 	static TBool Real (const TDesC8& aValue);
       
    57 	static TBool Real (const TDesC8& aValue, TReal& aResult);
       
    58 	static TBool GenericParamValue (const TDesC8& aValue);
       
    59 	static TBool QValue (const TDesC8& aValue);
       
    60 	static TBool TtlValue (const TDesC8& aValue);
       
    61 	static TBool HexValue (const TDesC8& aValue, TInt aLength=-1);
       
    62 	static TBool ExtensionHeaderValue (const TDesC8& aValue);
       
    63 	static TBool QuotedTokenWithComma (const TDesC8& aValue);
       
    64     static TInt HostType (const TDesC8& aHost, CSIPHostPort::TType& aHostType);
       
    65     static TBool Comment(const TDesC8& aComment);
       
    66     static TBool FeatureValue(const TDesC8& aValue);
       
    67     static TBool Base64Encoded(const TDesC8& aValue);
       
    68 
       
    69 private:
       
    70 
       
    71 	static TBool SkipAndCheckEscaped (TLex8& aLex);
       
    72 	static TBool SkipAndCheckNonAscii (const TChar& aChr, TLex8& aLex);
       
    73 	static TBool SkipAndCheckContChars (TLex8& aLex, TInt aCount);
       
    74 	static TBool ValidHostName(const TDesC8& aHost);
       
    75 	static TBool NextHostLabelOk(TLex8& aLex, TPtrC8& aLabel);
       
    76 
       
    77 private: // For testing purposes
       
    78 
       
    79 	UNIT_TEST(CSIPSyntaxCheckTest)
       
    80 	};
       
    81 
       
    82 #endif // SIPSYNTAXCHECK_H
       
    83 
       
    84 // End of File