Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXRegistry Class Reference

The Registry maintains a persistent settings database for an application. More...

#include <FXRegistry.h>

Inheritance diagram for FX::FXRegistry:
FX::FXSettings FX::FXDict FX::FXObject

List of all members.

Public Member Functions

 FXRegistry (const FXString &akey=FXString::null, const FXString &vkey=FXString::null)
 Construct registry object; akey and vkey must be string constants.
void setAsciiMode (FXbool asciiMode)
 Set ASCII mode; under MS-Windows, this will switch the system to a file-based registry system, instead of using the System Registry API.
FXbool getAsciiMode () const
 Get ASCII mode.
void setAppKey (const FXString &name)
 Change application key name.
const FXStringgetAppKey () const
 Return application key name.
void setVendorKey (const FXString &name)
 Change vendor key name.
const FXStringgetVendorKey () const
 Return vendor key name.
void setSystemDirectories (const FXString &dirs)
 Change search path for system-wide settings.
const FXStringgetSystemDirectories () const
 Return search path for system-wide settings.
void setUserDirectory (const FXString &dir)
 Change directory root for per-user settings tree.
const FXStringgetUserDirectory () const
 Return directory root of per-user settings tree.
virtual FXbool read ()
 Read registry.
virtual FXbool write ()
 Write registry.
virtual ~FXRegistry ()
 Destructor.

Static Public Attributes

static const FXchar ext []
 File extension for settings files.
static const FXchar foxrc []
 File name of common settings file.

Protected Attributes

FXString applicationkey
FXString vendorkey
FXString systemdirs
FXString userdir
FXbool ascii

Detailed Description

The Registry maintains a persistent settings database for an application.

The settings database is organized in two groups of three layers each. Configuration data shared by all users on a system is stored in the system- wide settings database. Configuration data for a single user is stored in the per-user database (typically somewhere in the user's home directory). Each group is further subdivided into three layers. The Common layer contains configuration data shared by all FOX programs. The Vendor layer in turn contains configuration data shared by all programs from a particular vendor (like a suite of interoperating applications). The Application layer contains configuration data for a particular application only. When an FXApp object is constructed, the application name and optional vendor name parameters determine the names of the Application layer and Vendor layer settings files (the name of Common layer settings file is pre-determined). Upon startup, the application's configuration data are assembled by merging layers from the system-wide group first, and then the layers from the per- user group. During this merge, per-user settings override system-wide settings, and application settings take precedence over vendor settings, which in turn override common settings. Only per-user, application-layer settings are ever written:- the other settings are rarely modified. Typically, system-wide settings are set when an application is installed, while common per-user settings tend to be changed by specialized applications (e.g. ControlPanel) or through installation scripts. The Rregistry is automatically read when FXApp::init() is called, and written back to the system when FXApp::exit() is called.


Constructor & Destructor Documentation

FX::FXRegistry::FXRegistry ( const FXString akey = FXString::null,
const FXString vkey = FXString::null 
)

Construct registry object; akey and vkey must be string constants.

Regular applications SHOULD set a vendor key!


The documentation for this class was generated from the following file:

Copyright © 1997-2011 Jeroen van der Zijp