CUri16 Class Reference

#include <uri16.h>

Link against: inetprotutil.lib

class CUri16 : public CBase

Inherits from

Detailed Description

Dependencies : CBase, TUriC16. Comments : Provides modifying functionality on the components of a uri object, as defined in RFC2396. There are 5 components; scheme. authority, path, query and fragment.

The object holds parsed uri information. It is owning. It uses 16-bit descriptors.

The functionality provided by this API allows the uri components to be set or removed from this parsed uri. Also, it provides a reference to DeprecatedDeprecated in 9.1 TUriC16 object so that the non-modifying functionality can be used.
Since
6.0

Constructor & Destructor Documentation

~CUri16 ( )

IMPORT_C~CUri16()

Destructor.

DeprecatedDeprecated in 9.1
Since
6.0

Member Function Documentation

CreateFileUriL ( const TDesC &, TUint )

IMPORT_C CUri16 *CreateFileUriL(const TDesC &aFullFileName,
TUintaFlags = 0
)[static]

Allocates and constructs a file URI object for a specified file.

  • If the file exists on a fixed drive, then the file URI takes the form: 'file://<drive-letter>/<filepath including filename>'.

  • If the file exists on a removable media drive, then the file URI takes the form: 'file://ext-media/<filepath including filename>'.

Since
9.1
Post-condition
A fully constructed and initialized file URI (CUri16) object.
Parameters
aFullFileNameA reference to a fully qualified filename
aFlagsA flag to indicate if the file exists on a fixed drive or removable media drive. This is a TFileUriFlags value.
Return Value
A pointer to the newly created file URI (CUri16) object.

CreatePrivateFileUriL ( const TDesC &, TDriveNumber, TInt )

IMPORT_C CUri16 *CreatePrivateFileUriL(const TDesC &aRelativeFileName,
TDriveNumberaDrive,
TIntaFlags = 0
)[static]

Allocates and constructs a file URI object for a file that is private to the application.

  • If the file exists on a fixed drive, then the file URI takes the form 'file://private/<drive-letter>/<filepath including filename>'.

  • If the file exists on a removable media drive, then the file URI takes the form 'file://private/ext-media/<filepath including filename>'.

Since
9.1
Post-condition
A fully constructed and initialized file URI (CUri16) object.
Parameters
aRelativeFileNameA reference to the filename relative to the application's private directory.
aDriveDrive number, if the private file stored on fixed drive, otherwise not used This is a TDriveNumber value
aFlagsA flag to indicate if the file exists on a fixed drive or removable media drive. This is a TFileUriFlags value.
Return Value
A pointer to the newly created file URI (CUri16) object.

NewL ( const TUriC16 & )

IMPORT_C CUri16 *NewL(const TUriC16 &aUri)[static]

Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack. Creates a uri object which is a copy of the input parameter aUri.

DeprecatedDeprecated in 9.1
Since
6.0
Post-condition
A fully constructed and initialized CUri16 object.
Parameters
aUriA reference to a parsed uri object.
Return Value
A pointer to the newly created CUri16 object.

NewL ( )

IMPORT_C CUri16 *NewL()[static]

Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack. Creates a uri object which is empty.

DeprecatedDeprecated in 9.1
Since
6.0
Post-condition
A fully constructed and initialized CUri16 object.
Return Value
A pointer to the newly created CUri16 object.

NewLC ( const TUriC16 & )

IMPORT_C CUri16 *NewLC(const TUriC16 &aUri)[static]

Static factory constructor. Uses two phase construction and leaves a pointer to created object on the CleanupStack. Creates a uri object which is a copy of the input parameter aUri.

DeprecatedDeprecated in 9.1
Since
6.0
Post-condition
A fully constructed and initialized CUri16 object.
Parameters
aUriA reference to a parsed uri object.
Return Value
A pointer to the newly created CUri16 object.

NewLC ( )

IMPORT_C CUri16 *NewLC()[static]

Static factory constructor. Uses two phase construction and leaves a pointer to created object on the CleanupStack. Creates a uri object which is empty.

DeprecatedDeprecated in 9.1
Since
6.0
Post-condition
A fully constructed and initialized CUri16 object.
Return Value
A pointer to the newly created CUri16 object.

RemoveComponentL ( TUriComponent )

IMPORT_C voidRemoveComponentL(TUriComponentaComponent)

Removes the specified component from the uri. If the component does not exist then this function does nothing.

DeprecatedDeprecated in 9.1
CAUTION:

If host is removed, then userinfo and port components will also be removed.

Since
6.0
Pre-condition
Object is fully constructed.
Post-condition
The uri is updated to exclude the specified component.
Parameters
aComponentAn enum specifying the component to be removed.

ResolveL ( const TUriC16 &, const TUriC16 & )

IMPORT_C CUri16 *ResolveL(const TUriC16 &aBaseUri,
const TUriC16 &aRefUri
)[static]

Static factory constructor. This creates a CUri16 object that is an absolute uri resulting from a reference uri being resolved against a base uri.

DeprecatedDeprecated in 9.1
CAUTION:

Ownership of created CUri16 object is transferred to caller.

Since
6.0
Pre-condition
The base uri must have an absolute or empty path, otherwise will leave with KUriErrBadBasePath.
Post-condition
A fully constructed and initialized CUri16 object.
Parameters
aBaseUriA referece to the parsed base uri.
aRefUriA referece to the parsed reference uri.
Return Value
A pointer to the newly created CUri16 object.
Leave Codes
KUriErrBadBasePathif the base path is not an absolute path and not empty.

SetComponentL ( const TDesC16 &, TUriComponent )

IMPORT_C voidSetComponentL(const TDesC16 &aData,
TUriComponentaComponent
)

Sets the specified component in the uri. The component is set to the value given in the argument aData. If the specified component already exists then it is replaced with the new value.

DeprecatedDeprecated in 9.1
CAUTION:

The userinfo and port components can only be set if the host component is present. Setting these components without a host component present will have no effect on the uri.

Since
6.0
Pre-condition
Object is fully constructed.
Post-condition
The uri has the specified component set to the new value. KErrArgument If aComponent goes out of range.
Parameters
aDataA descriptor pointer to the new value for the uri component.
aComponentAn enum specifying the component to be set.

Uri ( )

IMPORT_C const TUriC16 &Uri()const

Provides a reference to the parsed uri. Allows access to the non-modifying API for TUriC16.

DeprecatedDeprecated in 9.1
Since
6.0
Return Value
A const reference to the parsed uri object.