#include <uri8.h>
class TUriC8 |
Protected Attributes | |
---|---|
TPtrC8 | iComponent |
TPtrC8 | iUriDes |
Public Member Functions | |
---|---|
IMPORT_C TInt | Compare(const TUriC8 &, TUriComponent) |
IMPORT_C HBufC * | DisplayFormL(TUriComponent) |
IMPORT_C TInt | Equivalent(const TUriC8 &) |
IMPORT_C const TDesC8 & | Extract(TUriComponent) |
IMPORT_C HBufC * | GetFileNameL() |
IMPORT_C HBufC * | GetFileNameL(TUriFileName) |
IMPORT_C TBool | IsPresent(TUriComponent) |
IMPORT_C TBool | IsSchemeValid() |
IMPORT_C const TDesC8 & | UriDes() |
IMPORT_C void | UriWithoutFragment(TPtrC8 &) |
IMPORT_C TInt | Validate() |
Protected Member Functions | |
---|---|
TUriC8() | |
void | Reset() |
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.
IMPORT_C TInt | Compare | ( | const TUriC8 & | aUri, |
TUriComponent | aComponent | |||
) | const |
Compares the specified component against the one in the uri passed in.
Parameter | Description |
---|---|
aUri | The uri to compare components against. |
aComponent | The enum specifying the component to compare. |
Returns: An integer value of zero if the components are the same, any other value if the components are not the same.
IMPORT_C HBufC * | DisplayFormL | ( | TUriComponent | aComponent = EUriComplete | ) | const |
Create a new HBufC descriptor containing the desired component or the full URI.
Parameter | Description |
---|---|
aComponent | The component to convert into Unicode (EUriScheme - EUriFragment), or the full URI (EUriComplete -- the default). |
Returns: The descriptor containing the desired component.
Compares the given URI to determine if it is equivalent to this URI. It is possible for URIs declared NOT equivalent by this method to be equvalent to a level not checked by this method.
Parameter | Description |
---|---|
aUri | Contains URI to compare |
Returns: ETrue if the two URIs are equivalent otherwise EFalse
IMPORT_C const TDesC8 & | Extract | ( | TUriComponent | aComponent | ) | const |
Retrieves the specified component in the uri.
Parameter | Description |
---|---|
aComponent | The enum specifying the component. |
Returns: A constant reference to a descriptor pointer to the specified component.
IMPORT_C HBufC * | GetFileNameL | ( | ) | const |
Generates a fully-qualified filename from a file URI object.
file://c/path/to/file/name.ext -> c:\path\to\file\name.ext
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")
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")
Returns: A descriptor containing the fully-qualified filename.
IMPORT_C HBufC * | GetFileNameL | ( | TUriFileName | aType | ) | const |
This creates a file name from the URI, changing the network path separator (/) to the local file system path separator (\).
http://www.foo.com/dir/file/name.ext;param1;param2 -> \dir\file\name.ext
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.
Parameter | Description |
---|---|
aType | specifies what part of the filename is to be converted. The default is EUriFileNameFull). |
Returns: A descriptor containing the desired filename components.
IMPORT_C TBool | IsPresent | ( | TUriComponent | aComponent | ) | const |
Indicates whether the specified component is present in the uri.
Parameter | Description |
---|---|
aComponent | The enum specifying the component. |
Returns: A boolean value of ETrue if the desired component is present, or EFalse if the desired component is not present.
IMPORT_C TBool | IsSchemeValid | ( | ) | const |
Checks the scheme to be valid. If there is no scheme then the return value indicates an invalid scheme.
Returns: A boolean value of ETrue if the scheme is valid, or EFalse if the scheme is not.
void | Reset | ( | ) | [protected] |
Resets the descriptor pointers for the uri components and the uri.
IMPORT_C const TDesC8 & | UriDes | ( | ) | const |
Retrieves the descriptor for the entire uri.
Returns: A const reference to a descriptor pointer to the uri.
IMPORT_C void | UriWithoutFragment | ( | TPtrC8 & | aUriNoFrag | ) | const |
Retrieves the uri without the fragment component.
Parameter | Description |
---|---|
aUriNoFrag | An output parameter which is set the non-reference version of the uri. |
IMPORT_C TInt | Validate | ( | ) | const |
Ensures that all components of the URI are valid. If the method returns KUriUtilsErrInvalidUri then one or more components are not valid. It is possible for URIs declared valid by this method to be, on detailed inspection, invalid.
Returns: KErrNone for vaild URIs, KUriUtilsErrInvalidUri for invalid URIs or KErrNotSupported.