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