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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This file contains the API definition for escape enoding functionality
15 // and UNICODE/UTF8 conversion. Escape encoding is performed as specified
26 #ifndef __ESCAPEUTILS_H__
27 #define __ESCAPEUTILS_H__
32 #include <uriutilscommon.h>
36 Comments : Provides an API to allow data to be escape encoded and decoded.
37 Also provide an API for converting a UNICODE data (16-bit descriptor) into
38 UTF8 data (8-bit descriptor) and vice-verse.
49 Enum defining escaping modes. Each mode has a different set of reserved characters.
50 These are based on various uri components, as decribed in RFC2396.
54 /** Default mode, which has no reserved characters */
56 /** Mode specifying reserved characters in a uri query - ;/?:@&=+$,[] */
58 /** Mode specifying reserved characters in a uri path - /;=?[] */
60 /** Mode specifying reserved characters in a uri authority - /;:@?[] */
62 /** Mode specifying reserved characters in a URL ;/?:@&=+$[]!\'()~ */
68 IMPORT_C static HBufC8* EscapeEncodeL(const TDesC8& aData, TEscapeMode aMode);
70 IMPORT_C static HBufC16* EscapeEncodeL(const TDesC16& aData, TEscapeMode aMode);
72 IMPORT_C static HBufC8* EscapeEncodeL(const TDesC8& aData, const TDesC8& aReservedChars);
74 IMPORT_C static HBufC16* EscapeEncodeL(const TDesC16& aData, const TDesC16& aReservedChars);
76 IMPORT_C static HBufC8* EscapeDecodeL(const TDesC8& aData);
78 IMPORT_C static HBufC16* EscapeDecodeL(const TDesC16& aData);
80 IMPORT_C static HBufC8* ConvertFromUnicodeToUtf8L(const TDesC& aData);
82 IMPORT_C static HBufC* ConvertToUnicodeFromUtf8L(const TDesC8& aData);
84 IMPORT_C static TBool IsExcludedChar(TChar aChar);
86 IMPORT_C static TBool IsEscapeTriple(const TDesC8& aData, TInt& aHexValue);
88 IMPORT_C static TBool IsEscapeTriple(const TDesC16& aData, TInt& aHexValue);
90 IMPORT_C static HBufC8* SpecificEscapeEncodeL ( const TDesC8& aData, const TDesC8& aCharsToEscape );
92 static HBufC8* ReEscapeEncodeL(const TDesC8& aData);
94 private: // Dummy Method
96 IMPORT_C static HBufC8* DummyForwardingFunctionForCompatibility( const TDesC8& aData, const TDesC8& aCharsToEscape );
100 #endif // __ESCAPEUTILS_H__