mmserv/metadatautility/Src/MetaDataParserRA.cpp
changeset 20 b67dd1fc57c5
parent 0 71ca22bcf22a
child 28 ebf79c79991a
--- a/mmserv/metadatautility/Src/MetaDataParserRA.cpp	Fri Apr 30 19:18:45 2010 -0500
+++ b/mmserv/metadatautility/Src/MetaDataParserRA.cpp	Fri May 14 18:19:45 2010 -0500
@@ -26,6 +26,8 @@
 #include <s32mem.h>
 #include <hxmetadatautil.h>
 #include "MetaDataSourceFile.h"
+#include "MetaDataSourceDescriptor.h"
+
 
 
 // ============================ MEMBER FUNCTIONS ===============================
@@ -51,6 +53,7 @@
     {
 	if ( ValidateL() )
 		{
+	    iExists = TRUE;
 		iHxMetaDataUtility = CHXMetaDataUtility::NewL();
 		}
 	else
@@ -114,13 +117,19 @@
 	HXMetaDataKeys::EHXMetaDataId id;
 	TFileName fileName;
 	
-	// Determine if user entered a TDesC filename or a RFile:
-	
-	if (((CMetaDataSourceFile&)iSource).IsFileHandler())
+	//Determine CMetaDataSourceDescriptor or CMetaDataSourceFile
+	CMetaDataSourceDescriptor* srcDesc = dynamic_cast<CMetaDataSourceDescriptor *>(&iSource);
+	if(srcDesc)
+	{
+		const TDesC8& des = srcDesc->GetDescriptor();
+		TRAPD(err, iHxMetaDataUtility->OpenDesL(des));
+		User::LeaveIfError(err);
+	}
+	else if (((CMetaDataSourceFile&)iSource).IsFileHandler())	// Determine if user entered a TDesC filename or a RFile:
 	{
 		RFile rFile;
 		rFile.Duplicate( ((CMetaDataSourceFile&)iSource).FileHandler() );
-		TRAPD(err, iHxMetaDataUtility->OpenFileL((RFile &)rFile));	// casting necessary--compile error	
+		TRAPD(err, iHxMetaDataUtility->OpenFileL(rFile));
 		rFile.Close();
 		User::LeaveIfError(err);
 	}
@@ -367,3 +376,4 @@
 	}	
 
 //  End of File
+