sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: #ifndef __T2_CRCCHECK_H__
sl@0: #define __T2_CRCCHECK_H__
sl@0: 
sl@0: #include <f32file.h>
sl@0: #include <e32test.h>
sl@0: 
sl@0: typedef struct
sl@0: 	{
sl@0: 	TInt filesz;
sl@0: 	TUint32 crc;
sl@0: 	} TestCheckInfo;
sl@0: 
sl@0: class TDBMS_CRCChecks
sl@0: 	{
sl@0: public:
sl@0: 	TDBMS_CRCChecks()
sl@0:    		{ 
sl@0: 		User::LeaveIfError(ifs.Connect());
sl@0: 		};
sl@0: 	~TDBMS_CRCChecks() { ifs.Close(); iarray.Close(); };
sl@0: 	TInt FileCrcL(const RFile&, TUint32 &);
sl@0: 	const TInt GenerateCrcL(const TPtrC);
sl@0: 	const TInt RecordCount();
sl@0: 	const TestCheckInfo operator[](const TInt);
sl@0: 	const TInt DumpCrcRecordsL(const TDesC&);
sl@0: 	const TInt ValidateCrcRecordsL(const TDesC&);
sl@0: 	const void ErrorReportL(const TInt err, TPtrC&);
sl@0: 	const TInt SetSessionPath(const TDesC&);
sl@0: 	
sl@0: 	enum TCrcCheckErrs 	{
sl@0: 						ECrcCheckOk=1,
sl@0: 						ECrcCheckMismatch,
sl@0: 						ECrcCheckFewerRecords,
sl@0: 						ECrcCheckMoreRecords,
sl@0: 						};
sl@0: 
sl@0: private:
sl@0: 	RFs ifs;
sl@0: 	TPtrC8 itestname, ilogfile;
sl@0: 	RArray<TestCheckInfo> iarray;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: #endif  //  __T2_CRCCHECK_H__