Symbian
 Developer Library

DEVELOPER LIBRARY

[Index] [Glossary] [Previous] [Next]



Location: UriUtils.h
Link against: InetProtUtil.lib

Class UriUtils

class UriUtils;

Support

Supported from 7.0

Description

A set of URI handling utility functions.

Defined in UriUtils:
ConvertToDisplayFormL(), ConvertToInternetFormL(), EIPv4Host, EIPv6Host, ETextHost, HasInvalidChars(), HasInvalidChars(), HostType(), HostType(), TUriHostType


Member Functions


ConvertToInternetFormL()

static CUri8* ConvertToInternetFormL(const TUriC16& aUri);

Description

Converts a 16-bit format URI into its internet form.

Unicode characters are converted into Utf8 representation, and then any excluded characters are escape-encoded.

Parameters

const TUriC16& aUri

A 16-bit format URI.

Return value

CUri8*

A pointer to the new 8-bit URI.

Leave codes

KErrNoMemory

The function may allocate memory, and will leave if there is insufficient.

KUriUtilsCannotConvert

The URI cannot be converted.

KUriUtilsErr16BitChar

if any character cannot be represented within 8 bits (i.e. has a value greater than 255).


ConvertToDisplayFormL()

static CUri16* ConvertToDisplayFormL(const TUriC8& aUri);

Description

Converts an 8-bit format URI into its display form.

Any escape triples are decoded, and sets of Utf8 format characters are converted into Unicode.

Parameters

const TUriC8& aUri

The 8-bit format URI.

Return value

CUri16 *

A pointer to a new 16-bit URI.

Leave codes

KErrNoMemory

The function may allocate memory, and will leave if there is insufficient.

KUriUtilsCannotConvert

The URI cannot be converted.

KUriUtilsErrBadEscapeTriple

An invalid escape triple detected.


HasInvalidChars()

static TBool HasInvalidChars(const TDesC8& aData);

Description

Tests whether the specified 8-bit data contains any excluded (invalid) characters.

Excluded characters are:

Parameters

const TDesC8& aData

The data to be checked.

Return value

TBool

True, if the specified data contains invalid characters; false, otherwise.


HasInvalidChars()

static TBool HasInvalidChars(const TDesC16& aData);

Description

Tests whether the specified 16-bit data contains any excluded (invalid) characters.

Excluded characters are:

Parameters

const TDesC16& aData

The data to be checked.

Return value

TBool

True, if the specified data contains invalid characters; false, otherwise.


HostType()

static UriUtils::TUriHostType HostType(const TDesC8& aHost);

Description

Gets the host type (8-bit variant).

Parameters

const TDesC8& aHost

The host to be checked.

Return value

UriUtils::TUriHostType

The host type.


HostType()

static UriUtils::TUriHostType HostType(const TDesC16& aHost);

Description

Gets the host type (16-bit variant).

Parameters

const TDesC16& aHost

The host to be checked.

Return value

UriUtils::TUriHostType

The host type.

[Top]


Member Enumerations


Enum TUriHostType

TUriHostType

Description

Defines the type of host.

An enumeration of this type is returned by the variants of the HostType() function.

EIPv6Host

Defines an IPv6 type host.

EIPv4Host

Defines an IPv4 type host.

ETextHost

Defines a text type host.