| sl@0 |      1 | // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
 | 
| sl@0 |      2 | // All rights reserved.
 | 
| sl@0 |      3 | // This component and the accompanying materials are made available
 | 
| sl@0 |      4 | // under the terms of "Eclipse Public License v1.0"
 | 
| sl@0 |      5 | // which accompanies this distribution, and is available
 | 
| sl@0 |      6 | // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 | 
| sl@0 |      7 | //
 | 
| sl@0 |      8 | // Initial Contributors:
 | 
| sl@0 |      9 | // Nokia Corporation - initial contribution.
 | 
| sl@0 |     10 | //
 | 
| sl@0 |     11 | // Contributors:
 | 
| sl@0 |     12 | //
 | 
| sl@0 |     13 | // Description:
 | 
| sl@0 |     14 | //
 | 
| sl@0 |     15 | 
 | 
| sl@0 |     16 | #ifndef __T2_CRCCHECK_H__
 | 
| sl@0 |     17 | #define __T2_CRCCHECK_H__
 | 
| sl@0 |     18 | 
 | 
| sl@0 |     19 | #include <f32file.h>
 | 
| sl@0 |     20 | #include <e32test.h>
 | 
| sl@0 |     21 | 
 | 
| sl@0 |     22 | typedef struct
 | 
| sl@0 |     23 | 	{
 | 
| sl@0 |     24 | 	TInt filesz;
 | 
| sl@0 |     25 | 	TUint32 crc;
 | 
| sl@0 |     26 | 	} TestCheckInfo;
 | 
| sl@0 |     27 | 
 | 
| sl@0 |     28 | class TDBMS_CRCChecks
 | 
| sl@0 |     29 | 	{
 | 
| sl@0 |     30 | public:
 | 
| sl@0 |     31 | 	TDBMS_CRCChecks()
 | 
| sl@0 |     32 |    		{ 
 | 
| sl@0 |     33 | 		User::LeaveIfError(ifs.Connect());
 | 
| sl@0 |     34 | 		};
 | 
| sl@0 |     35 | 	~TDBMS_CRCChecks() { ifs.Close(); iarray.Close(); };
 | 
| sl@0 |     36 | 	TInt FileCrcL(const RFile&, TUint32 &);
 | 
| sl@0 |     37 | 	const TInt GenerateCrcL(const TPtrC);
 | 
| sl@0 |     38 | 	const TInt RecordCount();
 | 
| sl@0 |     39 | 	const TestCheckInfo operator[](const TInt);
 | 
| sl@0 |     40 | 	const TInt DumpCrcRecordsL(const TDesC&);
 | 
| sl@0 |     41 | 	const TInt ValidateCrcRecordsL(const TDesC&);
 | 
| sl@0 |     42 | 	const void ErrorReportL(const TInt err, TPtrC&);
 | 
| sl@0 |     43 | 	const TInt SetSessionPath(const TDesC&);
 | 
| sl@0 |     44 | 	
 | 
| sl@0 |     45 | 	enum TCrcCheckErrs 	{
 | 
| sl@0 |     46 | 						ECrcCheckOk=1,
 | 
| sl@0 |     47 | 						ECrcCheckMismatch,
 | 
| sl@0 |     48 | 						ECrcCheckFewerRecords,
 | 
| sl@0 |     49 | 						ECrcCheckMoreRecords,
 | 
| sl@0 |     50 | 						};
 | 
| sl@0 |     51 | 
 | 
| sl@0 |     52 | private:
 | 
| sl@0 |     53 | 	RFs ifs;
 | 
| sl@0 |     54 | 	TPtrC8 itestname, ilogfile;
 | 
| sl@0 |     55 | 	RArray<TestCheckInfo> iarray;
 | 
| sl@0 |     56 | 	};
 | 
| sl@0 |     57 | 
 | 
| sl@0 |     58 | 
 | 
| sl@0 |     59 | #endif  //  __T2_CRCCHECK_H__
 |