»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Application Protocols INETPROTUTIL »
EscapeUtils
Location:
EscapeUtils.h
Link against: inetprotutil.lib
class EscapeUtils;
Description
Comments : Provides an API to allow data to be escape encoded and decoded. Also provide an API for converting a UNICODE data
(16-bit descriptor) into UTF8 data (8-bit descriptor) and vice-verse.
Members
Defined in EscapeUtils
:
ConvertFromUnicodeToUtf8L()
, ConvertToUnicodeFromUtf8L()
, EEscapeAuth
, EEscapeNormal
, EEscapePath
, EEscapeQuery
, EEscapeUrlEncoded
, EscapeDecodeL()
, EscapeDecodeL()
, EscapeEncodeL()
, EscapeEncodeL()
, EscapeEncodeL()
, EscapeEncodeL()
, IsEscapeTriple()
, IsEscapeTriple()
, IsExcludedChar()
, SpecificEscapeEncodeL()
, TEscapeMode
Member functions
static IMPORT_C HBufC8 *EscapeEncodeL(const TDesC8 &aData, TEscapeMode aMode);
Description
Escape encodes excluded and reserved characters in the data as escape triples. The reserved characters are defined by the
escape mode. These characters and the set of excluded characters specified by RFC2396 form the entire set of excluded data.
Parameters
const TDesC8 &aData |
A descriptor with the data to encode.
|
TEscapeMode aMode |
An enum specifying the escape mode.
|
|
Return value
HBufC8 *
|
A pointer to a descriptor buffer which contains the escape encoded data.
|
|
Leave codes
KUriUtilsErr16BitChar. |
A 16-Bit character was found in the data to be escape encoded.
|
|
static IMPORT_C HBufC16 *EscapeEncodeL(const TDesC16 &aData, TEscapeMode aMode);
Description
Escape encodes excluded and reserved characters in the data as escape triples. The reserved characters are defined by the
escape mode. These characters and the set of excluded characters specified by RFC2396 form the entire set of excluded data.
Parameters
const TDesC16 &aData |
A descriptor with the data to encode.
|
TEscapeMode aMode |
An enum specifying the escape mode.
|
|
Return value
HBufC16 *
|
A pointer to a descriptor buffer which contains the escape encoded data.
|
|
Leave codes
KUriUtilsErr16BitChar. |
A 16-Bit character was found in the data to be escape encoded.
|
|
static IMPORT_C HBufC8 *EscapeEncodeL(const TDesC8 &aData, const TDesC8 &aReservedChars);
Description
Escape encodes excluded and reserved characters in the data as escape triples. These characters and the set of excluded characters
specified by RFC2396 form the entire set of excluded data.
Parameters
const TDesC8 &aData |
A descriptor with the data to encode.
|
const TDesC8 &aReservedChars |
A descriptor with the reserved characters.
|
|
Return value
HBufC8 *
|
A pointer to a descriptor buffer which contains the escape encoded data.
|
|
Leave codes
KUriUtilsErr16BitChar. |
A 16-Bit character was found in the data to be escape encoded.
|
|
static IMPORT_C HBufC16 *EscapeEncodeL(const TDesC16 &aData, const TDesC16 &aReservedChars);
Description
Escape encodes excluded and reserved characters in the data as escape triples. These characters and the set of excluded characters
specified by RFC2396 form the entire set of excluded data.
Parameters
const TDesC16 &aData |
A descriptor with the data to encode.
|
const TDesC16 &aReservedChars |
A descriptor with the reserved characters.
|
|
Return value
HBufC16 *
|
A pointer to a descriptor buffer which contains the escape encoded data.
|
|
Leave codes
KUriUtilsErr16BitChar. |
A 16-Bit character was found in the data to be escape encoded.
|
|
static IMPORT_C HBufC8 *EscapeDecodeL(const TDesC8 &aData);
Description
Escape decodes the data.
Parameters
const TDesC8 &aData |
A descriptor with the data to decode.
|
|
Return value
HBufC8 *
|
A pointer to a descriptor buffer which contains the escape decoded data.
|
|
static IMPORT_C HBufC16 *EscapeDecodeL(const TDesC16 &aData);
Description
Escape decodes the data.
Parameters
const TDesC16 &aData |
A descriptor with the data to decode.
|
|
Return value
HBufC16 *
|
A pointer to a descriptor buffer which contains the escape decoded data.
|
|
ConvertFromUnicodeToUtf8L()
static IMPORT_C HBufC8 *ConvertFromUnicodeToUtf8L(const TDesC &aData);
Description
Converts UNICODE data into UTF8 format.
Parameters
const TDesC &aData |
A descriptor with the data to convert.
|
|
Return value
HBufC8 *
|
A pointer to an 8-bit descriptor buffer which contains UTF8 data.
|
|
Leave codes
KUriUtilsCannotConvert. |
When the input data cannot be converted.
|
|
ConvertToUnicodeFromUtf8L()
static IMPORT_C HBufC *ConvertToUnicodeFromUtf8L(const TDesC8 &aData);
Description
Converts UTF8 format into UNICODE data.
Parameters
const TDesC8 &aData |
A descriptor with the data to convert.
|
|
Return value
HBufC *
|
A pointer to a 16-bit descriptor buffer which contains UNICODE data.
|
|
Leave codes
KUriUtilsCannotConvert. |
When the input data cannot be converted.
|
|
static IMPORT_C TBool IsExcludedChar(TChar aChar);
Description
Checks to see if the input argument is excluded.
Parameters
TChar aChar |
The character to be checked.
|
|
Return value
TBool
|
A boolean value of ETrue if the character is an excluded one, or EFalse if it is not.
|
|
static IMPORT_C TBool IsEscapeTriple(const TDesC8 &aData, TInt &aHexValue);
Description
Checks for an escape triple at the start of the input descriptor. If there is a triple its value is calculated and returned
through the output argument aHexValue. If there is no escape triple then this argument is left unchanged.
Parameters
const TDesC8 &aData |
The descriptor to be checked for an escape triple.
|
TInt &aHexValue |
The output argument with the value of the escape triple if it exists.
|
|
Return value
TBool
|
A boolean value of ETrue if there is an escape triple at the start of the input descriptor, EFalse otherwise.
|
|
static IMPORT_C TBool IsEscapeTriple(const TDesC16 &aData, TInt &aHexValue);
Description
Checks for an escape triple at the start of the input descriptor. If there is a triple its value is calculated and returned
through the output argument aHexValue. If there is no escape triple then this argument is left unchanged.
Parameters
const TDesC16 &aData |
The descriptor to be checked for an escape triple.
|
TInt &aHexValue |
The output argument with the value of the escape triple if it exists.
|
|
Return value
TBool
|
A boolean value of ETrue if there is an escape triple at the start of the input descriptor, EFalse otherwise.
|
|
static IMPORT_C HBufC8 *SpecificEscapeEncodeL(const TDesC8 &aData, const TDesC8 &aCharsToEscape);
Description
Parameters
Return value
TEscapeMode
Description
Enum defining escaping modes. Each mode has a different set of reserved characters. These are based on various uri components,
as decribed in RFC2396.
EEscapeNormal |
Default mode, which has no reserved characters
|
EEscapeQuery |
Mode specifying reserved characters in a uri query - ;/?:&=+$,[]
|
EEscapePath |
Mode specifying reserved characters in a uri path - /;=?[]
|
EEscapeAuth |
Mode specifying reserved characters in a uri authority - /;:@?[]
|
EEscapeUrlEncoded |
Mode specifying reserved characters in a URL ;/?:&=+$[]!\'()~
|
|