diff -r 000000000000 -r bde4ae8d615e os/persistentdata/persistentstorage/dbms/pcdbms/tdbms/src/crccheck.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/persistentdata/persistentstorage/dbms/pcdbms/tdbms/src/crccheck.h Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,59 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef __T2_CRCCHECK_H__ +#define __T2_CRCCHECK_H__ + +#include +#include + +typedef struct + { + TInt filesz; + TUint32 crc; + } TestCheckInfo; + +class TDBMS_CRCChecks + { +public: + TDBMS_CRCChecks() + { + User::LeaveIfError(ifs.Connect()); + }; + ~TDBMS_CRCChecks() { ifs.Close(); iarray.Close(); }; + TInt FileCrcL(const RFile&, TUint32 &); + const TInt GenerateCrcL(const TPtrC); + const TInt RecordCount(); + const TestCheckInfo operator[](const TInt); + const TInt DumpCrcRecordsL(const TDesC&); + const TInt ValidateCrcRecordsL(const TDesC&); + const void ErrorReportL(const TInt err, TPtrC&); + const TInt SetSessionPath(const TDesC&); + + enum TCrcCheckErrs { + ECrcCheckOk=1, + ECrcCheckMismatch, + ECrcCheckFewerRecords, + ECrcCheckMoreRecords, + }; + +private: + RFs ifs; + TPtrC8 itestname, ilogfile; + RArray iarray; + }; + + +#endif // __T2_CRCCHECK_H__