secureswitools/swisistools/source/interpretsislib/filedescription.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
    26 #include "sishash.h"
    26 #include "sishash.h"
    27 
    27 
    28 FileDescription::~FileDescription ()
    28 FileDescription::~FileDescription ()
    29 	{
    29 	{
    30 	}
    30 	}
    31 	
       
    32 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    33 FileDescription::FileDescription(const CSISFileDescription& aFile, TInt aSid, const TInt aTargetDrive, const std::wstring& aFileName, const std::wstring& aLocalName)
       
    34 	: iTarget(aFileName),
       
    35 	iLocalFile(aLocalName),
       
    36 	iMimeType(aFile.MimeType().GetString()),
       
    37 	iOperation(aFile.Operation()),
       
    38 	iOperationOptions(aFile.OperationOptions()),
       
    39 	iUncompressedLength(aFile.UncompressedLength()),
       
    40 	iIndex(aFile.FileIndex()),
       
    41 	iSid(aSid)
       
    42 {
       
    43 	const unsigned char* data = aFile.Hash().Blob().Data();
       
    44 	TUint32 len = aFile.Hash().Blob().Size();
       
    45 
    31 
    46 	std::string hashData((char*)data, len);
       
    47 
       
    48 	iHash.SetData(hashData);
       
    49 	iHash.SetHashId(HashContainer::EHashSHA);
       
    50 }
       
    51 #else
       
    52 FileDescription::FileDescription(const CSISFileDescription& aFile, TInt aSid, const TInt aTargetDrive, const std::wstring& aFileName)
    32 FileDescription::FileDescription(const CSISFileDescription& aFile, TInt aSid, const TInt aTargetDrive, const std::wstring& aFileName)
    53 	: iTarget(aFileName),
    33 	: iTarget(aFileName),
    54 	iMimeType(aFile.MimeType().GetString()),
    34 	iMimeType(aFile.MimeType().GetString()),
    55 	iOperation(aFile.Operation()),
    35 	iOperation(aFile.Operation()),
    56 	iOperationOptions(aFile.OperationOptions()),
    36 	iOperationOptions(aFile.OperationOptions()),
    64 	std::string hashData((char*)data, len);
    44 	std::string hashData((char*)data, len);
    65 
    45 
    66 	iHash.SetData(hashData);
    46 	iHash.SetData(hashData);
    67 	iHash.SetHashId(HashContainer::EHashSHA);
    47 	iHash.SetHashId(HashContainer::EHashSHA);
    68 }
    48 }
    69 #endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    70 
    49 
    71 void FileDescription::Internalize(Deserialiser& des)
    50 void FileDescription::Internalize(Deserialiser& des)
    72 	{
    51 	{
    73 
    52 
    74 	des >> iTarget
    53 	des >> iTarget