CUri16 Class Reference

class CUri16 : public CBase

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 TUriC16 object so that the non-modifying functionality can be used. Deprecated in 9.1
Since
6.0

Inherits from

Constructor & Destructor Documentation

CUri16(const TUriC16 &)

CUri16(const TUriC16 &aNewUri)[private]

Constructor. First phase of two-phase construction method. Does non-allocating construction.

Since
6.0

Parameters

const TUriC16 & aNewUriThe parsed uri component information from which to create the uri.

~CUri16()

IMPORT_C~CUri16()

Destructor.

Since
6.0
Deprecated in 9.1

Member Functions Documentation

ConstructL()

voidConstructL()[private]

Second phase of two-phase construction method. Does any allocations required to fully construct the object.

Since
6.0
Pre-condition
First phase of construction is complete.
Post-condition
The object is fully constructed and initialized.

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

const TDesC & aFullFileNameA reference to a fully qualified filename
TUint aFlags = 0A flag to indicate if the file exists on a fixed drive or removable media drive. This is a TFileUriFlags value.

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

const TDesC & aRelativeFileNameA reference to the filename relative to the application's private directory.
TDriveNumber aDriveDrive number, if the private file stored on fixed drive, otherwise not used This is a TDriveNumber value
TInt aFlags = 0A flag to indicate if the file exists on a fixed drive or removable media drive. This is a TFileUriFlags value.

FormUriL()

voidFormUriL()[private]

Forms the uri from the parsed uri information. A copy of the parsed uri is created. The parsed uri is changed to refer to the copy.

Since
6.0
Pre-condition
The parsed uri information is set.
Post-condition
The uri buffer is updated with the parsed uri information.

InitializeFileUriComponentsL(const TDesC &, TDriveNumber, TUint)

voidInitializeFileUriComponentsL(const TDesC &aFileName,
TDriveNumberaDrive,
TUintaFlags
)[private]

Initializes the file URI components (scheme, empty hostname and path).

It uses GenerateFileUriPathL() to generate a file Uri path using the filename and drive.

Since
9.1
Pre-condition
Object fully constructed
Post-condition
The object is initialized with file URI components.

Parameters

const TDesC & aFileNameA reference to a filename
TDriveNumber aDriveA drive number. This is a TFileUriFlags value.
TUint aFlagsA flag to indicate if the file exists on a fixed drive or removable media drive. This is a TFileUriFlags value.

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.

Deprecated in 9.1
Since
6.0
Post-condition
A fully constructed and initialized CUri16 object.

Parameters

const TUriC16 & aUriA reference to a parsed uri 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.

Since
6.0
Deprecated in 9.1
Post-condition
A fully constructed and initialized 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.

Since
6.0
Deprecated in 9.1
Post-condition
A fully constructed and initialized CUri16 object.

Parameters

const TUriC16 & aUriA reference to a parsed uri 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.

Since
6.0
Deprecated in 9.1
Post-condition
A fully constructed and initialized 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.

CAUTION:

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

Since
6.0
Deprecated in 9.1
Pre-condition
Object is fully constructed.
Post-condition
The uri is updated to exclude the specified component.

Parameters

TUriComponent 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.

CAUTION:

Ownership of created CUri16 object is transferred to caller.

leave
KUriErrBadBasePath if the base path is not an absolute path and not empty.
Since
6.0
Deprecated in 9.1
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

const TUriC16 & aBaseUriA referece to the parsed base uri.
const TUriC16 & aRefUriA referece to the parsed reference uri.

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.

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
Deprecated in 9.1
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

const TDesC16 & aDataA descriptor pointer to the new value for the uri component.
TUriComponent 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.

Since
6.0
Deprecated in 9.1

Member Data Documentation

TUriC16 iUri

TUriC16 iUri[private]

The parsed uri object.

HBufC16 * iUriBuf

HBufC16 *iUriBuf[private]

The descriptor buffer that contains the uri.