#include <caf/virtualpathptr.h>
class ContentAccess::TVirtualPathPtr |
Public Member Functions | |
---|---|
TVirtualPathPtr(const TDesC &, const TDesC &) | |
TVirtualPathPtr(const TDesC &) | |
TVirtualPathPtr(const TVirtualPathPtr &) | |
IMPORT_C const TDesC & | URI() |
IMPORT_C const TDesC & | UniqueId() |
IMPORT_C TVirtualPathPtr & | operator=(const TVirtualPathPtr &) |
IMPORT_C TVirtualPathPtr & | operator=(const TDesC &) |
Identifies the location of a file and a particular content object inside it.
TVirtualPathPtr points to the two descriptors (the URI and UniqueId) used to initialise it. These descriptors must not be modified or destroyed while the TVirtualPathPtr object is in use.
The URI must be in the format specified in RFC2396, found at http://www.ietf.org/.
The UniqueId will be created by the Agent. Content is only ever accessed by one agent so it is the agents responsibility to ensure the UniqueId is truly unique within the file.
<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.
IMPORT_C | TVirtualPathPtr | ( | const TDesC & | aCombinedUriUniqueId | ) |
Constructor used for a concatenated URI and UniqueId.
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 KCafVirtualPathSeparator character. For more information see above.
Parameter | Description |
---|---|
aCombinedUriUniqueId | The location of the content object |
IMPORT_C | TVirtualPathPtr | ( | const TVirtualPathPtr & | aPtr | ) |
Copy constructor
IMPORT_C const TDesC & | URI | ( | ) | const |
The location of the file containing the content object
Returns: The location of the file
IMPORT_C const TDesC & | UniqueId | ( | ) | const |
UniqueId supplied by a CAF Agent to identify the object within the file.
Returns: The location of the content within the file
IMPORT_C TVirtualPathPtr & | operator= | ( | const TVirtualPathPtr & | aVirtualPath | ) |
Assignment operator
IMPORT_C TVirtualPathPtr & | operator= | ( | const TDesC & | aCombinedUriUniqueId | ) |
Assignment operator converts a single descriptor to a TVirtualPathPtr. If the descriptor is just a URI, the TVirtualPathPtr will point to the KDefaultContentObject within that file. If it is a concatenated URI and UniqueId the URI and UniqueId will be seperated by the KCafVirtualPathSeparator. character as detailed in the description above.