1 // Copyright (c) 2003-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 //Forward declarations
22 class RResourceFileImpl;
24 /** Accesses a resource file or resource file buffer and reads the
25 resource data into a buffer.
27 Interpretation of the data is achieved using the RResourceReader class.
28 CResourceFile methods behaviour when some problem occurs - it leaves
29 with an error code. Most of the time the error code will be KErrCorrupt.
33 @see RResourceReader */
34 class CResourceFile : public CBase
37 IMPORT_C static CResourceFile* NewL(RFs& aFs, const TDesC& aName,
38 TUint aFileOffset, TInt aFileSize);
39 IMPORT_C static CResourceFile* NewLC(RFs& aFs, const TDesC& aName,
40 TUint aFileOffset, TInt aFileSize);
41 IMPORT_C static CResourceFile* NewL(const TDesC8& aRscFileBuffer);
42 IMPORT_C virtual ~CResourceFile();
43 IMPORT_C TUidType UidType() const;
44 IMPORT_C void ReadL(TDes8 &aDes,TInt aResourceId) const;
45 IMPORT_C HBufC8 *AllocReadL(TInt aResourceId) const;
46 IMPORT_C HBufC8 *AllocReadLC(TInt aResourceId) const;
47 IMPORT_C void ConfirmSignatureL(TInt aSignature);
48 IMPORT_C void ConfirmSignatureL();
49 IMPORT_C TInt SignatureL() const;
50 IMPORT_C TBool OwnsResourceIdL(TInt aResourceId) const;
51 IMPORT_C TInt Offset() const;
54 CResourceFile(const CResourceFile&);//prevent default copy constructor
55 CResourceFile& operator=(const CResourceFile&);//prevent default "=" operator
56 void ConstructL(RFs& aFs, const TDesC& aName, TUint aFileOffset, TInt aFileSize);
57 void ConstructL(const TDesC8& aRscFileBuffer);
58 RResourceFileImpl* Impl();
59 const RResourceFileImpl* Impl() const;
65 TUint8 iImpl[KRscFileSize];