#include <s32file.h>
class RFilePagePool : public TCachePagePool |
Public Member Functions | |
---|---|
RFilePagePool() | |
RFilePagePool(CPageCache &) | |
void | Attach(RFile &) |
IMPORT_C void | Close() |
TInt | Create(RFs &, const TDesC &, TUint) |
void | Detach() |
RFile & | File() |
IMPORT_C TInt | Flush() |
IMPORT_C void | FlushL() |
TInt | Open(RFs &, const TDesC &, TUint) |
IMPORT_C void | Release() |
TInt | Replace(RFs &, const TDesC &, TUint) |
TInt | Temp(RFs &, const TDesC &, TFileName &, TUint) |
Protected Member Functions | |
---|---|
virtual IMPORT_C TPageRef | ExtendL(const TAny *, TPageReclamation) |
virtual IMPORT_C void | ReadL(TPageRef, TAny *) |
virtual IMPORT_C void | WriteL(TPageRef, const TAny *, TPageChange) |
Uses a file directly to implement the page pool interface MPagePool.
The pages are written sequentially through the file. You should call Close() to release the file resource after CreateL(), OpenL(), ReplaceL() or Temp().
A file page pool uses a cache to store pages in-memory and to cache frequently accessed pages. You should provide a cache object (CPageCache) to the pool for this purpose.
See also: CPageCache RFile
IMPORT_C | RFilePagePool | ( | CPageCache & | aCache | ) |
Constructor with a page cache for the pool.
Parameter | Description |
---|---|
aCache | Page cache for the pool |
void | Attach | ( | RFile & | aFile | ) | [inline] |
Sets an existing file to be used for the page pool.
Parameter | Description |
---|---|
aFile | File to use for the page pool |
Creates a new file for the page pool.
See also: TFileMode
Parameter | Description |
---|---|
aFs | A file server session |
aName | The name of the file. Any path components which are not specified here are taken from the session path. |
aFileMode | The mode in which the file is opened. For more information see the TFileMode enumeration. |
Returns: KErrNone if successful, otherwise another of the system-wide error codes.
void | Detach | ( | ) | [inline] |
Ends the use of the file for the page pool, but does not close the file.
IMPORT_C TPageRef | ExtendL | ( | const TAny * | aPage, |
TPageReclamation | aReclamation | |||
) | [protected, virtual] |
Reimplemented from TCachePagePool::ExtendL(const TAny *,TPageReclamation)
IMPORT_C TInt | Flush | ( | ) |
Reimplemented from TCachePagePool::Flush()
Flushes the page cache and the file.
Returns: KErrNone if successful, otherwise another of the system-wide error codes.
IMPORT_C void | FlushL | ( | ) |
Reimplemented from TCachePagePool::FlushL()
Flushes the page cache and the file, leaving with a system-wide error code if an error occurs.
Opens a file to use for the page pool.
See also: TFileMode
Parameter | Description |
---|---|
aFs | A file server session |
aName | The name of the file |
aFileMode | The mode in which the file is opened. For more information, see the TFileMode enumeration. |
Returns: KErrNone if successful, otherwise another of the system-wide error codes.
Creates or opens a file for the page pool.
If there is an existing file with the same name, this function overwrites it. If the file does not already exist, it is created.
See also: TFileMode
Parameter | Description |
---|---|
aFs | A file server session. |
aName | The name of the file. Any path components which are not specified here are taken from the session path. |
aFileMode | The mode in which the file is opened. For more information see the TFileMode enumeration. |
Returns: KErrNone if successful, otherwise another of the system-wide error codes.
Creates and opens a file for the page pool with a unique name.
Parameter | Description |
---|---|
aFs | A file server session. |
aPath | The directory in which the file should be created. |
aName | On return, contains the full path and name of the file. The filename is guaranteed to be unique within the directory specified by aPath. |
aFileMode | The mode in which the file is opened. For more information see the TFileMode enumeration. |
Returns: KErrNone if successful, otherwise another of the system-wide error codes.
IMPORT_C void | WriteL | ( | TPageRef | aRef, |
const TAny * | aPage, | |||
TPageChange | aChange | |||
) | [protected, virtual] |
Reimplemented from TCachePagePool::WriteL(TPageRef,const TAny *,TPageChange)