Location:
Uri8.h
Link against: inetprotutil.lib
class TUriC8;
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.
Defined in TUriC8
:
Compare()
, DisplayFormL()
, Extract()
, GetFileNameL()
, GetFileNameL()
, IsPresent()
, IsSchemeValid()
, TUriC8()
, UriDes()
, UriWithoutFragment()
, iComponent
, iUriDes
IMPORT_C HBufC *GetFileNameL() const;
Object is fully constructed.
Generates a fully-qualified filename from a file URI object.
The form of the returned filename depends on the file location, as follows:
public file on a fixed drive:
file:///c/path/to/file/name.ext -> c:\path\to\file\name.ext
public file on removable media drive: The fully-qualified filename is resolved by finding the first drive on which the file exists. If the file does not exist, this will Leave with KErrNotFound
file:///ext-media/path/to/file/name.ext -> f:\path\to\file\name.ext
(where f: is the first drive found containing "\path\to\file\name.ext")
private file on fixed drive:
file:///private/c/path/to/file/name.ext -> c:\private\0x1001234f\path\to\file\name.ext
(where 0x1001234f is the SID of the current application)
private file on removable media drive:
file:///private/ext-media/path/to/file/name.ext -> h:\private\0x1001234f\path\to\file\name.ext
(where h: is the first drive found containing "\private\0x1001234f\path\to\file\name.ext")
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")
|
|
IMPORT_C HBufC *GetFileNameL(TUriFileName aType) const;
Object is fully constructed.
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.
|
|
|
IMPORT_C const TDesC8 &Extract(TUriComponent aComponent) const;
Retrieves the specified component in the uri.
|
|
IMPORT_C void UriWithoutFragment(TPtrC8 &aUriNoFrag) const;
Retrieves the uri without the fragment component.
|
IMPORT_C TBool IsPresent(TUriComponent aComponent) const;
Indicates whether the specified component is present in the uri.
|
|
IMPORT_C TBool IsSchemeValid() const;
Checks the scheme to be valid. If there is no scheme then the return value indicates an invalid scheme.
|
IMPORT_C TInt Compare(const TUriC8 &aUri, TUriComponent aComponent) const;
Compares the specified component against the one in the uri passed in.
|
|
IMPORT_C const TDesC8 &UriDes() const;
Retrieves the descriptor for the entire uri.
|
IMPORT_C HBufC *DisplayFormL(TUriComponent aComponent=EUriComplete) const;
Create a new HBufC descriptor containing the desired component or the full URI.
|
|
protected: TPtrC8 iUriDes;
The descriptor pointer to the uri.