File Stores Overview

Provides a summary of APIs related to the File Store and their uses.

Purpose

Provides file-based structured data storage, using networks of streams.

Architectural relationships

The File Stores API is based on the abstract store types defined by the Stores API. The underlying file handling is provided by the File Server.

The permanent file stores defined in this API are used by the relational database API, DBMS, for data storage.

Description

The API has five key concepts: file store base (CFileStore), direct file store (CDirectFileStore), permanent file store (CPermanentFileStore), dictionary file store (CDictionaryFileStore), and file streams (RFileWriteStream and RFileReadStream).

File store base

This abstract base class provides basic behaviour for file stores, such as reading a store from a specified file.

File stores are derived from the persistent store base (CPersistentStore) provided by the Stores API. This means that they have a root stream, from which all other streams within the store can be found.

The file store base class is CFileStore.

Direct file store

A direct file store implements a file store in which once the streams have been committed and closed, they cannot subsequently be changed. They are used by the type of application that treats the in-memory copy of its data as its prime copy, and on saving, replaces the entire store.

The direct file store is a concrete type, derived from CFileStore, and is provided by CDirectFileStore.

Permanent file store

A permanent file store implements a file store in which existing streams within the store can be changed. They are used by the type of application which treats the data in the store as its prime copy. Typically, the object network comprising the application’s data is structured so that sections of data can be loaded in, and, if changed, written back to the store. Memory is used as a workplace for changing data.

The permanent file store is a concrete type, derived from CFileStore, and is provided by CPermanentFileStore.

Dictionary file store

The dictionary file store implements a dictionary store, a network of streams each of which can be accessed via a UID, in file storage.

The dictionary file store is a concrete type, derived from CDictionaryStore, and is provided by CDictionaryFileStore.

File streams

File streams allow standard files (RFile objects as defined in the File Server Client Side API), not file stores, to be written to as streams. This can be simpler and more efficient than using the equivalent RFile functions.

The file stream classes are RFileReadStream and RFileWriteStream.