#include <caf/virtualpath.h>
Link against: cafutils.lib
class ContentAccess::CVirtualPath : public CBase |
Public Member Functions | |
---|---|
virtual | ~CVirtualPath() |
IMPORT_C void | ExternalizeL(RWriteStream &) |
IMPORT_C const TDesC & | GetCombinedUriUniqueId() |
IMPORT_C CVirtualPath * | NewL(const TVirtualPathPtr &) |
IMPORT_C CVirtualPath * | NewL(const TDesC &) |
IMPORT_C CVirtualPath * | NewL(const TDesC &, const TDesC &) |
IMPORT_C CVirtualPath * | NewL(RReadStream &) |
IMPORT_C const TDesC & | URI() |
IMPORT_C const TDesC & | UniqueId() |
operator const TVirtualPathPtr &() |
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.
<URI><KCafVirtualPathSeparator><UniqueID>
// 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();
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.
~CVirtualPath | ( | ) | [virtual] |
IMPORT_C void | ExternalizeL | ( | RWriteStream & | aStream | ) | const |
Allows the class to write itself to a stream
Parameters | |
---|---|
aStream | The stream to write to |
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()
IMPORT_C CVirtualPath * | NewL | ( | const TVirtualPathPtr & | aPtr | ) | [static] |
Create a CVirtualPath object from a TVirtualPathPtr
Parameters | |
---|---|
aPtr | The location of the content object |
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.
Parameters | |
---|---|
aCombinedUriUniqueId | The location of the content object |
IMPORT_C CVirtualPath * | NewL | ( | const TDesC & | aURI, |
const TDesC & | aUniqueId | |||
) | [static] |
Create a virtual path object for a specific content object within a file
Parameters | |
---|---|
aURI | The location of the file |
aUniqueId | The location of the content within the file |
IMPORT_C CVirtualPath * | NewL | ( | RReadStream & | aStream | ) | [static] |
Construct and read a CVirtualPath object from a stream
Parameters | |
---|---|
aStream | The stream to read frin |
IMPORT_C const TDesC & | URI | ( | ) | const |
The location of the file containing the content object
IMPORT_C const TDesC & | UniqueId | ( | ) | const |
UniqueId supplied by a CAF Agent to identify the object within the file.
operator const TVirtualPathPtr & | ( | ) | const [inline] |
Cast operator allowing the CVirtualPath to be used as a TVirtualPathPtr