Location:
sb32file.h
Link against: estor.lib
RFilePagePool
Description
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.
Derivation
MPagePool | Interface to a page pool, the storage abstraction used by the B-trees API |
RFilePagePool | Uses a file directly to implement the page pool interface MPagePool |
TCachePagePool | Provides a page pool with cached pages |
|
Defined in RFilePagePool
:
Attach()
, Close()
, Create()
, Detach()
, Flush()
, FlushL()
, Open()
, RFilePagePool()
, Release()
, Replace()
, Temp()
Inherited from MPagePool
:
Delete()
,
DeleteL()
,
Pop()
,
PushL()
Inherited from TCachePagePool
:
AcquireL()
,
AllocL()
,
AssignL()
,
LockL()
,
Purge()
,
Set()
,
Unlock()
,
UpdateL()
See also:
RFilePagePool(CPageCache& aCache);
Description
Constructor with a page cache for the pool.
Parameters
CPageCache& aCache |
Page cache for the pool |
|
void Attach(RFile& aFile);
Description
Sets an existing file to be used for the page pool.
Parameters
RFile& aFile |
File to use for the page pool |
|
TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Creates a new file for the page pool.
Parameters
RFs& aFs |
A file server session |
const TDesC& aName |
The name of the file. Any path components which are not
specified here are taken from the session path. |
TUint aFileMode |
The mode in which the file is opened. For more information see
the TFileMode enumeration. |
|
Return value
TInt |
KErrNone if successful, otherwise another of the
system-wide error codes.
|
|
See also:
TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Opens a file to use for the page pool.
Parameters
RFs& aFs |
A file server session |
const TDesC& aName |
The name of the file |
TUint aFileMode |
The mode in which the file is opened. For more information, see the TFileMode enumeration.
|
|
Return value
TInt |
KErrNone if successful, otherwise another of the system-wide error codes.
|
|
See also:
TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
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.
Parameters
RFs& aFs |
A file server session. |
const TDesC& aName |
The name of the file. Any path components which are not
specified here are taken from the session path. |
TUint aFileMode |
The mode in which the file is opened. For more information see
the TFileMode enumeration. |
|
Return value
TInt |
KErrNone if successful, otherwise another of the
system-wide error codes.
|
|
See also:
TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);
Description
Creates and opens a file for the page pool with a unique name.
Parameters
RFs& aFs |
A file server session. |
const TDesC& aPath |
The directory in which the file should be created. |
TFileName& 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 . |
TUint aFileMode |
The mode in which the file is opened. For more information see
the TFileMode enumeration. |
|
Return value
TInt |
KErrNone if successful, otherwise another of the
system-wide error codes.
|
|
void Close();
Description
Flushes cached pages to the file, and closes the file.
void Detach();
Description
Ends the use of the file for the page pool, but does not close the file.
TInt Flush();
Description
Flushes the page cache and the file.
Return value
TInt |
KErrNone if successful, otherwise another of the system-wide error codes.
|
|
void FlushL();
Description
Flushes the page cache and the file, leaving with a system-wide error code if an error occurs.
void Release();
Description
Closes the file without flushing the cache.