Download Litebase User Manual

Transcript
Litebase User manual
explanation is necessarily brief, but if the reader wants to know that function in greater depth, he
should refer to the Litebase Reference Manual. In fact, the latter is a good companion to the present
document.
Readers of this manual should have notions of object-oriented programming, especially C++. They
should know what a class is, how derivation works and what the access and scope rules of class
members are.
Data table structure
Litebase stores information in the form of data tables, which are in turn composed of records. A table
of records is stored in a data file, which has the following structure, depicted in Fig. 1:
Header
Part 1
u-area
Part 2
Record 0
Record 1
Part 3
...
Record n-1
Fig. 1 – Structure of a data table
The first part is a header, where the engine keeps table management information. This includes record
counters, description of the structure of the records, index descriptors, etc.
The second part is called the u-area. This section (which is optional) may be used to store user-defined
data whose format is not necessarily the same as the records’. For example, an encrypted password,
the identification of the last user to access the table, a time stamp, etc.
The third part of the file contains all the records stored in the table. Each record is divided into fields,
each with its own type and length. This part grows as more records are added to the table.
Objects that provide access to a data table
Litebase defines a set of classes that provide access to the information contained in a data table. The
main Litebase classes are:
•
DataFile:
•
Rbuf:
•
Field:
•
Rlist:
this class is the interface to a table’s physical files. Files are kept in secondary
storage, for example in a computer’s hard disk.
this class represents a record buffer, giving access to individual fields within a record.
Normally, this class will not be used by itself; we will be using classes derived from Rbuf
instead.
this class gives access to the contents of a record field.
this class (derived from Rbuf) provides access to all the table records, allowing the
creation, change and deletion of these records, among other things.
2