1.1 --- a/epoc32/include/barsc.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/barsc.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,87 @@
1.4 -barsc.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __BARSC_H__
1.21 +#define __BARSC_H__
1.22 +
1.23 +#include <f32file.h>
1.24 +
1.25 +//Forward declarations
1.26 +class RResourceFileImpl;
1.27 +
1.28 +/** Accesses a resource file and reads the resource data into a buffer.
1.29 +
1.30 +Interpretation of the data is achieved using the TResourceReader class.
1.31 +
1.32 +RResourceFile instance behaviour when some problem occurs - it panics. Or asserts,
1.33 +if the used method is not "L" method.
1.34 +
1.35 +Expected behaviour when assignment operator or copy constructor is called:
1.36 +The class doesn't have assignment operator and copy constructor, so the compiler generated
1.37 +ones will be used. The heap buffers used by the source class instance will be shared with the
1.38 +destination class instance.
1.39 +
1.40 +Expected behaviour when the RResourceFile instance is about to be destroyed:
1.41 +The class doesn't have destructor so compiler generated one will be used.
1.42 +Always call Close() to free allocated by the instance resources.
1.43 +
1.44 +@see TResourceReader
1.45 +@publishedAll
1.46 +@released
1.47 +*/
1.48 +class RResourceFile
1.49 + {
1.50 +public:
1.51 + IMPORT_C RResourceFile();
1.52 + IMPORT_C void Close();
1.53 + IMPORT_C void OpenL(RFs &aFs,const TDesC &aName);
1.54 + IMPORT_C TUidType UidType() const;
1.55 + IMPORT_C void ReadL(TDes8 &aDes,TInt aResourceId) const;
1.56 + IMPORT_C HBufC8 *AllocReadL(TInt aResourceId) const;
1.57 + IMPORT_C HBufC8 *AllocReadLC(TInt aResourceId) const;
1.58 + IMPORT_C void ConfirmSignatureL(TInt aSignature);
1.59 + IMPORT_C void ConfirmSignatureL();
1.60 + IMPORT_C TInt SignatureL() const; // not available before Release 005
1.61 + IMPORT_C TBool OwnsResourceId(TInt aResourceId) const;
1.62 + IMPORT_C TBool OwnsResourceIdL(TInt aResourceId) const;
1.63 + IMPORT_C void OpenL(RFs& aFs, const TDesC& aName, TUint aFileOffset, TInt aFileSize);
1.64 + inline TInt Offset() const;
1.65 +private:
1.66 + void DoOpenL(RFs& aFs, const TDesC& aName, TUint aFileOffset, TInt aFileSize);
1.67 + IMPORT_C TInt Offset2() const;
1.68 + RResourceFileImpl* Impl();
1.69 + const RResourceFileImpl* Impl() const;
1.70 +private:
1.71 + enum
1.72 + {
1.73 + KRscFileSize = 24
1.74 + };
1.75 + TUint8 iImpl[KRscFileSize];
1.76 + };
1.77 +
1.78 +/** Returns the offset value defined for this resource file.
1.79 +
1.80 +This function must not be called until a call to ConfirmSignatureL() has
1.81 +completed successfully, otherwise the value returned by this function may
1.82 +be meaningless.
1.83 +
1.84 +@return The offset value defined for this resource file.
1.85 +@see RResourceFile::ConfirmSignatureL() */
1.86 +inline TInt RResourceFile::Offset() const
1.87 + {
1.88 + return Offset2();
1.89 + }
1.90 +
1.91 +#endif//__BARSC_H__