sl@0: // Copyright (c) 1998-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 "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: #if !defined(__S32FILE_H__) sl@0: #define __S32FILE_H__ sl@0: #if !defined(__F32FILE_H__) sl@0: #include sl@0: #endif sl@0: #if !defined(__S32STOR_H__) sl@0: #include sl@0: #endif sl@0: sl@0: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: sl@0: template sl@0: class TCapture; sl@0: class RPermanentFileStoreIter; sl@0: sl@0: /** A stream buffer hosted by a file. sl@0: * @publishedAll sl@0: * @released sl@0: sl@0: Instances of this class are used by file based persistent stores, i.e. CFileStore sl@0: type objects. An RFileBuf object is associated with a file and the file is sl@0: said to be attached to the stream buffer. sl@0: sl@0: An RFileBuf object is also used by RFileReadStream and RFileWriteStream objects sl@0: to provide buffered file I/O. sl@0: sl@0: The stream buffer has intermediate buffering capabilities. sl@0: sl@0: When used as the basis for a file store, it hosts multiple streams through sl@0: the TStreamExchange and RShareBuf classes. sl@0: sl@0: Open(), Close(), Attach(), Detach(), File() and Reattach() usage patterns: sl@0: sl@0: Pattern 1: RFileBuf owns the file sl@0: step 1a: Open()/Create()/Temp() is used to connect the buffer to a file sl@0: step 1b: Use the file buffer sl@0: step 1c: Close() releases this resource. sl@0: sl@0: Pattern 2: RFile is opened elsewhere and ownership is handed over to RFileBuf sl@0: This may happen if the file is already opened by another API, or from another process for example sl@0: step 2a: Attach() is used to hand ownership of the opened file to the buffer. After Attach() the supplied file handle is NULLed. sl@0: step 2b: Use the file buffer sl@0: step 2c: Close() releases the file resource. sl@0: sl@0: Pattern 3: RFileBuf is used transiently to manage an existing opened file: sl@0: step 3a: Attach() is used to bind the buffer to the already open file. After Attach() the supplied file handle is NULLed. sl@0: step 3b: Use the file buffer sl@0: step 3c: RFileBuf::File() is used to retrieve the file handle again, then Detach() is called to disconnect the buffer from the file. sl@0: At this point, the destruction of the file buffer will have no effect on the file. The retrieved file handle in step 3c must be used to close the file. sl@0: sl@0: Pattern 4: Transient direct file access to a buffered file sl@0: step 4a: RFileBuf::File() is used to retrieve the file handle. [Optional: Detach() is used to disconnect the file buffer] sl@0: step 4b: Use the file directly. Note that writing to the file may cause coherency problems with the RFileBuf buffer - in which case you need to Reset() the buffer as well. sl@0: step 4c: [Optional: Reattach() is used to hand the file back to the buffer]. Use of the buffer is resumed sl@0: sl@0: @see CFileStore sl@0: @see RFileReadStream sl@0: @see RFileWriteStream */ sl@0: class RFileBuf : public TStreamBuf sl@0: { sl@0: public: sl@0: IMPORT_C RFileBuf(); sl@0: IMPORT_C RFileBuf(TInt aSize); sl@0: RFileBuf(TCapture aCapture); sl@0: IMPORT_C void Reset(); sl@0: inline void Reset(TInt aSize); sl@0: // sl@0: IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: IMPORT_C void Attach(RFile& aFile,TInt aPos=0); sl@0: IMPORT_C void Close(); sl@0: inline void Detach(); sl@0: inline void Reattach(RFile& aFile); sl@0: // sl@0: IMPORT_C void SetSizeL(TInt aSize); sl@0: inline RFile& File() const; sl@0: protected: sl@0: IMPORT_C TInt UnderflowL(TInt aMaxLength); sl@0: IMPORT_C void OverflowL(); sl@0: IMPORT_C void DoRelease(); sl@0: IMPORT_C void DoSynchL(); sl@0: IMPORT_C TInt DoReadL(TAny* aPtr,TInt aMaxLength); sl@0: IMPORT_C TInt DoReadL(TDes8& aDes,TInt aMaxLength,TRequestStatus& aStatus); sl@0: IMPORT_C void DoWriteL(const TAny* aPtr,TInt aLength); sl@0: IMPORT_C TInt DoWriteL(const TDesC8& aDes,TInt aMaxLength,TRequestStatus& aStatus); sl@0: IMPORT_C TStreamPos DoSeekL(TMark aMark,TStreamLocation aLocation,TInt anOffset); sl@0: // sl@0: inline void SetBuf(TRead,TUint8* aPtr,TUint8* anEnd); sl@0: inline void SetBuf(TWrite,TUint8* aPtr,TUint8* anEnd); sl@0: inline void SetBuf(TArea anArea,TUint8* aPtr,TUint8* anEnd); sl@0: private: sl@0: TUint8* AllocL(); sl@0: void Free(); sl@0: // sl@0: void SetPos(TMark aMark,TInt aPos); sl@0: inline void SetPos(TRead,TInt aPos); sl@0: inline void SetPos(TWrite,TInt aPos); sl@0: inline TInt Pos(TRead) const; sl@0: inline TInt Pos(TWrite) const; sl@0: inline TInt MovePos(TRead,TInt anOffset); sl@0: inline TInt MovePos(TWrite,TInt anOffset); sl@0: TInt FileReadL(TAny* aPtr,TInt aMaxLength); sl@0: void FileWriteL(const TAny* aPtr,TInt aLength,TInt aSeek); sl@0: void FileWriteL(const TAny* aPtr,TInt aLength); sl@0: TInt EndL(); sl@0: // sl@0: inline TInt Lag(TRead) const; sl@0: inline TInt Lag(TWrite) const; sl@0: TInt Mark(TMark aMark) const; sl@0: inline TInt Mark(TRead) const; sl@0: inline TInt Mark(TWrite) const; sl@0: inline TUint8* Limit(TWrite) const; sl@0: inline void SetLimit(TWrite,TUint8* aLimit); sl@0: inline TInt Span(TWrite) const; sl@0: inline TInt Reach(TWrite) const; sl@0: private: sl@0: TUint8* iBase; sl@0: TInt iSize; sl@0: __MUTABLE RFile iFile; sl@0: TInt iRPos; sl@0: TInt iWPos; sl@0: TInt iExt; sl@0: TUint8* iWLim; sl@0: friend class CFileStore; sl@0: }; sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * Supports the reading of a stream from a file. sl@0: */ sl@0: class RFileReadStream : public RReadStream sl@0: { sl@0: public: sl@0: /** Constructs an empty read stream object. */ sl@0: RFileReadStream() {} sl@0: IMPORT_C RFileReadStream(RFile& aFile,TInt aPos=0); sl@0: IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C void Attach(RFile& aFile,TInt aPos=0); sl@0: private: sl@0: RFileBuf iSource; sl@0: }; sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * Supports the writing of a stream to a file. sl@0: */ sl@0: class RFileWriteStream : public RWriteStream sl@0: { sl@0: public: sl@0: /** Constructs an empty write stream object. */ sl@0: RFileWriteStream() {} sl@0: inline RFileWriteStream(const MExternalizer& anExter); sl@0: IMPORT_C RFileWriteStream(RFile& aFile,TInt aPos=0); sl@0: IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: IMPORT_C void Attach(RFile& aFile,TInt aPos=0); sl@0: private: sl@0: RFileBuf iSink; sl@0: }; sl@0: // sl@0: class CFileStore; sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * A class containing a set of factory functions for opening an existing direct sl@0: file store and an existing permanent file store identified using a Uidtype. sl@0: */ sl@0: class FileStoreFactory sl@0: { sl@0: public: sl@0: IMPORT_C static CFileStore* DirectLC(RFileBuf& aBuf,const TUidType& aType); sl@0: IMPORT_C static CFileStore* PermanentLC(RFileBuf& aBuf,const TUidType& aType); sl@0: }; sl@0: // sl@0: const TInt KDirectFileStoreLayoutUidValue=268435511; sl@0: /** The value of the KPermanentFileStoreLayoutUidValue UID. */ sl@0: const TInt KPermanentFileStoreLayoutUidValue=268435536; sl@0: /** The UID that identifies a file store as being a direct file store. */ sl@0: const TUid KDirectFileStoreLayoutUid={KDirectFileStoreLayoutUidValue}; sl@0: /** The UID that identifies a file store as being a permanent file store. */ sl@0: const TUid KPermanentFileStoreLayoutUid={KPermanentFileStoreLayoutUidValue}; sl@0: // sl@0: typedef CFileStore* (*TFileStoreFactoryFunction)(RFileBuf& aBuf,const TUidType& aType); sl@0: // sl@0: #define KDirectFileStoreFactoryFunction (&FileStoreFactory::DirectLC) sl@0: #define KPermanentFileStoreFactoryFunction (&FileStoreFactory::PermanentLC) sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * File based persistent store abstract base class. sl@0: sl@0: The class encapsulates the basic behaviour of file based stores. File based sl@0: stores are persistent stores, i.e. they have the ability to keep the external sl@0: representation of objects for longer than the lifetime of the applications sl@0: which created those objects. sl@0: sl@0: The class forms the base for the direct file store, CDirectFileStore, and sl@0: the permanent file store, CPermanentFileStore. In general, it is sufficient sl@0: for pointers to file based store objects to be of type CFileStore, rather sl@0: than of the concrete file store type. sl@0: sl@0: Existing file stores can be opened using the member functions OpenL(), OpenLC(), sl@0: FromL() and FromLC(). New file stores, however, must be created using the sl@0: appropriate member function of the concrete type. sl@0: */ sl@0: class CFileStore : public CPersistentStore sl@0: { sl@0: public: sl@0: IMPORT_C static CFileStore* OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C static CFileStore* OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: IMPORT_C static CFileStore* FromL(RFile& aFile); sl@0: IMPORT_C static CFileStore* FromLC(RFile& aFile); sl@0: // sl@0: IMPORT_C static CFileStore* OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode,const TFileStoreFactoryFunction aFactory[]); sl@0: IMPORT_C static CFileStore* OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode,const TFileStoreFactoryFunction aFactory[]); sl@0: IMPORT_C static CFileStore* FromL(RFile& aFile,const TFileStoreFactoryFunction aFactory[]); sl@0: IMPORT_C static CFileStore* FromLC(RFile& aFile,const TFileStoreFactoryFunction aFactory[]); sl@0: // sl@0: inline const TUidType& Type() const; sl@0: IMPORT_C void SetTypeL(const TUidType& aType); sl@0: /** Gets the UID that uniquely identifies the specific type of this file store. sl@0: sl@0: This function must be defined and implemented by classes derived from CFileStore. sl@0: The direct file store, CDirectFileStore and the permanent file store, CPermanentFileStore sl@0: both implement suitable functions. sl@0: sl@0: @return The UID that uniquely identifies the specific type of file store. sl@0: @see KDirectFileStoreLayoutUid sl@0: @see KPermanentFileStoreLayoutUid */ sl@0: virtual TUid Layout() const=0; sl@0: // sl@0: inline void Reset(); sl@0: inline void Reset(TInt aSize); sl@0: inline void Detach(); sl@0: inline void Reattach(RFile& aFile); sl@0: inline RFile& File() const; sl@0: // sl@0: IMPORT_C void MarshalL(); sl@0: IMPORT_C ~CFileStore(); sl@0: protected: sl@0: typedef CFileStore* (*TNewFunction)(RFile& aFile); sl@0: protected: sl@0: IMPORT_C static CFileStore* OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode,TFileStoreFactoryFunction aFunction); sl@0: IMPORT_C static CFileStore* OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode,TFileStoreFactoryFunction aFunction); sl@0: IMPORT_C static CFileStore* CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode,TNewFunction aFunction); sl@0: IMPORT_C static CFileStore* CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode,TNewFunction aFunction); sl@0: IMPORT_C static CFileStore* ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode,TNewFunction aFunction); sl@0: IMPORT_C static CFileStore* ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode,TNewFunction aFunction); sl@0: IMPORT_C static CFileStore* TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode,TNewFunction aFunction); sl@0: IMPORT_C static CFileStore* TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode,TNewFunction aFunction); sl@0: // sl@0: IMPORT_C static CFileStore* FromL(RFile& aFile,TFileStoreFactoryFunction aFunction); sl@0: IMPORT_C static CFileStore* FromLC(RFile& aFile,TFileStoreFactoryFunction aFunction); sl@0: IMPORT_C static CFileStore* NewL(RFile& aFile,TNewFunction aFunction); sl@0: IMPORT_C static CFileStore* NewLC(RFile& aFile,TNewFunction aFunction); sl@0: // sl@0: IMPORT_C CFileStore(RFile& aFile); sl@0: IMPORT_C CFileStore(RFileBuf& aBuf,const TUidType& aType); sl@0: IMPORT_C void Destruct(); sl@0: // sl@0: inline TStreamExchange& Host() const; sl@0: inline TBool IsHost(const MStreamBuf* aBuf) const; sl@0: IMPORT_C void SynchL(); sl@0: inline void SetSizeL(TInt aSize); sl@0: IMPORT_C void ChangedL(); sl@0: IMPORT_C void RefreshL(); sl@0: // sl@0: IMPORT_C void DoCommitL(); sl@0: IMPORT_C void DoRevertL(); sl@0: private: sl@0: virtual void ExternalizeL(RWriteStream& aStream) const=0; sl@0: virtual void InternalizeL(RReadStream& aStream)=0; sl@0: // sl@0: static CFileStore* DoNewL(RFile& aFile,TNewFunction aFunction); sl@0: private: sl@0: RFileBuf iBuf; sl@0: TUidType iType; sl@0: __MUTABLE TStreamExchange iHost; sl@0: }; sl@0: const TInt KFileStoreStartOffset=sizeof(TCheckedUid); sl@0: #if defined(__NO_CLASS_CONSTS__) sl@0: #define KFileStoreStart TStreamPos(KFileStoreStartOffset) sl@0: #else sl@0: const TStreamPos KFileStoreStart=TStreamPos(KFileStoreStartOffset); sl@0: #endif sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * Direct file store. sl@0: sl@0: A direct file store implements a subset of the operations defined by the store sl@0: abstract framework. Direct file stores allow streams to be created and objects sl@0: externalised to them however once the streams have been committed and sl@0: closed, they cannot subsequently be changed, i.e. streams cannot be replaced, sl@0: deleted, extended or changed in any way. sl@0: */ sl@0: class CDirectFileStore : public CFileStore sl@0: { sl@0: public: sl@0: inline static CDirectFileStore* OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CDirectFileStore* OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CDirectFileStore* CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CDirectFileStore* CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CDirectFileStore* ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CDirectFileStore* ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CDirectFileStore* TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: inline static CDirectFileStore* TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: // sl@0: inline static CDirectFileStore* FromL(RFile& aFile); sl@0: inline static CDirectFileStore* FromLC(RFile& aFile); sl@0: inline static CDirectFileStore* NewL(RFile& aFile); sl@0: inline static CDirectFileStore* NewLC(RFile& aFile); sl@0: // sl@0: IMPORT_C TUid Layout() const; sl@0: // sl@0: IMPORT_C CDirectFileStore(RFile& aFile); sl@0: IMPORT_C CDirectFileStore(RFileBuf& aBuf,const TUidType& aType); sl@0: protected: sl@0: IMPORT_C MStreamBuf* DoReadL(TStreamId anId) const; sl@0: IMPORT_C MStreamBuf* DoCreateL(TStreamId& anId); sl@0: private: sl@0: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; sl@0: IMPORT_C void InternalizeL(RReadStream& aStream); sl@0: IMPORT_C void DoSetRootL(TStreamId anId); sl@0: // sl@0: IMPORT_C static CFileStore* DoNewL(RFile& aFile); sl@0: }; sl@0: // sl@0: class CPermanentStoreCoord; sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * Permanent file store. sl@0: sl@0: This type of store supports full manipulation of store contents. Existing sl@0: streams within this type of store can be changed. sl@0: */ sl@0: class CPermanentFileStore : public CFileStore sl@0: { sl@0: friend class RPermanentFileStoreIter; sl@0: public: sl@0: inline static CPermanentFileStore* OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CPermanentFileStore* OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CPermanentFileStore* CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CPermanentFileStore* CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CPermanentFileStore* ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CPermanentFileStore* ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline static CPermanentFileStore* TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: inline static CPermanentFileStore* TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: // sl@0: inline static CPermanentFileStore* FromL(RFile& aFile); sl@0: inline static CPermanentFileStore* FromLC(RFile& aFile); sl@0: inline static CPermanentFileStore* NewL(RFile& aFile); sl@0: inline static CPermanentFileStore* NewLC(RFile& aFile); sl@0: // sl@0: IMPORT_C TUid Layout() const; sl@0: // sl@0: IMPORT_C CPermanentFileStore(RFile& aFile); sl@0: IMPORT_C CPermanentFileStore(RFileBuf& aBuf,const TUidType& aType); sl@0: IMPORT_C void MarshalL(); sl@0: IMPORT_C ~CPermanentFileStore(); sl@0: protected: sl@0: IMPORT_C MStreamBuf* DoReadL(TStreamId anId) const; sl@0: IMPORT_C MStreamBuf* DoCreateL(TStreamId& anId); sl@0: IMPORT_C MStreamBuf* DoWriteL(TStreamId anId); sl@0: IMPORT_C MStreamBuf* DoReplaceL(TStreamId anId); sl@0: private: sl@0: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; sl@0: IMPORT_C void InternalizeL(RReadStream& aStream); sl@0: IMPORT_C void DoSetRootL(TStreamId anId); sl@0: IMPORT_C TStreamId DoExtendL(); sl@0: IMPORT_C void DoDeleteL(TStreamId anId); sl@0: IMPORT_C void DoCommitL(); sl@0: IMPORT_C void DoRevertL(); sl@0: IMPORT_C MIncrementalCollector* DoReclaimL(); sl@0: IMPORT_C MIncrementalCollector* DoCompactL(); sl@0: // sl@0: inline CPermanentStoreCoord& Coord() const; sl@0: CPermanentStoreCoord& CoordL() const; sl@0: CPermanentStoreCoord& TrimL(); sl@0: // sl@0: IMPORT_C static CFileStore* DoNewL(RFile& aFile); sl@0: private: sl@0: __MUTABLE CPermanentStoreCoord* iCoord; sl@0: }; sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * File based dictionary store. sl@0: sl@0: A dictionary store is a store where a stream is accessed by UID, rather than sl@0: directly by stream ID. A dictionary store contains streams in the usual way sl@0: but, in addition, the root stream is a stream dictionary, i.e. a CStreamDictionary sl@0: type. sl@0: */ sl@0: class CDictionaryFileStore : public CDictionaryStore sl@0: { sl@0: public: sl@0: IMPORT_C static CDictionaryFileStore* SystemL(RFs& aFs); sl@0: IMPORT_C static CDictionaryFileStore* SystemLC(RFs& aFs); sl@0: IMPORT_C static CDictionaryFileStore* OpenL(RFs& aFs,const TDesC& aName,TUid aUid3); sl@0: IMPORT_C static CDictionaryFileStore* OpenLC(RFs& aFs,const TDesC& aName,TUid aUid3); sl@0: private: sl@0: void ConstructL(RFs& aFs,const TDesC& aName,TUid aUid3); sl@0: void CreateStoreL(RFile& aFile,const TUidType& aType); sl@0: }; sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @released sl@0: * Uses a file directly to implement the page pool interface MPagePool. sl@0: sl@0: The pages are written sequentially through the file. You should call Close() sl@0: to release the file resource after CreateL(), OpenL(), ReplaceL() or Temp(). sl@0: sl@0: A file page pool uses a cache to store pages in-memory and to cache frequently sl@0: accessed pages. You should provide a cache object (CPageCache) to the pool sl@0: for this purpose. sl@0: sl@0: @see CPageCache sl@0: @see RFile sl@0: */ sl@0: class RFilePagePool : public TCachePagePool sl@0: { sl@0: public: sl@0: IMPORT_C RFilePagePool(); sl@0: IMPORT_C RFilePagePool(CPageCache& aCache); sl@0: // sl@0: inline TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode); sl@0: inline TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode); sl@0: inline void Attach(RFile& aFile); sl@0: IMPORT_C void Close(); sl@0: IMPORT_C void Release(); sl@0: IMPORT_C TInt Flush(); sl@0: IMPORT_C void FlushL(); sl@0: inline void Detach(); sl@0: // sl@0: inline RFile& File() const; sl@0: protected: sl@0: IMPORT_C TPageRef ExtendL(const TAny* aPage,TPageReclamation aReclamation); sl@0: IMPORT_C void WriteL(TPageRef aRef,const TAny* aPage,TPageChange aChange); sl@0: IMPORT_C void ReadL(TPageRef aRef,TAny* aPage); sl@0: private: sl@0: __MUTABLE RFile iFile; sl@0: }; sl@0: sl@0: #include sl@0: #endif