ContentAccess::CVirtualPath Class Reference

class ContentAccess::CVirtualPath : public CBase

A virtual path describes the location of the file (URI) and the location of a content object within that file (Unique Id).

The URI must conform to the standard defined in RFC2396, found at http://www.ietf.org/.

CVirtualPath makes a copy of the URI and UniqueId used to identify a particular content object within a file.

The TVirtualPathPtr cast operator allows the CVirtualPath object to be used with CAF functions requiring a TVirtualPathPtr.

The GetCombinedUriUniqueId() function allows it to "flatten" a virtual path into a single URI. The combined virtual path will be the URI concatenated with the UniqueId seperated by the KCafVirtualPathSeparator character taking the format.
		<URI><KCafVirtualPathSeparator><UniqueID>
An example of this format is shown below:
	// Create a CVirtualPath object to point to OBJECT1 inside file.dcf
	CVirtualPath *path = CVirtualPath::NewL(_L("C:\\directory\file.dcf"), _L("OBJECT1"));

	// convert the URI and unique ID into a single URI.
	TVirtualPathPtr aPath = path->GetCombinedUriUniqueId();
Note:

If a URI is supplied which contains multiple KCafVirtualPathSeparator characters the rightmost KCafVirtualPathSeparator character will be taken as marking the end of the URI and the start of the UniqueId. When multiple KCafVirtualPathSeparator characters are present, under certain situations this will result in an invalid URI and UniqueId being created for the virtual path and can lead to an undefined failure.

Inherits from

  • ContentAccess::CVirtualPath

Constructor & Destructor Documentation

CVirtualPath(const TVirtualPathPtr &)

CVirtualPath(const TVirtualPathPtr &aPtr)[private]

Parameters

const TVirtualPathPtr & aPtr

~CVirtualPath()

~CVirtualPath()[virtual]

Member Functions Documentation

ConstructL()

voidConstructL()[private]

Allow derived classes to call 2nd phase constructor

CreateCombinedUriUniqueIdL(const TDesC &, const TDesC &)

voidCreateCombinedUriUniqueIdL(const TDesC &aUri,
const TDesC &aUniqueId
)[private]

Used to continue initialisation and setup iCombinedPtr

Parameters

const TDesC & aUri
const TDesC & aUniqueId

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Allows the class to write itself to a stream

Parameters

RWriteStream & aStreamThe stream to write to

GetCombinedUriUniqueId()

IMPORT_C const TDesC &GetCombinedUriUniqueId()

Convert the CVirtualPath to a single URI representing a particular content object. The URI and UniqueId will be separated by a KCafVirtualPathSeparator() A descriptor contaning the URI and UniqueId concatenated together

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)[private]

Parameters

RReadStream & aStream

NewL(const TVirtualPathPtr &)

IMPORT_C CVirtualPath *NewL(const TVirtualPathPtr &aPtr)[static]

Create a CVirtualPath object from a TVirtualPathPtr a new CVirtualPath object

Parameters

const TVirtualPathPtr & aPtrThe location of the content object

NewL(const TDesC &)

IMPORT_C CVirtualPath *NewL(const TDesC &aCombinedUriUniqueId)[static]

Create a virtual path object from a combined Uri and UniqueId

This constructs a CVirtual path from a single descriptor.

Note that the descriptor here may be just a URI or it could be a URI concatenated with the file's UniqueId. If it is a concatenated URI and UniqueId the URI and UniqueId will be seperated by the KCasfVirtualPathSeparator character. For more information see above. a new CVirtualPath object

Parameters

const TDesC & aCombinedUriUniqueIdThe location of the content object

NewL(const TDesC &, const TDesC &)

IMPORT_C CVirtualPath *NewL(const TDesC &aURI,
const TDesC &aUniqueId
)[static]

Create a virtual path object for a specific content object within a file a new CVirtualPath object

Parameters

const TDesC & aURIThe location of the file
const TDesC & aUniqueIdThe location of the content within the file

NewL(RReadStream &)

IMPORT_C CVirtualPath *NewL(RReadStream &aStream)[static]

Construct and read a CVirtualPath object from a stream

Parameters

RReadStream & aStreamThe stream to read frin

URI()

IMPORT_C const TDesC &URI()const

The location of the file containing the content object The location of the file

UniqueId()

IMPORT_C const TDesC &UniqueId()const

UniqueId supplied by a CAF Agent to identify the object within the file. The uniqueId of the object within the file

operator const TVirtualPathPtr &()

operator const TVirtualPathPtr &()const [inline]

Cast operator allowing the CVirtualPath to be used as a TVirtualPathPtr a TVirtualPathPtr with the same value as this object

Member Data Documentation

HBufC * iCombinedUriUniqueId

HBufC *iCombinedUriUniqueId[private]

TPtrC iCombinedUriUniqueIdPtr

TPtrC iCombinedUriUniqueIdPtr[private]

HBufC * iURI

HBufC *iURI[private]

HBufC * iUniqueId

HBufC *iUniqueId[private]

TVirtualPathPtr iVirtualPathPtr

TVirtualPathPtr iVirtualPathPtr[private]