applayerprotocols/wapbase/wutil/curl.cpp
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2000-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 #include "curl.h"
       
    17 #include <escapeutils.h>
       
    18 
       
    19 
       
    20 EXPORT_C void CUrl::Stub7()
       
    21 	{
       
    22 	}
       
    23 	
       
    24 EXPORT_C void CUrl::Stub8()
       
    25 	{
       
    26 	}
       
    27 	
       
    28 EXPORT_C void CUrl::Stub9()
       
    29 	{
       
    30 	}
       
    31 	
       
    32 EXPORT_C void CUrl::Stub10()
       
    33 	{
       
    34 	}
       
    35 	
       
    36 EXPORT_C void CUrl::Stub11()
       
    37 	{
       
    38 	}
       
    39 	
       
    40 EXPORT_C void CUrl::Stub12()
       
    41 	{
       
    42 	}
       
    43 	
       
    44 EXPORT_C void CUrl::Stub13()
       
    45 	{
       
    46 	}
       
    47 	
       
    48 EXPORT_C void CUrl::Stub14()
       
    49 	{
       
    50 	}
       
    51 	
       
    52 EXPORT_C void CUrl::Stub15()
       
    53 	{
       
    54 	}
       
    55 	
       
    56 EXPORT_C void CUrl::Stub16()
       
    57 	{
       
    58 	}
       
    59 	
       
    60 EXPORT_C void CUrl::Stub18()
       
    61 	{
       
    62 	}
       
    63 	
       
    64 EXPORT_C void CUrl::Stub19()
       
    65 	{
       
    66 	}
       
    67 	
       
    68 EXPORT_C void CUrl::Stub20()
       
    69 	{
       
    70 	}
       
    71 		
       
    72 EXPORT_C void CUrl::Stub21()
       
    73 	{
       
    74 	}
       
    75 
       
    76 
       
    77 EXPORT_C HBufC* CUrl::EscapeDecodeL(const TDesC& aString)
       
    78 //
       
    79 // Decodes any escape triples in aString back into excluded characters
       
    80 	{
       
    81 	return EscapeUtils::EscapeDecodeL(aString);
       
    82 	}
       
    83 
       
    84 EXPORT_C HBufC* CUrl::EscapeEncodeL(const TDesC& aString, TInt aEscapeMode)
       
    85 //
       
    86 // Encodes any excluded characters in aString as escape triples - excluded characters set by aEscapeMode
       
    87 	{
       
    88 	// Generic Compare is first 13 Chars ending in \"
       
    89 	// Path is first 21 chars ending in ,
       
    90 	// Scheme is full 23 chars 
       
    91 	_LIT(KReservedChars,"{}|\\^[]\'<>#%\";?@&=+$,/:");
       
    92 	TInt numChars = 13;
       
    93 	
       
    94 	switch (aEscapeMode)
       
    95 		{
       
    96 	case EUrlGenericCompare:
       
    97 		break;
       
    98 		
       
    99 	case EUrlScheme:
       
   100 		numChars = 23;
       
   101 		break;	
       
   102 	case EUrlPath:
       
   103 		numChars = 21;
       
   104 		break;	
       
   105 	default:
       
   106 		return NULL;
       
   107 		}
       
   108 	
       
   109 	return EscapeUtils::EscapeEncodeL(aString,KReservedChars().Left(numChars));	
       
   110 	}