1.1 --- a/epoc32/include/escapeutils.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/escapeutils.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,102 @@
1.4 -escapeutils.h
1.5 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// This file contains the API definition for escape enoding functionality
1.19 +// and UNICODE/UTF8 conversion. Escape encoding is performed as specified
1.20 +// by RFC2396.
1.21 +//
1.22 +//
1.23 +
1.24 +
1.25 +
1.26 +/**
1.27 + @file EscapeUtils.h
1.28 + @publishedAll
1.29 + @released
1.30 +*/
1.31 +
1.32 +#ifndef __ESCAPEUTILS_H__
1.33 +#define __ESCAPEUTILS_H__
1.34 +
1.35 +// System includes
1.36 +//
1.37 +#include <e32base.h>
1.38 +#include <uriutilscommon.h>
1.39 +
1.40 +
1.41 +/**
1.42 +Comments : Provides an API to allow data to be escape encoded and decoded.
1.43 +Also provide an API for converting a UNICODE data (16-bit descriptor) into
1.44 +UTF8 data (8-bit descriptor) and vice-verse.
1.45 +@publishedAll
1.46 +@released
1.47 +@since 6.0
1.48 +*/
1.49 +class EscapeUtils
1.50 + {
1.51 +public: // Enums
1.52 +
1.53 +/**
1.54 + enum TEscapeMode
1.55 + Enum defining escaping modes. Each mode has a different set of reserved characters.
1.56 + These are based on various uri components, as decribed in RFC2396.
1.57 + */
1.58 + enum TEscapeMode
1.59 + {
1.60 + /** Default mode, which has no reserved characters */
1.61 + EEscapeNormal = 0,
1.62 + /** Mode specifying reserved characters in a uri query - ;/?:@&=+$,[] */
1.63 + EEscapeQuery,
1.64 + /** Mode specifying reserved characters in a uri path - /;=?[] */
1.65 + EEscapePath,
1.66 + /** Mode specifying reserved characters in a uri authority - /;:@?[] */
1.67 + EEscapeAuth,
1.68 + /** Mode specifying reserved characters in a URL ;/?:@&=+$[]!\'()~ */
1.69 + EEscapeUrlEncoded
1.70 + };
1.71 +
1.72 +public: // Methods
1.73 +
1.74 + IMPORT_C static HBufC8* EscapeEncodeL(const TDesC8& aData, TEscapeMode aMode);
1.75 +
1.76 + IMPORT_C static HBufC16* EscapeEncodeL(const TDesC16& aData, TEscapeMode aMode);
1.77 +
1.78 + IMPORT_C static HBufC8* EscapeEncodeL(const TDesC8& aData, const TDesC8& aReservedChars);
1.79 +
1.80 + IMPORT_C static HBufC16* EscapeEncodeL(const TDesC16& aData, const TDesC16& aReservedChars);
1.81 +
1.82 + IMPORT_C static HBufC8* EscapeDecodeL(const TDesC8& aData);
1.83 +
1.84 + IMPORT_C static HBufC16* EscapeDecodeL(const TDesC16& aData);
1.85 +
1.86 + IMPORT_C static HBufC8* ConvertFromUnicodeToUtf8L(const TDesC& aData);
1.87 +
1.88 + IMPORT_C static HBufC* ConvertToUnicodeFromUtf8L(const TDesC8& aData);
1.89 +
1.90 + IMPORT_C static TBool IsExcludedChar(TChar aChar);
1.91 +
1.92 + IMPORT_C static TBool IsEscapeTriple(const TDesC8& aData, TInt& aHexValue);
1.93 +
1.94 + IMPORT_C static TBool IsEscapeTriple(const TDesC16& aData, TInt& aHexValue);
1.95 +
1.96 + IMPORT_C static HBufC8* SpecificEscapeEncodeL ( const TDesC8& aData, const TDesC8& aCharsToEscape );
1.97 +
1.98 + static HBufC8* ReEscapeEncodeL(const TDesC8& aData);
1.99 +
1.100 +private: // Dummy Method
1.101 +
1.102 + IMPORT_C static HBufC8* DummyForwardingFunctionForCompatibility( const TDesC8& aData, const TDesC8& aCharsToEscape );
1.103 +
1.104 + };
1.105 +
1.106 +#endif // __ESCAPEUTILS_H__