1 /* |
1 /* |
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
60 |
60 |
61 // Remember the offset where the data begins |
61 // Remember the offset where the data begins |
62 User::LeaveIfError(iDataProvider.Seek(ESeekCurrent, iOffset)); |
62 User::LeaveIfError(iDataProvider.Seek(ESeekCurrent, iOffset)); |
63 ReadMemberArrayL(iDataProvider, iDataUnits, EFieldTypeDataUnit, arrayBytes, EReadType); |
63 ReadMemberArrayL(iDataProvider, iDataUnits, EFieldTypeDataUnit, arrayBytes, EReadType); |
64 |
64 |
|
65 TInt64 fieldOffset = 0; |
|
66 #ifdef SIS_CRC_CHECK_ENABLED |
65 // Calculate CRC of header and field data by reading the entire header and field |
67 // Calculate CRC of header and field data by reading the entire header and field |
66 TInt64 fieldOffset = iOffset - HeaderSize(); |
68 fieldOffset = iOffset - HeaderSize(); |
67 User::LeaveIfError(iDataProvider.Seek(ESeekStart, fieldOffset)); |
69 User::LeaveIfError(iDataProvider.Seek(ESeekStart, fieldOffset)); |
68 CField::CalculateCrcL(iDataProvider, HeaderSize() + Length() + PaddingSize(), iCrc ); |
70 CField::CalculateCrcL(iDataProvider, HeaderSize() + Length() + PaddingSize(), iCrc ); |
|
71 #else |
|
72 fieldOffset = iOffset + Length() + PaddingSize(); |
|
73 User::LeaveIfError(iDataProvider.Seek(ESeekStart, fieldOffset)); |
|
74 #endif |
69 aBytesRead += Length() + PaddingSize(); |
75 aBytesRead += Length() + PaddingSize(); |
70 } |
76 } |
71 |
77 |
72 void CData::ReadDataL(RFile& aFile, TInt aFileIndex, TInt aDataUnit) |
78 void CData::ReadDataL(RFile& aFile, TInt aFileIndex, TInt aDataUnit) |
73 { |
79 { |