sl@0: /* sl@0: * Copyright (c) 2007-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 the License "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: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: #ifndef __FILEREADER__ sl@0: #define __FILEREADER__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class CFileReader : public CBase sl@0: { sl@0: public: sl@0: static CFileReader* NewL(TPtrC aFileReader); sl@0: static CFileReader* NewLC(TPtrC aFileReader); sl@0: static CFileReader* NewL(TPtrC aFilePath, TInt aBlockSize); sl@0: static CFileReader* NewLC(TPtrC aFilePath, TInt aBlockSize); sl@0: sl@0: operator const TPtrC8(); sl@0: sl@0: virtual ~CFileReader(); sl@0: sl@0: TBool ReadBlockL(); sl@0: sl@0: TInt NumBlocks(); sl@0: sl@0: /** Parse a hex string and return a new RInteger. */ sl@0: RInteger ParseIntegerL(); sl@0: sl@0: /** Parse a hex string and return a new descriptor containing the binary data. */ sl@0: HBufC8* ParseBinaryL(const TDesC8& aDes); sl@0: sl@0: private: sl@0: CFileReader(); sl@0: sl@0: void ConstructL(TPtrC aFileReader); sl@0: void ConstructL(TPtrC aFilePath, TInt aOffsetSize); sl@0: sl@0: HBufC8* iFileContents; sl@0: HBufC* iFilePath; sl@0: TInt iFileOffset; sl@0: TInt iBlockSize; sl@0: sl@0: RFs iRfs; sl@0: RFile iFile; sl@0: sl@0: sl@0: }; sl@0: #endif