williamr@2
|
1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __BARSC2_H__
|
williamr@2
|
17 |
#define __BARSC2_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <f32file.h>
|
williamr@2
|
20 |
|
williamr@2
|
21 |
//Forward declarations
|
williamr@2
|
22 |
class RResourceFileImpl;
|
williamr@2
|
23 |
|
williamr@2
|
24 |
/** Accesses a resource file or resource file buffer and reads the
|
williamr@2
|
25 |
resource data into a buffer.
|
williamr@2
|
26 |
|
williamr@2
|
27 |
Interpretation of the data is achieved using the RResourceReader class.
|
williamr@2
|
28 |
CResourceFile methods behaviour when some problem occurs - it leaves
|
williamr@2
|
29 |
with an error code. Most of the time the error code will be KErrCorrupt.
|
williamr@2
|
30 |
|
williamr@2
|
31 |
@publishedAll
|
williamr@2
|
32 |
@released
|
williamr@2
|
33 |
@see RResourceReader */
|
williamr@2
|
34 |
class CResourceFile : public CBase
|
williamr@2
|
35 |
{
|
williamr@2
|
36 |
public:
|
williamr@2
|
37 |
IMPORT_C static CResourceFile* NewL(RFs& aFs, const TDesC& aName,
|
williamr@2
|
38 |
TUint aFileOffset, TInt aFileSize);
|
williamr@2
|
39 |
IMPORT_C static CResourceFile* NewLC(RFs& aFs, const TDesC& aName,
|
williamr@2
|
40 |
TUint aFileOffset, TInt aFileSize);
|
williamr@2
|
41 |
IMPORT_C static CResourceFile* NewL(const TDesC8& aRscFileBuffer);
|
williamr@2
|
42 |
IMPORT_C virtual ~CResourceFile();
|
williamr@2
|
43 |
IMPORT_C TUidType UidType() const;
|
williamr@2
|
44 |
IMPORT_C void ReadL(TDes8 &aDes,TInt aResourceId) const;
|
williamr@2
|
45 |
IMPORT_C HBufC8 *AllocReadL(TInt aResourceId) const;
|
williamr@2
|
46 |
IMPORT_C HBufC8 *AllocReadLC(TInt aResourceId) const;
|
williamr@2
|
47 |
IMPORT_C void ConfirmSignatureL(TInt aSignature);
|
williamr@2
|
48 |
IMPORT_C void ConfirmSignatureL();
|
williamr@2
|
49 |
IMPORT_C TInt SignatureL() const;
|
williamr@2
|
50 |
IMPORT_C TBool OwnsResourceIdL(TInt aResourceId) const;
|
williamr@2
|
51 |
IMPORT_C TInt Offset() const;
|
williamr@2
|
52 |
private:
|
williamr@2
|
53 |
CResourceFile();
|
williamr@2
|
54 |
CResourceFile(const CResourceFile&);//prevent default copy constructor
|
williamr@2
|
55 |
CResourceFile& operator=(const CResourceFile&);//prevent default "=" operator
|
williamr@2
|
56 |
void ConstructL(RFs& aFs, const TDesC& aName, TUint aFileOffset, TInt aFileSize);
|
williamr@2
|
57 |
void ConstructL(const TDesC8& aRscFileBuffer);
|
williamr@2
|
58 |
RResourceFileImpl* Impl();
|
williamr@2
|
59 |
const RResourceFileImpl* Impl() const;
|
williamr@2
|
60 |
private:
|
williamr@2
|
61 |
enum
|
williamr@2
|
62 |
{
|
williamr@2
|
63 |
KRscFileSize = 24
|
williamr@2
|
64 |
};
|
williamr@2
|
65 |
TUint8 iImpl[KRscFileSize];
|
williamr@2
|
66 |
};
|
williamr@2
|
67 |
|
williamr@2
|
68 |
#endif//__BARSC2_H__
|