class CFileStore : public CPersistentStore |
File based persistent store abstract base class.
The class encapsulates the basic behaviour of file based stores. File based stores are persistent stores, i.e. they have the ability to keep the external representation of objects for longer than the lifetime of the applications which created those objects.
The class forms the base for the direct file store, CDirectFileStore, and the permanent file store, CPermanentFileStore. In general, it is sufficient for pointers to file based store objects to be of type CFileStore, rather than of the concrete file store type.
Existing file stores can be opened using the member functions OpenL(), OpenLC(), FromL() and FromLC(). New file stores, however, must be created using the appropriate member function of the concrete type.
Public Member Functions | |
---|---|
~CFileStore() | |
RFile & | File() |
IMPORT_C CFileStore * | FromLC(RFile &) |
IMPORT_C CFileStore * | FromLC(RFile &, const TFileStoreFactoryFunction) |
TUid | Layout() |
IMPORT_C void | MarshalL() |
IMPORT_C CFileStore * | OpenL(RFs &, const TDesC &, TUint) |
IMPORT_C CFileStore * | OpenL(RFs &, const TDesC &, TUint, const TFileStoreFactoryFunction) |
IMPORT_C CFileStore * | OpenLC(RFs &, const TDesC &, TUint) |
IMPORT_C CFileStore * | OpenLC(RFs &, const TDesC &, TUint, const TFileStoreFactoryFunction) |
void | Reattach(RFile &) |
void | Reset() |
void | Reset(TInt) |
IMPORT_C void | SetTypeL(const TUidType &) |
const TUidType & | Type() |
Private Member Functions | |
---|---|
CFileStore * | DoNewL(RFile &, TNewFunction) |
void | ExternalizeL(RWriteStream &) |
void | InternalizeL(RReadStream &) |
Protected Member Type Definitions | |
---|---|
typedef | CFileStore *(* TNewFunction |
Private Attributes | |
---|---|
RFileBuf | iBuf |
__MUTABLE TStreamExchange | iHost |
TUidType | iType |
Inherited Attributes | |
---|---|
CPersistentStore::iRoot |
IMPORT_C | ~CFileStore | ( | ) |
Frees resources owned by the object, prior to its destruction. In particular, it closes the associated file.
IMPORT_C CFileStore * | CreateLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
TNewFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
TNewFunction aFunction |
IMPORT_C void | DoCommitL | ( | ) | [protected, virtual] |
Commits any changes to the store. For a store that provides atomic updates, this writes all of the pending updates to the to the permanent storage medium. After committing the store contains all or none of the updates since the last commit/revert.
This function provides the implementation for the public CommitL() function.
CFileStore * | DoNewL | ( | RFile & | aFile, |
TNewFunction | aFunction | |||
) | [private, static] |
RFile & aFile | |
TNewFunction aFunction |
IMPORT_C void | DoRevertL | ( | ) | [protected, virtual] |
Discards any pending changes to the store. This includes all changes which have not been committed to a permanent storage medium.
This function provides the implementation for the public Revert() function.
Note:
The function need only be implemented by stores that provide atomic updates, as revert has no meaning for other implementations.
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [private, pure virtual] |
RWriteStream & aStream |
IMPORT_C CFileStore * | FromL | ( | RFile & | aFile, |
TFileStoreFactoryFunction | aFunction | |||
) | [protected, static] |
RFile & aFile | |
TFileStoreFactoryFunction aFunction |
IMPORT_C CFileStore * | FromLC | ( | RFile & | aFile | ) | [static] |
Constructs a file store object from an opened file, and places the pointer onto the cleanup stack.
The file must already be open before calling this function.
The resulting file store object is of concrete type, i.e. either CDirectFileStore or CPermanentFileStore. The specific type is determined from the layout information held in the file store.
Note that ownership of the file passes to the store. The referenced RFile is cleared and is no longer valid:
RFile & aFile | A reference to the opened file. |
IMPORT_C CFileStore * | FromLC | ( | RFile & | aFile, |
const TFileStoreFactoryFunction | aFactory | |||
) | [static] |
RFile & aFile | |
const TFileStoreFactoryFunction aFactory |
IMPORT_C CFileStore * | FromLC | ( | RFile & | aFile, |
TFileStoreFactoryFunction | aFunction | |||
) | [protected, static] |
RFile & aFile | |
TFileStoreFactoryFunction aFunction |
void | InternalizeL | ( | RReadStream & | aStream | ) | [private, pure virtual] |
RReadStream & aStream |
TBool | IsHost | ( | const MStreamBuf * | aBuf | ) | const [protected, inline] |
const MStreamBuf * aBuf |
TUid | Layout | ( | ) | const [pure virtual] |
Gets the UID that uniquely identifies the specific type of this file store.
This function must be defined and implemented by classes derived from CFileStore. The direct file store, CDirectFileStore and the permanent file store, CPermanentFileStore both implement suitable functions.
IMPORT_C CFileStore * | NewL | ( | RFile & | aFile, |
TNewFunction | aFunction | |||
) | [protected, static] |
RFile & aFile | |
TNewFunction aFunction |
IMPORT_C CFileStore * | NewLC | ( | RFile & | aFile, |
TNewFunction | aFunction | |||
) | [protected, static] |
RFile & aFile | |
TNewFunction aFunction |
IMPORT_C CFileStore * | OpenL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static] |
Opens a file containing a store and constructs an appropriate file store object.
The resulting file store object is of concrete type, i.e. either CDirectFileStore or CPermanentFileStore. The specific type is determined from the layout information held in the file store.
IMPORT_C CFileStore * | OpenL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
const TFileStoreFactoryFunction | aFactory | |||
) | [static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
const TFileStoreFactoryFunction aFactory |
IMPORT_C CFileStore * | OpenL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
TFileStoreFactoryFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
TFileStoreFactoryFunction aFunction |
IMPORT_C CFileStore * | OpenLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode | |||
) | [static] |
Opens a file containing a store, constructs an appropriate file store object and places the pointer onto the cleanup stack.
The resulting file store object is of concrete type, i.e. either CDirectFileStore or CPermanentFileStore. The specific type is determined from the layout information held in the file store.
IMPORT_C CFileStore * | OpenLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
const TFileStoreFactoryFunction | aFactory | |||
) | [static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
const TFileStoreFactoryFunction aFactory |
IMPORT_C CFileStore * | OpenLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
TFileStoreFactoryFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
TFileStoreFactoryFunction aFunction |
void | Reattach | ( | RFile & | aFile | ) | [inline] |
RFile & aFile | The file to be associated with this file store. |
IMPORT_C CFileStore * | ReplaceL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
TNewFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
TNewFunction aFunction |
IMPORT_C CFileStore * | ReplaceLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
TNewFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
TNewFunction aFunction |
void | Reset | ( | ) | [inline] |
IMPORT_C void | SetTypeL | ( | const TUidType & | aType | ) |
const TUidType & aType |
IMPORT_C CFileStore * | TempL | ( | RFs & | aFs, |
const TDesC & | aPath, | |||
TFileName & | aName, | |||
TUint | aFileMode, | |||
TNewFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aPath | |
TFileName & aName | |
TUint aFileMode | |
TNewFunction aFunction |
IMPORT_C CFileStore * | TempLC | ( | RFs & | aFs, |
const TDesC & | aPath, | |||
TFileName & | aName, | |||
TUint | aFileMode, | |||
TNewFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aPath | |
TFileName & aName | |
TUint aFileMode | |
TNewFunction aFunction |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.