CUri8 Class Reference

#include <uri8.h>

Link against: inetprotutil.lib

class CUri8 : public CBase

Inherits from

  • CUri8

    Detailed Description

    Dependencies : CBase, TUriC8. 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 8-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 TUriC8 object so that the non-modifying functionality can be used.
    Since
    6.0

    Constructor & Destructor Documentation

    ~CUri8 ( )

    IMPORT_C~CUri8()

    Destructor.

    Since
    6.0

    Member Function Documentation

    CreateFileUriL ( const TDesC &, TUint )

    IMPORT_C CUri8 *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 (CUri8) object.
    ParameterDescription
    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.

    Returns: A pointer to the newly created file URI (CUri8) object.

    CreatePrivateFileUriL ( const TDesC &, TDriveNumber, TInt )

    IMPORT_C CUri8 *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 (CUri8) object.
    ParameterDescription
    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.

    Returns: A pointer to the newly created file URI (CUri8) object.

    NewL ( const TUriC8 & )

    IMPORT_C CUri8 *NewL(const TUriC8 &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.

    Since
    6.0
    Post-condition
    A fully constructed and initialized CUri8 object.
    ParameterDescription
    aUriA reference to a parsed uri object.

    Returns: A pointer to the newly created CUri8 object.

    NewL ( )

    IMPORT_C CUri8 *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
    Post-condition
    A fully constructed and initialized CUri8 object.

    Returns: A pointer to the newly created CUri8 object.

    NewLC ( const TUriC8 & )

    IMPORT_C CUri8 *NewLC(const TUriC8 &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
    Post-condition
    A fully constructed and initialized CUri8 object.
    ParameterDescription
    aUriA reference to a parsed uri object.

    Returns: A pointer to the newly created CUri8 object.

    NewLC ( )

    IMPORT_C CUri8 *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
    Post-condition
    A fully constructed and initialized CUri8 object.

    Returns: A pointer to the newly created CUri8 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
    Pre-condition
    Object is fully constructed.
    Post-condition
    The uri is updated to exclude the specified component.
    ParameterDescription
    aComponentAn enum specifying the component to be removed.

    ResolveL ( const TUriC8 &, const TUriC8 & )

    IMPORT_C CUri8 *ResolveL(const TUriC8 &aBaseUri,
    const TUriC8 &aRefUri
    )[static]

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

    CAUTION:

    Ownership of created CUri8 object is transferred to the caller.

    leave
    KUriErrBadBasePath if the base path is not an absolute path and not empty.
    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 CUri8 object.
    ParameterDescription
    aBaseUriA referece to the parsed base uri.
    aRefUriA referece to the parsed reference uri.

    Returns: A pointer to the newly created CUri8 object.

    SetComponentL ( const TDesC8 &, TUriComponent )

    IMPORT_C voidSetComponentL(const TDesC8 &aData,
    TUriComponentaComponent
    )

    Intended Usage : 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
    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.
    ParameterDescription
    aDataA descriptor pointer to the new value for the uri component.
    aComponentAn enum specifying the component to be set.

    Uri ( )

    IMPORT_C const TUriC8 &Uri()const

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

    Since
    6.0

    Returns: A const reference to the parsed uri object.