void CEmTubePlaylist::ConstructL( RFileReadStream& aStream )
	{
	TInt l = aStream.ReadInt32L();
	if( l )
		{
		iName = HBufC::NewL( l );
		TPtr pName( iName->Des() );
		aStream.ReadL( pName, l );
		}
	else
		{
		iName = KNullDesC().AllocL();
		}

	iType = (TEmTubePlaylistType)aStream.ReadInt32L();
	iFlags = aStream.ReadInt32L();

	TInt count = aStream.ReadInt32L();
	for(TInt i=0;i<count;i++)
		{
		CEmTubePlaylistEntry* e = CEmTubePlaylistEntry::NewLC();
		e->ImportL( aStream );
		iEntries.AppendL( e );
		CleanupStack::Pop( e );
		}
	}
void CEmTubePlaylistEntry::ImportL( RFileReadStream& aStream )
	{
	TInt l = aStream.ReadInt32L();
	if( l )
		{
		iLocation = HBufC::NewL( l );
		TPtr pLocation( iLocation->Des() );
		aStream.ReadL( pLocation, l );
		}
	else
		{
		iLocation = KNullDesC().AllocL();
		}

	l = aStream.ReadInt32L();
	if( l )
		{
		iName = HBufC::NewL( l );
		TPtr pName( iName->Des() );
		aStream.ReadL( pName, l );
		}
	else
		{
		iName = KNullDesC().AllocL();
		}

	iPlayCount = aStream.ReadInt32L();
	iType = (TEmTubePlaylistEntryType)aStream.ReadInt32L();
	TReal t = aStream.ReadReal64L();
	iTime = TTime( Int64( t ) );
	}
// -----------------------------------------------------------------------------
// RDRMRightsClient::FileToListL
// Converts the given file into an array.
// -----------------------------------------------------------------------------
//
void RDRMRightsClient::FileToListL( RFs& aFs,
                                   const TDesC& aFileName,
                                   RPointerArray< CDRMPermission >& aList )
    {
    DRMLOG( _L( "RDRMRightsClient::FileToListL" ) );
    TInt error = KErrNone;

    // Temporary storage.
    CDRMPermission* tmpObject;

    // To access the file data.
    RFileReadStream fileStream;

    // How many objects there is in the file.
    TInt size = 0;

    // Temporary counter.
    TInt count = 0;


    // Open the file.
    User::LeaveIfError( fileStream.Open( aFs, aFileName, EFileRead | EFileStream ) );
    CleanupClosePushL( fileStream );

    size = fileStream.ReadInt32L();

    while( count < size )
        {
        // Allocate a new RO.
        tmpObject = CDRMPermission::NewL();

        // Read the object.
        TRAP( error, tmpObject->InternalizeL( fileStream ) );

        if ( !error )
            {
            // Add the object into the list.
            error = aList.Append( tmpObject );
            }

        if ( error )
            {
            delete tmpObject;
            User::Leave( error );
            }

        // Now tmpObject is under responsibility of aList.
        ++count;
        }

    // All done.
    CleanupStack::PopAndDestroy(); // fileStream
    }
/**
 @fn void ReadIniFileL()
 Open the ini file and read the contents. Intended for manually testing the 
 write code.
 */
LOCAL_C void ReadIniFileL()
	{
	RFs fileSession;
	User::LeaveIfError(fileSession.Connect());
	CleanupClosePushL(fileSession);
	
	RFileReadStream fileReadStream;
	User::LeaveIfError(fileReadStream.Open(fileSession, IniFileName, EFileRead));
	CleanupClosePushL(fileReadStream);

    TInt32 value1 = 0;
    TInt8 value2 = 0;

	//read the KEComUid and KSsaUid
	value1 = fileReadStream.ReadInt32L();
	value1 = fileReadStream.ReadInt32L();
	value2 = fileReadStream.ReadInt8L();

	// close: fileSession, fileReadStream
	CleanupStack::PopAndDestroy(2);
	}
// -----------------------------------------------------------------------------
// CSisxUIStartupFile::ReadPrivateStartupItemsL
// Read startup items from private file.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CSisxUIStartupFile::ReadPrivateStartupItemsL( RArray<TStartupTaskParam>& aStartupItems )
    {
    RFileReadStream reader;
    reader.PushL();
    
    User::LeaveIfError( reader.Open( iFileSession, *iPrivateFile, EFileRead ) );
    
    // Read the number of entries
    TInt count = reader.ReadInt32L();

     // Read file names from the file
    while ( count-- )
        {
        TStartupTaskParam item;

        HBufC* fileName = HBufC::NewLC( reader, KMaxFileName );
        item.iFileName.Copy( *fileName );        
        CleanupStack::PopAndDestroy( fileName);       

        aStartupItems.Append( item );
        }

    CleanupStack::PopAndDestroy(); // reader
    }
void CGsaStateTranToDiffStatesTest::DoStateRequestTransitionToDiffStatesL()
	{
	INFO_PRINTF1(_L("DoStateRequestTransitionToDiffStates test started...."));
	
	RFs fs;
	TInt err = fs.Connect();
	TEST(err == KErrNone);
	User::LeaveIfError(err);
	CleanupClosePushL(fs);
		
	if (iProcessName == KTestProcTranFromNormal)
		{
		RFileReadStream fileReadStream1;
		err = fileReadStream1.Open(fs, KGsaTestStateTranFromNormalResult, EFileRead);
		INFO_PRINTF2(_L("Error in opening file: %d"), err);
		TEST(err == KErrNone);
		User::LeaveIfError(err);
		CleanupClosePushL(fileReadStream1);

		//System state before starting the test.
		CurrentSystemStateForStateTranTestL(fileReadStream1, ESsmNormal);

		//Scenario 1 - Request for state change from Normal to invalid state results in KErrNotSupported
		INFO_PRINTF1(_L("Request for state change from Normal to invalid state"));
		TInt stateTranResult = fileReadStream1.ReadInt32L();
		TEST(stateTranResult == KErrNotSupported);
		INFO_PRINTF2(_L("Actual : %d Expected : -5"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream1, ESsmNormal);
		
		//Scenario 2 - Request for state change from Normal to fail state with invalid substate results in KErrNotSupported
		INFO_PRINTF1(_L("Request for state change from Normal to fail state with invalid substate"));
		stateTranResult = fileReadStream1.ReadInt32L();
		TEST(stateTranResult == KErrNotSupported);
		INFO_PRINTF2(_L("Actual : %d Expected : -5"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream1, ESsmNormal);

		//Scenario 3 - Request for two state changes(1. fail state 2. shutdown state) one after the other without waiting 
		// for the first one to complete. Cancels both transition request. 		
		INFO_PRINTF1(_L("Request for two state changes(1. fail state 2. shutdown state)"));
		INFO_PRINTF1(_L("one after the other without waiting for the first one to complete."));
		INFO_PRINTF1(_L("Cancel the fail state transition request."));
		stateTranResult = fileReadStream1.ReadInt32L();
		TEST(stateTranResult == KErrCancel);
		INFO_PRINTF2(_L("First request to the fail state will be completed with %d Expected -3"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream1, ESsmNormal);

		stateTranResult = fileReadStream1.ReadInt32L();
		TEST(stateTranResult == KErrCancel);
		INFO_PRINTF2(_L("Second request to transit to the shutdown state will be completed with %d Expected -3"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream1, ESsmNormal);

		INFO_PRINTF2(_L("Test process exits with %d Expected -3"), stateTranResult);

		CleanupStack::PopAndDestroy();
		// Delete the result file
		//err = fs.Delete(KGsaTestStateTranFromNormalResult);

		RFileReadStream fileReadStream2;
		err = fileReadStream2.Open(fs, KGsaTestStateTranToShutdownResult, EFileRead);
		TEST(err == KErrNone);
		User::LeaveIfError(err);
		CleanupClosePushL(fileReadStream2);

		//System state before starting the test.
		CurrentSystemStateForStateTranTestL(fileReadStream2, ESsmNormal);

		//Scenario 1 - Request for state transition to shutdown state - invalid substate
		// request to transit to the shutdown state will be completed with KErrNotSupported
		INFO_PRINTF1(_L("Request for state transition to shutdown state - invalid substate"));
		stateTranResult = fileReadStream2.ReadInt32L();
		TEST(stateTranResult == KErrNotSupported);
		INFO_PRINTF2(_L("Actual : %d Expected : -5"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream2, ESsmNormal);
		
		INFO_PRINTF2(_L("Test process exits with %d Expected -5"), stateTranResult);

		CleanupStack::PopAndDestroy();
		// Delete the result file
		//err = fs.Delete(KGsaTestStateTranToShutdownResult);

		RFileReadStream fileReadStream3;
		err = fileReadStream3.Open(fs, KGsaTestStateTranFromShutdownResult, EFileRead);
		TEST(err == KErrNone);
		User::LeaveIfError(err);
		CleanupClosePushL(fileReadStream3);

		//System state before starting the test.
		CurrentSystemStateForStateTranTestL(fileReadStream3, ESsmNormal);

		//Scenario 1 - Request for state change from Normal to shutdown state to critical substate
		// Cancel the request immediately
		INFO_PRINTF1(_L("Request for state change from Normal to shutdown critical substate and Cancel the request"));
		stateTranResult = fileReadStream3.ReadInt32L();
		TEST(stateTranResult == KErrCancel);
		INFO_PRINTF2(_L("Actual : %d Expected : -3"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream3, ESsmNormal);

		//Scenario 2 - Request for state change from Normal to shutdown state to any substate
		// Cancel the request immediately, so that we can proceed with the next test scenario.

		INFO_PRINTF1(_L("Request for state change from Normal to shutdown any substate and Cancel the request"));
		stateTranResult = fileReadStream3.ReadInt32L();
		TEST(stateTranResult == KErrCancel);
		INFO_PRINTF2(_L("Actual : %d Expected : -3"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream3, ESsmNormal);

		INFO_PRINTF2(_L("Test process exits with %d Expected -3"), stateTranResult);

		CleanupStack::PopAndDestroy();
		// Delete the result file
		//err = fs.Delete(KGsaTestStateTranFromShutdownResult);
		}
	else if(iProcessName == KTestProcTranFromStartup)
		{
		RFileReadStream fileReadStream;
		err = fileReadStream.Open(fs, KGsaTestStateTranFromStartupResult, EFileRead);
		TEST(err == KErrNone);
		User::LeaveIfError(err);
		CleanupClosePushL(fileReadStream);

		//System state before starting the test.
		CurrentSystemStateForStateTranTestL(fileReadStream, ESsmStartup);

		//Scenario 1 - Request for state change from Startup to invalid state
		INFO_PRINTF1(_L("Request for state change from Startup to invalid state"));
		TInt stateTranResult = fileReadStream.ReadInt32L();
		TEST(stateTranResult == KErrNotSupported);
		INFO_PRINTF2(_L("Actual : %d Expected : -5"), stateTranResult);
		CurrentSystemStateForStateTranTestL(fileReadStream, ESsmStartup);
		
		INFO_PRINTF2(_L("Test process exits with %d Expected -5"), stateTranResult);
		
		CleanupStack::PopAndDestroy();
		// Delete the result file
		//err = fs.Delete(KGsaTestStateTranFromStartupResult);
		}
	else
		{
		TEST(err == KErrArgument);
		return;
		}

	CleanupStack::PopAndDestroy();
	INFO_PRINTF1(_L("case completed\n"));
	}
Example #7
0
void CJournalFile::ReadEntryL(RFileReadStream& aJournalStream, TInt aDrive)
	{
	TIntegrityServicesEvent event = static_cast<TIntegrityServicesEvent> (aJournalStream.ReadInt32L());
	
	HBufC* removedFile = NULL;
	HBufC* backupFile = NULL;
	HBufC* tempFile = NULL;
	HBufC* addedFile = NULL;
	
	switch(event)
		{
		case ERemovedFile:
			{
			VerifyIsEmptyOrFileEventL(iLastEvent);
			removedFile = HBufC::NewLC(aJournalStream, KMaxFileName);
			// should be followed by the backup event
			if(aJournalStream.ReadInt32L() != EBackupFile)
				{
				User::Leave(KErrCorrupt);
				}
			backupFile = HBufC::NewLC(aJournalStream, KMaxFileName);
			// make sure files are located on the same drive as the journal
			if(CJournalFile::CheckFileNameL(iFs, *removedFile) != aDrive 
				|| CJournalFile::CheckFileNameL(iFs, *backupFile) != aDrive)
				{
				User::Leave(KErrCorrupt);
				}
	
			CIntegrityTreeLeaf* removeLeaf = iTreeRoot->AddNodeL(*removedFile, ERemovedFile, iJournalFileName);
			CIntegrityTreeLeaf* backupLeaf = iTreeRoot->AddNodeL(*backupFile, EBackupFile, iJournalFileName);

			removeLeaf->SetPeer(backupLeaf);
			backupLeaf->SetPeer(removeLeaf);

			CleanupStack::PopAndDestroy(backupFile);
			CleanupStack::PopAndDestroy(removedFile);
			iBackupFilesCount++;
			iLastEvent = ERemovedFile;
			}
			break;
			
		case EBackupFile:
			// cannot have a backup file on its own
			User::Leave(KErrCorrupt);
			break;
			
		case ETempFile:
			VerifyIsEmptyOrFileEventL(iLastEvent);
			
			tempFile = HBufC::NewLC(aJournalStream, KMaxFileName);
			// make the file is located on the same drive as the journal
			if(CJournalFile::CheckFileNameL(iFs, *tempFile) != aDrive)
				{
				User::Leave(KErrCorrupt);
				}
			iTreeRoot->AddNodeL(*tempFile, ETempFile, iJournalFileName);
			CleanupStack::PopAndDestroy(tempFile);
			iLastEvent = ETempFile;
			break;
			
		case EAddedFile:
			VerifyIsEmptyOrFileEventL(iLastEvent);
			
			addedFile = HBufC::NewLC(aJournalStream, KMaxFileName);
			// make the file is located on the same drive as the journal
			if(CJournalFile::CheckFileNameL(iFs, *addedFile) != aDrive)
				{
				User::Leave(KErrCorrupt);
				}
			iTreeRoot->AddNodeL(*addedFile, EAddedFile, iJournalFileName);
			CleanupStack::PopAndDestroy(addedFile);
			iLastEvent = EAddedFile;
			break;
			
		case ECommitted:
			VerifyIsFileEventL(iLastEvent);
				
			iLastEvent = ECommitted;
			break;
			
		case EBackupFilesRemoved:
			if(iLastEvent != ECommitted)
				{
				User::Leave(KErrCorrupt);
				}
			iLastEvent = EBackupFilesRemoved;
			break;
			
		case EAddedFilesRemoved:
			if(iLastEvent != ECommitted)
				VerifyIsFileEventL(iLastEvent); // The last event can be only a commit, or one of the file events

			iLastEvent = EAddedFilesRemoved;
			break;
			
		case ETempFilesRemoved:
			if(iLastEvent != EBackupFilesRemoved && iLastEvent != ERemovedFilesRestored)
				{
				User::Leave(KErrCorrupt);
				}
			iLastEvent = ETempFilesRemoved;
			break;
			
		case ERemovedFilesRestored:
			if(iLastEvent != EAddedFilesRemoved)
				{
				User::Leave(KErrCorrupt);
				}
			iLastEvent = ERemovedFilesRestored;
			break;
			
		default:
			User::Leave(KErrCorrupt);
			break;
   		}
	}
void CVideoEntry::ImportL( RFileReadStream &aStream )
	{
	delete iBitmap;
	iBitmap = NULL;
	delete iScaledBitmap;
	iScaledBitmap = NULL;
	delete iMediaTitle;
	iMediaTitle = NULL;
	delete iUrl;
	iUrl = NULL;
	delete iThumbnailUrl;
	iThumbnailUrl = NULL;
	delete iThumbnailFile;
	iThumbnailFile = NULL;
	delete iVideoId;
	iVideoId = NULL;
	delete iAuthorName;
	iAuthorName = NULL;
	delete iAuthorUrl;
	iAuthorUrl = NULL;
	delete iRelatedUrl;
	iRelatedUrl = NULL;
	delete iAuthorVideosUrl;
	iAuthorVideosUrl = NULL;

	TInt len;

	len = aStream.ReadInt16L();
	if( len )
		{
		iMediaTitle = HBufC::NewL( len );
		TPtr tmp(iMediaTitle->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iMediaTitle = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iUrl = HBufC::NewL( len );
		TPtr tmp(iUrl->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iUrl = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iThumbnailUrl = HBufC::NewL( len );
		TPtr tmp(iThumbnailUrl->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iThumbnailUrl = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iThumbnailFile = HBufC::NewL( len );
		TPtr tmp(iThumbnailFile->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iThumbnailFile = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iVideoId = HBufC::NewL( len );
		TPtr tmp(iVideoId->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iVideoId = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iAuthorName = HBufC::NewL( len );
		TPtr tmp(iAuthorName->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iAuthorName = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iAuthorUrl = HBufC::NewL( len );
		TPtr tmp(iAuthorUrl->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iAuthorUrl = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iRelatedUrl = HBufC::NewL( len );
		TPtr tmp(iRelatedUrl->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iRelatedUrl = KNullDesC().AllocL();
		}

	len = aStream.ReadInt16L();
	if( len )
		{
		iAuthorVideosUrl = HBufC::NewL( len );
		TPtr tmp(iAuthorVideosUrl->Des());
		aStream.ReadL(tmp, len);
		}
	else
		{
		iAuthorVideosUrl = KNullDesC().AllocL();
		}

	iThumbnailHeight = aStream.ReadInt32L();
	iThumbnailWidth = aStream.ReadInt32L();
	iDuration = aStream.ReadInt32L();
	iAverageRating = aStream.ReadReal32L();
	iViewCount = aStream.ReadInt32L();
	}
// ---------------------------------------------------------------------------
// CLbtCleanupHandler::ReadCleanupDataFromFileL
// ---------------------------------------------------------------------------
//
void CLbtCleanupHandler::ReadCleanupDataFromFileL()
	{
	FUNC_ENTER("CLbtCleanupHandler::ReadCleanupDataFromFileL");
	
	// First reset the cleanup data 
	iCleanupItems.ResetAndDestroy();
	
	// Open handle to file system
	RFs fs;
	User::LeaveIfError(fs.Connect());
	
	CleanupClosePushL(fs);
	
	// Obtain the file path
    TFileName file;
    
    // Gets the path in which the file can be created
    fs.SessionPath(file);

    // Create the file Directory ie the private directory of the process
    fs.MkDirAll(file);
    
    // Append the name of the file
    file.Append(KLbtAppCleanupFileName);
    
    // Open read stream
    RFileReadStream readStream;
    
    TInt error = readStream.Open( fs, file, EFileRead );
    if( error != KErrNone )
    	{
    	// File may not exists
    	ERROR("Opening of cleanup file failed with : %d", error);
    	readStream.Close();
    	CleanupStack::PopAndDestroy(); //fs
    	return;
    	}
    CleanupClosePushL( readStream );
    
    // Get the count in the cleanup array
    TInt count = readStream.ReadInt16L();    
    for(TInt i=0; i<count; ++i)
    	{
    	RArray<TLbtTriggerId> triggers;
    	CleanupClosePushL(triggers);
    	
    	// Read the trigger ids
    	TInt triggerCount = readStream.ReadInt16L();
    	for(TInt j=0;j<triggerCount;++j)
    		{
    		triggers.Append( readStream.ReadUint32L() );
    		}
    	
    	// Read the universal time
    	TInt year = readStream.ReadInt32L();
    	TMonth month = static_cast<TMonth>( readStream.ReadInt32L() );
    	TInt day = readStream.ReadInt32L();
    	
    	TDateTime dateTime( year,
    						month,
    						day,
    						0,
    						0,
    						0,
    						0 );
    	TTime time( dateTime );
    	
    	CLbtCleanupItem* cleanupItem = new (ELeave) CLbtCleanupItem();
    	cleanupItem->AddCleanupItem( triggers, time );
    	
    	CleanupStack::Pop(); // triggers
    	triggers.Close();
    	
    	// Append cleanup item to the cleaup items array
    	iCleanupItems.Append( cleanupItem );
    	}

    CleanupStack::PopAndDestroy(2); // fs and readStream
	}
Example #10
0
// ----------------------------------------------------------------------------
// WidgetPreferences::PreferenceL
// Get preference for a key
//
//
// ----------------------------------------------------------------------------
TInt WidgetPreferences::preferenceL( const TDesC& akey, HBufC*& avalue)
{

    TInt rSuccess = KErrNotFound;
    TInt size = 0;

    if ( !m_basepath || (m_basepath->Length() <= 0) )
        return rSuccess;


    if ( akey.Length() <= KMaxKeyValueSize ) {

        HBufC* k = HBufC::NewLC( akey.Length() + KMaxIntLength + 1 );
        k->Des().Format( KKeyFormat, m_widgetid, &akey );

        PrefElement* pref = m_preferences->Find( *k );

        if ( !pref ) {
            CleanupStack::PopAndDestroy( k );
            return rSuccess;
        }

        size = pref->valueSize();

        if ( size > KMaxKeyValueSize ) {
            // return contents from temp file whose name is stored
            // in the m_value member of m_preferences
            RFs fs;

            if ( fs.Connect() == KErrNone ) {
                CleanupClosePushL( fs );
                HBufC* filePath = HBufC::NewLC( pref->value().Length() );
                TPtr fName( filePath->Des() );
                fName.Append( pref->value() );

                RFileReadStream readStream;

                if ( readStream.Open( fs, *filePath, EFileRead ) == KErrNone ) {
                    CleanupClosePushL( readStream );
                    TInt len( readStream.ReadInt32L() );
                    if ( len > 0 ) {
                        HBufC* v = HBufC::NewLC( len );
                        TPtr ptrvalue = v->Des();
                        readStream.ReadL( ptrvalue, len );
                        avalue = v; // ownership xfered
                        CleanupStack::Pop( v );
                        rSuccess = KErrNone;
                    }
                    CleanupStack::PopAndDestroy();//readStream
                }

                CleanupStack::PopAndDestroy( 2 ); //filePath,fs
            }
        }
        else if ( size >= 0 ) {
            avalue = pref->value().AllocL();
            rSuccess = KErrNone;
        }

        CleanupStack::PopAndDestroy( k );
    }

    return rSuccess;

}
TBool CSupLoginServiceProvider::ReadDataFromFileL()
{
	__LOGSTR_TOFILE("CSupLoginServiceProvider::ReadDataFromFileL() begins");

	// If current operation should be cancelled
	if (iCancelStatus)
		return EFalse;

	TBool retValue = ETrue;

	RFs fsSession;
	RFileReadStream readStream; // Read stream from file

	// Install read file session
	User::LeaveIfError(fsSession.Connect());
	CleanupClosePushL(fsSession);

	TInt err = readStream.Open(fsSession, iSettingsFile, EFileStream | EFileRead | EFileShareExclusive);
	CleanupClosePushL(readStream);

	// If file does not exist - return EFalse
	if (err != KErrNone)
	{
		retValue = EFalse;

		__LOGSTR_TOFILE("CSupLoginServiceProvider::ReadDataFromFileL() failed to open");
	}

	if (retValue)
	{
		TInt valueMaxLen = 0;
		HBufC8* tempValue = NULL;	

		// iMemberID
		valueMaxLen = readStream.ReadInt32L();

		__LOGSTR_TOFILE("CSupLoginServiceProvider::ReadDataFromFileL() reading member id");

		tempValue = HBufC8::NewL(readStream, valueMaxLen);
		if (tempValue)
		{
			if (iMemberID)
			{
				delete iMemberID;
				iMemberID = NULL;
			}

			iMemberID = tempValue->Des().AllocL();

			delete tempValue;
			tempValue = NULL;
		}

		// iUsername
		valueMaxLen = readStream.ReadInt32L();

		__LOGSTR_TOFILE("CSupLoginServiceProvider::ReadDataFromFileL() reading username");

		tempValue = HBufC8::NewL(readStream, valueMaxLen);
		if (tempValue)
		{
			if (iUsername)
			{
				delete iUsername;
				iUsername = NULL;
			}

			iUsername = tempValue->Des().AllocL();

			delete tempValue;
			tempValue = NULL;
		}

		// iPassword
		valueMaxLen = readStream.ReadInt32L();

		__LOGSTR_TOFILE("CSupLoginServiceProvider::ReadDataFromFileL() reading password");

		tempValue = HBufC8::NewL(readStream, valueMaxLen);
		if (tempValue)
		{
			if (iPassword)
			{
				delete iPassword;
				iPassword = NULL;
			}

			iPassword = tempValue->Des().AllocL();

			delete tempValue;
			tempValue = NULL;
		}
	}

	// Free resource handlers
	CleanupStack::PopAndDestroy(&readStream);
	CleanupStack::PopAndDestroy(&fsSession);	

	__LOGSTR_TOFILE("CSupLoginServiceProvider::ReadDataFromFileL() ends");

	return retValue;
}