Storage Library


As a rule, each application has a set of control parameters called “application settings”. There are general settings and particular settings determined by a particular user. The application settings are stored in so called “ini” files, in Windows registry, in special format files, in Data Bases (DB), etc. It is natural to try to automate the application settings managing, in order to facilitate the programming process and to develop a universal system for the application settings control, allowing the extension, modification and upgrading the computer program. The Storage library has been developed for the above mentioned purposes.

What is the Storage library?

The objective of the Storage Library is to control the application settings. It provides the user with the following possibilities:

  • Reading/writing the application settings in “ini” files, in Windows registry, in special format binary files, in the standard Delphi stream. The latter allows the use of various locations for the application settings storage, e.g. the DB fields;
  • Automated reading/writing of published properties of the other components;
  • Facilitation of the development process by reading/writing both the unpublished properties of the other components and any arbitrary data.

How Does It Works?

TrsStorage is a main component of Storage library. It controls the data stored in the memory as a tree-like structure. The TrsIniData, TrsRegData, TrsBinData, and TrsXMLData components are designed for the purpose of data exchange between TrsStorage and the storage location. The TrsPropSaver component allows for automated reading/writing of published properties of other components located in the same application form as TrsPropSaver. In addition, TrsPropSaver can store the position and state of a form.Usually, the application being developed must contain:

  • the TrsStorage component designed to store and to control the application settings;
  • any of the TrsIniData, TrsRegData, TrsBinData, or TrsXMLData components, designed to read/write the application settings stored in TrsStorage;
  • a certain number of TrsPropSaver components (a component for each form) which will read/write (automatically) the position and state of a form, published properties of components located on a form, the user data, unpublished properties of components located on a form;
  • a TrsCustomProperties component allowing the unification of the unpublished properties managing for all TrsPropSaver components.

See Figure 1. For details.

Storage library components using

This is one of the possible ways you can use Storage Library. In particular, it is possible to use several TrsStorage components: a component used for processing the data stored in ini files, another component used for data stored in the Windows registry, etc. It is possible not to use TrsPropSaver in this case, as the data may be read/written ‘manually’. TrsStorage provides the user with various methods for such an operation. The TrsCustomProperties component is not needed if the user’s application does not involve reading/writing of unpublished properties of other components.