os/ossrv/genericservices/httputils/UriUtils/UriUtilsInternal.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2001-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 // 
    15 // 
    16 //
    17 
    18 /**
    19  @file UriUtilsInternal.h
    20 */
    21 
    22 #ifndef __URIUTILSINTERNAL_H__
    23 #define __URIUTILSINTERNAL_H__
    24 
    25 // System includes
    26 //
    27 #include <e32base.h>
    28 #include <uriutils.h>
    29 
    30 // Constants
    31 //
    32 _LIT(KSipScheme, "sip");
    33 _LIT(KSipsScheme, "sips");
    34 _LIT8(KSipScheme8, "sip");
    35 _LIT8(KSipsScheme8, "sips");
    36 _LIT8(KTelScheme8, "tel");	
    37 
    38 const TInt KUriNetworkAuthorityDelimiterLength	= 2;
    39 
    40 /**
    41 	enum specifies scheme type whether it is Sip or Tel
    42 	@internalComponent
    43 	@released
    44 */
    45 enum TUriSchemeType
    46 	{
    47 	ESchemeTypeUnknown,
    48 	ESchemeTypeSip,
    49 	ESchemeTypeTel 
    50 	};
    51 
    52 template<class TDesCType>
    53 LOCAL_C TBool CheckForExcludedChars(const TDesCType& aData);
    54 
    55 
    56 template<class TDesCType>
    57 LOCAL_C UriUtils::TUriHostType CheckHostType(const TDesCType& aHost);
    58 
    59 template<class TDesCType>
    60 LOCAL_C TBool CheckValidTextHost(const TDesCType& aHost);
    61 
    62 LOCAL_C void PercentEncodeL(CUri8* aNormalisedUri);
    63 LOCAL_C void CaseNormaliseL(CUri8* aNormalisedUri);
    64 LOCAL_C void RemoveDotSegmentsL(CUri8* aNormalisedUri);
    65 
    66 //supporting methods for case normalisation
    67 LOCAL_C void DoPercentEncodeL(CUri8* aNormalisedUri, TUriComponent aComponent);
    68 LOCAL_C void DoCaseNormaliseL(CUri8* aNormalisedUri, TUriComponent aComponent);
    69 LOCAL_C void updateStrings(TPtr8& inputBuf, TPtr8& outPutBuf, TInt length);
    70 LOCAL_C TBool ValidateAndConvertPercentEncodedTriple(TDesC8& aData, TDes8& aCaseNormalizedData);
    71 void RemoveExtraneousDotSegmentsL(HBufC8* aUriInputPath);
    72 
    73 TBool IsNetworkScheme(const TDesC8& aScheme);
    74 TBool IsNetworkScheme(const TDesC16& aScheme);
    75 
    76 TUriSchemeType SchemeType(const TDesC8& aScheme);
    77 TUriSchemeType SchemeType(const TDesC16& aScheme);
    78 
    79 TBool IsTextHostValid(const TDesC8& aHost);
    80 TBool IsTextHostValid(const TDesC16& aHost);
    81 void GetNameValuePair(const TDesC8& aSegment, TPtrC8& aName, TPtrC8& aValue);
    82 
    83 #endif	// __URIUTILSINTERNAL_H__