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() | |
void | Detach() |
RFile & | File() |
IMPORT_C CFileStore * | FromL(RFile &) |
IMPORT_C CFileStore * | FromL(RFile &, const TFileStoreFactoryFunction) |
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 | ( | RFileBuf & | aBuf, |
const TUidType & | aType | |||
) | [protected] |
IMPORT_C CFileStore * | CreateL | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
TNewFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
TNewFunction aFunction |
IMPORT_C CFileStore * | CreateLC | ( | RFs & | aFs, |
const TDesC & | aName, | |||
TUint | aFileMode, | |||
TNewFunction | aFunction | |||
) | [protected, static] |
RFs & aFs | |
const TDesC & aName | |
TUint aFileMode | |
TNewFunction aFunction |
void | Detach | ( | ) | [inline] |
Detaches the file store from its associated file.
In effect, the file store gives up ownership of the file.
Detaching is useful in cases where a file needs to be closed and later re-opened; for example, to give up a write lock for backup purposes.
It is very important that the contents of the file should not change while it is detached.
CFileStore * | DoNewL | ( | RFile & | aFile, |
TNewFunction | aFunction | |||
) | [private, static] |
RFile & aFile | |
TNewFunction aFunction |
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [private, pure virtual] |
RWriteStream & aStream |
RFile & | File | ( | ) | const [inline] |
Gets a reference to the file associated with this file store.
This function is called prior to detaching the file store.
A reference to the associated file.
IMPORT_C CFileStore * | FromL | ( | RFile & | aFile, |
const TFileStoreFactoryFunction | aFactory | |||
) | [static] |
RFile & aFile | |
const TFileStoreFactoryFunction aFactory |
IMPORT_C CFileStore * | FromL | ( | RFile & | aFile, |
TFileStoreFactoryFunction | aFunction | |||
) | [protected, static] |
RFile & aFile | |
TFileStoreFactoryFunction aFunction |
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.
The UID that uniquely identifies the specific type of file store.
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] |
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] |
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] |
void | Reset | ( | TInt | aSize | ) | [inline] |
TInt aSize | The size of future buffer space allocations. |
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 |