Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Direct file store

The main characteristic of a direct file store is that streams can be created and objects externalised to them but, once the streams have been committed and closed, they cannot subsequently be changed, i.e. streams cannot be replaced, deleted, extended or changed in any way.

A direct file store is useful for the type of application which treats the in-memory copy of its data as its prime copy, such as a word processor which implements the classic load/save paradigm. In this paradigm:

With a direct file store, a stream may not be appended once it has been written and closed. Writing to different streams may not be interleaved. The root stream must be the last stream to be written. The direct file store is very efficient as the allocation of new streams, and finding existing streams, are trivially mapped onto the most efficient operations of the underlying file system.

For this type of application, the most efficient file format is obtained when all the data is written in sequence to the file. Any references within the file are to data which was written earlier. When reading the file back, it is read in several sections starting with a section that is at the end of the file.

A typical relationship between a direct file store and its contained streams is shown below. In this stream network streams I and J must be written before stream A; stream K must be written before stream C; streams A,B and C must be written before the root stream.

Direct file stores are encapsulated by the CDirectFileStore class.


See also

Store streams

Introduction to stores

Swizzles and deferred loading