williamr@2: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: // Class RFileBuf williamr@2: inline void RFileBuf::Reset(TInt aSize) williamr@2: /** Frees the intermediate buffer and changes the size of any future intermediate williamr@2: buffer to the specified value. williamr@2: williamr@2: The intermediate buffer must not contain any outstanding write data, otherwise williamr@2: the function raises a STORE-File 6 panic. williamr@2: williamr@2: @param aSize The size of any future intermediate buffer. */ williamr@2: {Reset();iSize=aSize;} williamr@2: inline void RFileBuf::Detach() williamr@2: /** Detaches the file from this stream buffer. williamr@2: williamr@2: The intermediate buffer's read and write marks are not changed, and the stream williamr@2: positions are not changed. This means that the contents of the file should williamr@2: not change while it is detached. williamr@2: williamr@2: @see Attach() williamr@2: @see Reattach() */ williamr@2: {iFile=RFile();} williamr@2: inline void RFileBuf::Reattach(RFile& aFile) williamr@2: /** Re-attaches the specified file to this stream buffer. williamr@2: williamr@2: The intermediate buffer's read and write marks are not changed, and the stream williamr@2: positions are not changed. williamr@2: williamr@2: The file should be the one that was detached using the Detach() function. williamr@2: williamr@2: @param aFile The file to be re-attached. williamr@2: @see Attach() williamr@2: @see Detach() */ williamr@2: {iFile=aFile;} williamr@2: inline RFile& RFileBuf::File() const williamr@2: /** Gets a reference to the file attached to this stream buffer. williamr@2: williamr@2: @return The file attached to this stream buffer. */ williamr@2: {return MUTABLE_CAST(RFile&,iFile);} williamr@2: williamr@2: // Class RFileWriteStream williamr@2: inline RFileWriteStream::RFileWriteStream(const MExternalizer& anExter) williamr@2: : RWriteStream(anExter) williamr@2: {} williamr@2: williamr@2: // Class CFileStore williamr@2: inline const TUidType& CFileStore::Type() const williamr@2: /** Gets the UID type of the file store. williamr@2: williamr@2: @return The UID type object containing the file store type. williamr@2: @see TUid */ williamr@2: {return iType;} williamr@2: inline void CFileStore::Reset() williamr@2: /** Frees the file store’s buffer space. williamr@2: williamr@2: The buffer space is automatically re-allocated when needed. williamr@2: williamr@2: This function should only be used immediately after a successful call to CommitL() williamr@2: or RevertL(). williamr@2: williamr@2: @see CStreamStore::CommitL() williamr@2: @see CStreamStore::RevertL() */ williamr@2: {iBuf.Reset();} williamr@2: inline void CFileStore::Reset(TInt aSize) williamr@2: /** Frees the file store’s buffer space and changes the size of future buffer williamr@2: space allocations. williamr@2: williamr@2: The buffer space is automatically re-allocated when needed, using the new williamr@2: size value. williamr@2: williamr@2: This function should only be used immediately after a successful call to CommitL() williamr@2: or RevertL(). williamr@2: williamr@2: @param aSize The size of future buffer space allocations. williamr@2: @see CStreamStore::CommitL() williamr@2: @see CStreamStore::RevertL() */ williamr@2: {iBuf.Reset(aSize);} williamr@2: inline void CFileStore::Detach() williamr@2: /** Detaches the file store from its associated file. williamr@2: williamr@2: In effect, the file store gives up ownership of the file. williamr@2: williamr@2: Detaching is useful in cases where a file needs to be closed and later re-opened; williamr@2: for example, to give up a write lock for backup purposes. williamr@2: williamr@2: It is very important that the contents of the file should not change while williamr@2: it is detached. williamr@2: williamr@2: @see File() williamr@2: @see Reattach() */ williamr@2: {iBuf.Detach();} williamr@2: inline void CFileStore::Reattach(RFile& aFile) williamr@2: /** Reattaches a file to the file store. The file should be the one that was detached williamr@2: using the Detach() function. williamr@2: williamr@2: @param aFile The file to be associated with this file store. williamr@2: @see File() */ williamr@2: {iBuf.Reattach(aFile);} williamr@2: inline RFile& CFileStore::File() const williamr@2: /** Gets a reference to the file associated with this file store. williamr@2: williamr@2: This function is called prior to detaching the file store. williamr@2: williamr@2: @return A reference to the associated file. williamr@2: @see Detach() */ williamr@2: {return iBuf.File();} williamr@2: inline TStreamExchange& CFileStore::Host() const williamr@2: {return MUTABLE_CAST(TStreamExchange&,iHost);} williamr@2: inline TBool CFileStore::IsHost(const MStreamBuf* aBuf) const williamr@2: {return aBuf==&iBuf;} williamr@2: inline void CFileStore::SetSizeL(TInt aSize) williamr@2: {iBuf.SetSizeL(aSize);} williamr@2: williamr@2: // Class CDirectFileStore williamr@2: inline CDirectFileStore* CDirectFileStore::OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Opens a file containing a direct file store, and constructs a direct file store williamr@2: object. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file containing the store. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::OpenL(aFs,aName,aFileMode,KDirectFileStoreFactoryFunction));} williamr@2: inline CDirectFileStore* CDirectFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Opens a file containing a direct file store, constructs a direct file store williamr@2: object, and places the pointer onto the cleanup stack. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file containing the store. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::OpenLC(aFs,aName,aFileMode,KDirectFileStoreFactoryFunction));} williamr@2: inline CDirectFileStore* CDirectFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a new file and constructs a new direct file store object to be associated williamr@2: with this file. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the new file. A file with this name must williamr@2: not already exist, otherwise the function leaves. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::CreateL(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CDirectFileStore* CDirectFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a new file and constructs a new direct file store object to be associated williamr@2: with this file, and places the pointer onto the cleanup stack. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the new file. A file with this name must williamr@2: not already exist, otherwise the function leaves. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::CreateLC(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CDirectFileStore* CDirectFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a file and constructs a direct file store object to be associated with williamr@2: it. williamr@2: williamr@2: The file replaces any existing file of the same name. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file to be replaced. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::ReplaceL(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CDirectFileStore* CDirectFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a file, constructs a direct file store object to be associated with williamr@2: it, and places the pointer onto the cleanup stack. williamr@2: williamr@2: The file replaces any existing file of the same name. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file to be replaced. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::ReplaceLC(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CDirectFileStore* CDirectFileStore::TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) williamr@2: /** Creates a temporary file and constructs a direct file store object to be associated williamr@2: with it. williamr@2: williamr@2: The new file is created in the specified path and a unique file name is generated williamr@2: by the file server. williamr@2: williamr@2: Note that the store framework does not delete a temporary file after it is williamr@2: closed. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aPath The path where the new file is to be created. williamr@2: @param aName On return, contains the full path name of the new file. williamr@2: @param aFileMode The mode in which the new file is to be accessed. The mode williamr@2: is defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode,&DoNewL));} williamr@2: inline CDirectFileStore* CDirectFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) williamr@2: /** Creates a temporary file, constructs a direct file store object to be associated williamr@2: with it, and places the pointer onto the cleanup stack. williamr@2: williamr@2: The new file is created in the specified path and a unique file name is generated williamr@2: by the file server. williamr@2: williamr@2: Note that the store framework does not delete a temporary file after it is williamr@2: closed. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aPath The path where the new file is to be created. williamr@2: @param aName On return, contains the full path name of the new file. williamr@2: @param aFileMode The mode in which the new file is to be accessed. The mode williamr@2: is defined by the TFileMode type. williamr@2: @return A pointer to the new direct file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::TempLC(aFs,aPath,aName,aFileMode,&DoNewL));} williamr@2: inline CDirectFileStore* CDirectFileStore::FromL(RFile& aFile) williamr@2: /** Constructs a direct file store object from an already opened file. williamr@2: williamr@2: The file must already be open before calling this function. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid. williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new direct file store object. */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::FromL(aFile,KDirectFileStoreFactoryFunction));} williamr@2: inline CDirectFileStore* CDirectFileStore::FromLC(RFile& aFile) williamr@2: /** Constructs a direct file store object from an already opened file, and places williamr@2: the pointer onto the cleanup stack. williamr@2: williamr@2: The file must already be open before calling this function. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid. williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new direct file store object. */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::FromLC(aFile,KDirectFileStoreFactoryFunction));} williamr@2: inline CDirectFileStore* CDirectFileStore::NewL(RFile& aFile) williamr@2: /** Constructs a new direct file store object in an already opened file. williamr@2: williamr@2: The file must already be open before calling the function. The existing content williamr@2: of the file is discarded. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid: williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new direct file store object. */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::NewL(aFile,&DoNewL));} williamr@2: inline CDirectFileStore* CDirectFileStore::NewLC(RFile& aFile) williamr@2: /** Constructs a new direct file store object in an already opened file and places williamr@2: the pointer onto the cleanup stack. williamr@2: williamr@2: The file must already be open before calling the function. The existing content williamr@2: of the file is discarded. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid: williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new direct file store object. */ williamr@2: {return STATIC_CAST(CDirectFileStore*,CFileStore::NewLC(aFile,&DoNewL));} williamr@2: williamr@2: // Class CPermanentFileStore williamr@2: inline CPermanentFileStore* CPermanentFileStore::OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Opens a file containing a permanent file store, and constructs a permanent williamr@2: file store object. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file containing the store. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenL(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Opens a file containing a permanent file store, constructs a permanent file williamr@2: store object, and places the pointer onto the cleanup stack. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file containing the store. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::OpenLC(aFs,aName,aFileMode,KPermanentFileStoreFactoryFunction));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a new file and constructs a new permanent file store object to be associated williamr@2: with this file. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the new file. A file with this name must williamr@2: not already exist, otherwise the function leaves. williamr@2: @param aFileMode The mode in which the new file is to be accessed. This mode williamr@2: is defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateL(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a new file and constructs a new permanent file store object to be associated williamr@2: with this file, and places the pointer onto the cleanup stack. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the new file. A file with this name must williamr@2: not already exist, otherwise the function leaves. williamr@2: @param aFileMode The mode in which the new file is to be accessed. This mode williamr@2: is defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::CreateLC(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a file, constructs a permanent file store object to be associated with williamr@2: it. williamr@2: williamr@2: This file replaces any existing file of the same name. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file to be replaced. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceL(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a file, constructs a permanent file store object to be associated with williamr@2: it, and places the pointer onto the cleanup stack. williamr@2: williamr@2: This file replaces any existing file of the same name. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aName The full path name of the file to be replaced. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::ReplaceLC(aFs,aName,aFileMode,&DoNewL));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) williamr@2: /** Creates a temporary file and constructs a permanent file store object to be williamr@2: associated with it. williamr@2: williamr@2: The new file is created in the specified path and a unique file name is generated williamr@2: by the file server. williamr@2: williamr@2: Note that the store framework does not delete a temporary file after it is williamr@2: closed. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aPath The path where the new file is to be created. williamr@2: @param aName On return, contains the full path name of the new file. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::TempL(aFs,aPath,aName,aFileMode,&DoNewL));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) williamr@2: /** Creates a temporary file, constructs a permanent file store object to be associated williamr@2: with it, and places the pointer onto the cleanup stack. williamr@2: williamr@2: The new file is created in the specified path and a unique file name is generated williamr@2: by the file server. williamr@2: williamr@2: Note that the store framework does not delete a temporary file after it is williamr@2: closed. williamr@2: williamr@2: @param aFs Handle to a file server session. williamr@2: @param aPath The path where the new file is to be created. williamr@2: @param aName On return, contains the full path name of the new file. williamr@2: @param aFileMode The mode in which the file is to be accessed. The mode is williamr@2: defined by the TFileMode type. williamr@2: @return A pointer to the new permanent file store object. williamr@2: @see TFileMode */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::TempLC(aFs,aPath,aName,aFileMode,&DoNewL));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::FromL(RFile& aFile) williamr@2: /** Constructs a permanent file store object from an already opened file. williamr@2: williamr@2: The file must already be open before calling this function. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid. williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new permanent file store object. */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::FromL(aFile,KPermanentFileStoreFactoryFunction));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::FromLC(RFile& aFile) williamr@2: /** Constructs a permanent file store object from an already opened file, and places williamr@2: the pointer onto the cleanup stack. williamr@2: williamr@2: The file must already be open before calling this function. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid. williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new permanent file store object. */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::FromLC(aFile,KPermanentFileStoreFactoryFunction));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::NewL(RFile& aFile) williamr@2: /** Constructs a new permanent file store object in an already opened file. williamr@2: williamr@2: The file must already be open before calling this function. The existing content williamr@2: of the file is discarded. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid. williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new permanent file store object. */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::NewL(aFile,&DoNewL));} williamr@2: inline CPermanentFileStore* CPermanentFileStore::NewLC(RFile& aFile) williamr@2: /** Constructs a new permanent file store object in an already opened file and williamr@2: places the pointer onto the cleanup stack. williamr@2: williamr@2: The file must already be open before calling this function.The existing content williamr@2: of the file is discarded. williamr@2: williamr@2: Note that ownership of the file passes to the store. The referenced RFile williamr@2: is cleared and is no longer valid. williamr@2: williamr@2: @param aFile A reference to the opened file. williamr@2: @return A pointer to the new permanent file store object. */ williamr@2: {return STATIC_CAST(CPermanentFileStore*,CFileStore::NewLC(aFile,&DoNewL));} williamr@2: williamr@2: // Class RFilePagePool williamr@2: inline TInt RFilePagePool::Open(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Opens a file to use for the page pool. williamr@2: williamr@2: @param aFs A file server session williamr@2: @param aName The name of the file williamr@2: @param aFileMode The mode in which the file is opened. For more information, williamr@2: see the TFileMode enumeration. williamr@2: @return KErrNone if successful, otherwise another of the system-wide error williamr@2: codes. williamr@2: @see TFileMode */ williamr@2: {return iFile.Open(aFs,aName,aFileMode);} williamr@2: inline TInt RFilePagePool::Create(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates a new file for the page pool. williamr@2: williamr@2: @param aFs A file server session williamr@2: @param aName The name of the file. Any path components which are not specified williamr@2: here are taken from the session path. williamr@2: @param aFileMode The mode in which the file is opened. For more information williamr@2: see the TFileMode enumeration. williamr@2: @return KErrNone if successful, otherwise another of the system-wide error williamr@2: codes. williamr@2: @see TFileMode */ williamr@2: {return iFile.Create(aFs,aName,aFileMode);} williamr@2: inline TInt RFilePagePool::Replace(RFs& aFs,const TDesC& aName,TUint aFileMode) williamr@2: /** Creates or opens a file for the page pool. williamr@2: williamr@2: If there is an existing file with the same name, this function overwrites williamr@2: it. If the file does not already exist, it is created. williamr@2: williamr@2: @param aFs A file server session. williamr@2: @param aName The name of the file. Any path components which are not specified williamr@2: here are taken from the session path. williamr@2: @param aFileMode The mode in which the file is opened. For more information williamr@2: see the TFileMode enumeration. williamr@2: @return KErrNone if successful, otherwise another of the system-wide error williamr@2: codes. williamr@2: @see TFileMode */ williamr@2: {return iFile.Replace(aFs,aName,aFileMode);} williamr@2: inline TInt RFilePagePool::Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode) williamr@2: /** Creates and opens a file for the page pool with a unique name. williamr@2: williamr@2: @param aFs A file server session. williamr@2: @param aPath The directory in which the file should be created. williamr@2: @param aName On return, contains the full path and name of the file. The filename williamr@2: is guaranteed to be unique within the directory specified by aPath. williamr@2: @param aFileMode The mode in which the file is opened. For more information williamr@2: see the TFileMode enumeration. williamr@2: @return KErrNone if successful, otherwise another of the system-wide error williamr@2: codes. */ williamr@2: {return iFile.Temp(aFs,aPath,aName,aFileMode);} williamr@2: inline void RFilePagePool::Attach(RFile& aFile) williamr@2: /** Sets an existing file to be used for the page pool. williamr@2: williamr@2: @param aFile File to use for the page pool */ williamr@2: {iFile=aFile;} williamr@2: inline void RFilePagePool::Detach() williamr@2: /** Ends the use of the file for the page pool, but does not close the file. */ williamr@2: {iFile=RFile();} williamr@2: inline RFile& RFilePagePool::File() const williamr@2: {return MUTABLE_CAST(RFile&,iFile);}