lowlevellibsandfws/apputils/inc/BaRsc2.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __BARSC2_H__
       
    17 #define __BARSC2_H__
       
    18 
       
    19 #include <f32file.h>
       
    20 
       
    21 //Forward declarations
       
    22 class RResourceFileImpl;
       
    23 
       
    24 /** Accesses a resource file or resource file buffer and reads the 
       
    25 resource data into a buffer.
       
    26 
       
    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.
       
    30 
       
    31 @publishedAll 
       
    32 @released
       
    33 @see RResourceReader */
       
    34 class CResourceFile : public CBase
       
    35 	{
       
    36 public:
       
    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;
       
    52 private:
       
    53 	CResourceFile();
       
    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;
       
    60 private:
       
    61 	enum
       
    62 		{
       
    63 		KRscFileSize = 24
       
    64 		};
       
    65 	TUint8 iImpl[KRscFileSize];
       
    66 	};
       
    67 
       
    68 #endif//__BARSC2_H__