»
Symbian OS v6.1 Edition for C++ »
API Reference »
File Stores »
CPermanentFileStore
Location:
s32file.h
Link against: estor.lib
Class CPermanentFileStore
CPermanentFileStore
Support
Supported from 5.0
Description
Permanent file store.
This type of store supports full manipulation of store contents.
Existing streams within this type of store can be changed.
Derivation
CBase | Base class for all classes to be instantiated on the heap |
CFileStore | File based persistent store -- abstract base class |
CPermanentFileStore | Permanent file store |
CPersistentStore | Persistent store abstract base class |
CStreamStore | Provides the core abstract framework for stores allowing streams to be created and manipulated |
|
Defined in CPermanentFileStore
:
CreateL()
, CreateLC()
, FromL()
, FromLC()
, Layout()
, NewL()
, NewLC()
, OpenL()
, OpenLC()
, ReplaceL()
, ReplaceLC()
, TempL()
, TempLC()
, ~CPermanentFileStore()
Inherited from CBase
:
operator new()
Inherited from CFileStore
:
Detach()
,
File()
,
Reattach()
,
Reset()
,
SetTypeL()
,
Type()
Inherited from CPersistentStore
:
Root()
,
SetRootL()
Inherited from CStreamStore
:
Commit()
,
CommitL()
,
CompactL()
,
Delete()
,
DeleteL()
,
DoCommitL()
,
DoCompactL()
,
DoCreateL()
,
DoDeleteL()
,
DoReadL()
,
DoReclaimL()
,
DoReplaceL()
,
DoRevertL()
,
DoWriteL()
,
ExtendL()
,
ReclaimL()
,
Revert()
,
RevertL()
Allocation, construction and destruction
static CPermanentFileStore* NewL(RFile& aFile);
Description
Constructs a new permanent file store object in an already
opened file.
The file must already be open before calling this function. The
existing content of the file is discarded.
Note that ownership of the file passes to the store. The
referenced RFile
is cleared and is no longer valid.
Parameters
RFile& aFile |
A reference to the opened file. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the function leaves, the file is closed. |
|
static CPermanentFileStore* NewLC(RFile& aFile);
Description
Constructs a new permanent file store object in an already
opened file and places the pointer onto the cleanup stack.
The file must already be open before calling this function.The
existing content of the file is discarded.
Note that ownership of the file passes to the store. The
referenced RFile
is cleared and is no longer valid.
Parameters
RFile& aFile |
A reference to the opened file. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the function leaves, the file is closed. |
|
static CPermanentFileStore* CreateL(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Creates a new file and constructs a new permanent file store
object to be associated with this file.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aName |
The full path name of the new file. A file with this name must
not already exist, otherwise the function leaves. |
TUint aFileMode |
The mode in which the new file is to be accessed. This mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the new file has been successfully created, and a leave
occurs, the file is closed but not deleted. |
|
See also:
static CPermanentFileStore* CreateLC(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Creates a new file and constructs a new permanent file store
object to be associated with this file, and places the pointer onto the cleanup
stack.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aName |
The full path name of the new file. A file with this name must
not already exist, otherwise the function leaves. |
TUint aFileMode |
The mode in which the new file is to be accessed. This mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the new file has been successfully created, and a leave
occurs, the file is closed but not deleted. |
|
See also:
static CPermanentFileStore* FromL(RFile& aFile);
Description
Constructs a permanent file store object from an already opened
file.
The file must already be open before calling this
function.
Note that ownership of the file passes to the store. The
referenced RFile
is cleared and is no longer valid.
Parameters
RFile& aFile |
A reference to the opened file. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
The function must contain a permanent file store, otherwise
the function leaves. If the function leaves, the file is closed. |
|
static CPermanentFileStore* FromLC(RFile& aFile);
Description
Constructs a permanent file store object from an already opened
file, and places the pointer onto the cleanup stack.
The file must already be open before calling this
function.
Note that ownership of the file passes to the store. The
referenced RFile
is cleared and is no longer
valid.
Parameters
RFile& aFile |
A reference to the opened file. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
The function must contain a permanent file store, otherwise
the function leaves. If the function leaves, the file is closed. |
|
static CPermanentFileStore* OpenL(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Opens a file containing a permanent file store, and constructs
a permanent file store object.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aName |
The full path name of the file containing the store. |
TUint aFileMode |
The mode in which the file is to be accessed. The mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
The file must contain a permanent file store, otherwise the
function leaves. If the function leaves, the file is closed. |
|
See also:
static CPermanentFileStore* OpenLC(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Opens a file containing a permanent file store, constructs a
permanent file store object, and places the pointer onto the cleanup
stack.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aName |
The full path name of the file containing the store. |
TUint aFileMode |
The mode in which the file is to be accessed. The mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
The file must contain a permanent file store, otherwise the
function leaves. If the function leaves, the file is closed. |
|
See also:
static CPermanentFileStore* ReplaceL(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Creates a file, constructs a permanent file store object to be
associated with it.
This file replaces any existing file of the same name.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aName |
The full path name of the file to be replaced. |
TUint aFileMode |
The mode in which the file is to be accessed. The mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the function leaves, the file is closed. |
|
See also:
static CPermanentFileStore* ReplaceLC(RFs& aFs,const TDesC& aName,TUint aFileMode);
Description
Creates a file, constructs a permanent file store object to be
associated with it, and places the pointer onto the cleanup stack.
This file replaces any existing file of the same name.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aName |
The full path name of the file to be replaced. |
TUint aFileMode |
The mode in which the file is to be accessed. The mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the function leaves, the file is closed. |
|
See also:
static CPermanentFileStore* TempL(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);
Description
Creates a temporary file and constructs a permanent file store
object to be associated with it.
The new file is created in the specified path and a unique file
name is generated by the file server.
Note that the store framework does not delete a temporary file
after it is closed.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aPath |
The path where the new file is to be created. |
TFileName& aName |
On return, contains the full path name of the new file. |
TUint aFileMode |
The mode in which the file is to be accessed. The mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the new file has been successfully created, and a leave
occurs, the file is closed but is not deleted. |
|
See also:
static CPermanentFileStore* TempLC(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);
Description
Creates a temporary file, constructs a permanent file store
object to be associated with it, and places the pointer onto the cleanup
stack.
The new file is created in the specified path and a unique file
name is generated by the file server.
Note that the store framework does not delete a temporary file
after it is closed.
Parameters
RFs& aFs |
Handle to a file server session. |
const TDesC& aPath |
The path where the new file is to be created. |
TFileName& aName |
On return, contains the full path name of the new file. |
TUint aFileMode |
The mode in which the file is to be accessed. The mode is
defined by the TFileMode type. |
|
Return value
CPermanentFileStore* |
A pointer to the new permanent file store object. |
|
Leave codes
|
If the new file has been successfully created, and a leave
occurs, the file is closed but is not deleted. |
|
See also:
~CPermanentFileStore();
Description
Frees resources owned by the object, prior to its
destruction.
TUid Layout() const;
Description
Gets the UID that uniquely identifies this file store as a
permanent file store.
Return value
TUid |
KPermanentFileStoreLayoutUid .
|
|