Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <Uri8.h>
Link against: inetprotutil.lib

Class TUriC8

class TUriC8;

Description

Dependencies : TUriComponent. Comments : Provides non-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 descriptor pointers to the parsed uri components and a descriptor pointer to the uri. It is non-owning. It uses 8-bit descriptors.

The functionality provided by this API allows the uri components to be extracted from the parsed uri, checked for their presence in the uri and be compared with those in another TUriC8 object.

Members

Defined in TUriC8:


Construction and destruction


TUriC8()

protected: IMPORT_C TUriC8();

Description

Constructor.

[Top]


Member functions


GetFileNameL()const

IMPORT_C HBufC* GetFileNameL() const;

Pre-Condition

Object is fully constructed.

Description

Generates a fully-qualified filename from a file URI object.

The form of the returned filename depends on the file location, as follows:

The returned file name is not guaranteed to exist except where specified above.

Be warned that this method may be slow when resolving special paths (like "/ext-media")

Return value

HBufC16 *

A descriptor containing the fully-qualified filename.

Leave codes

KErrNotSupported

URI does not specify a local file

KErrNotFound

If the URI indicates the file is on removable media and the file does not exist on any.


GetFileNameL(TUriFileName)const

IMPORT_C HBufC* GetFileNameL(TUriFileName aType) const;

Pre-Condition

Object is fully constructed.

Description

This creates a file name from the URI, changing the network path separator (/) to the local file system path separator (\).

If called with EUriFileNamePath, this will generate a file name containing the path relative to the drive. Any parameters in the URI are stripped off:

        http://www.foo.com/dir/file/name.ext;param1;param2 -> \dir\file\name.ext

If called with EUriFileNameTail, this will generate a just the name, with no directories or drive. Any parameters in the URI are stripped off:

        http://www.foo.com/dir/file/name.ext;param1;param2 -> name.ext

EUriFileNamePath and EUriFileNameTail can be used for any hierarchical URI (http, ftp, file, etc) and may have unexpected behaviour when called on any other type of URI.

If called with EUriFileNameFull, this will convert the URI into a fully-qualified filename. this is only valid for file URIs and will Leave if called on any other type of URI. The form of the returned filename is described in GetFileNameL with no arguments.

Parameters

TUriFileName aType

specifies what part of the filename is to be converted. The default is EUriFileNameFull).

Return value

HBufC16 *

A descriptor containing the desired filename components.

Leave codes

KErrNotSupported

The URI scheme cannot be converted into the desired type


Extract(TUriComponent)const

IMPORT_C const TDesC8& Extract(TUriComponent aComponent) const;

Description

Retrieves the specified component in the uri.

Parameters

TUriComponent aComponent

The enum specifying the component.

Return value

const TDesC8 &

A constant reference to a descriptor pointer to the specified component.


UriWithoutFragment(TPtrC8 &)const

IMPORT_C void UriWithoutFragment(TPtrC8 &aUriNoFrag) const;

Description

Retrieves the uri without the fragment component.

Parameters

TPtrC8 &aUriNoFrag

An output parameter which is set the non-reference version of the uri.


IsPresent(TUriComponent)const

IMPORT_C TBool IsPresent(TUriComponent aComponent) const;

Description

Indicates whether the specified component is present in the uri.

Parameters

TUriComponent aComponent

The enum specifying the component.

Return value

TBool

A boolean value of ETrue if the desired component is present, or EFalse if the desired component is not present.


IsSchemeValid()const

IMPORT_C TBool IsSchemeValid() const;

Description

Checks the scheme to be valid. If there is no scheme then the return value indicates an invalid scheme.

Return value

TBool

A boolean value of ETrue if the scheme is valid, or EFalse if the scheme is not.


Compare(const TUriC8 &,TUriComponent)const

IMPORT_C TInt Compare(const TUriC8 &aUri, TUriComponent aComponent) const;

Description

Compares the specified component against the one in the uri passed in.

Parameters

const TUriC8 &aUri

The uri to compare components against.

TUriComponent aComponent

The enum specifying the component to compare.

Return value

TInt

An integer value of zero if the components are the same, any other value if the components are not the same.


UriDes()const

IMPORT_C const TDesC8& UriDes() const;

Description

Retrieves the descriptor for the entire uri.

Return value

const TDesC8 &

A const reference to a descriptor pointer to the uri.


DisplayFormL(TUriComponent)const

IMPORT_C HBufC* DisplayFormL(TUriComponent aComponent=EUriComplete) const;

Description

Create a new HBufC descriptor containing the desired component or the full URI.

Parameters

TUriComponent aComponent

The component to convert into Unicode (EUriScheme - EUriFragment), or the full URI (EUriComplete -- the default).

Return value

HBufC16 *

The descriptor containing the desired component.

[Top]


Member data


iComponent

protected: TPtrC8 iComponent[EUriMaxComponents];

Description

The array of descriptor pointers to the uri components.


iUriDes

protected: TPtrC8 iUriDes;

Description

The descriptor pointer to the uri.