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

Public Member Functions

 FXRegistry (const FXString &akey=FXString::null, const FXString &vkey=FXString::null)
 Construct registry object; akey and vkey must be string constants. More...
 
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.
 
- Public Member Functions inherited from FX::FXSettings
 FXSettings ()
 Construct settings database.
 
 FXSettings (const FXSettings &other)
 Construct from another settings database.
 
FXival no () const
 Return the size of the table, including the empty slots.
 
FXival used () const
 Return number of used slots in the table.
 
FXival free () const
 Return number of free slots in the table.
 
FXbool empty () const
 See if map is empty.
 
FXSettingsoperator= (const FXSettings &other)
 Assignment operator.
 
FXSettingsadopt (FXSettings &other)
 Adopt string dictionary from another.
 
FXbool isModified () const
 Is it modified.
 
void setModified (FXbool mdfy=true)
 Mark as changed.
 
FXbool parseFile (const FXString &filename, FXbool mrk=true)
 Parse a file containing a settings database.
 
FXbool unparseFile (const FXString &filename)
 Unparse settings database into given file.
 
FXbool parse (const FXString &string, FXbool mrk=true)
 Parse single string to populate settings.
 
FXbool unparse (FXString &string) const
 Unparse settings to a single string.
 
FXival find (const FXchar *ky) const
 Find position of given key, returning -1 if not found.
 
FXival find (const FXString &ky) const
 Find position of given key, returning -1 if not found.
 
FXbool has (const FXchar *ky) const
 Check if key is mapped.
 
FXbool has (const FXString &ky) const
 Check if key is mapped.
 
FXStringDictionaryat (const FXchar *ky)
 Return reference to slot assocated with given key.
 
const FXStringDictionaryat (const FXchar *ky) const
 Return constant reference to slot assocated with given key.
 
FXStringDictionaryat (const FXString &ky)
 Return reference to slot assocated with given key.
 
const FXStringDictionaryat (const FXString &ky) const
 Return constant reference to slot assocated with given key.
 
FXStringDictionaryoperator[] (const FXchar *ky)
 Return reference to slot assocated with given key.
 
const FXStringDictionaryoperator[] (const FXchar *ky) const
 Return constant reference to slot assocated with given key.
 
FXStringDictionaryoperator[] (const FXString &ky)
 Return reference to slot assocated with given key.
 
const FXStringDictionaryoperator[] (const FXString &ky) const
 Return constant reference to slot assocated with given key.
 
FXbool empty (FXival pos) const
 Return true if slot is empty.
 
const FXStringkey (FXival pos) const
 Return key at position pos.
 
FXStringDictionarydata (FXival pos)
 Return reference to slot at position pos.
 
const FXStringDictionarydata (FXival pos) const
 Return constant reference to slot at position pos.
 
FXint readFormatEntry (const FXchar *section, const FXchar *name, const FXchar *fmt,...) const FX_SCANF(4
 Read a formatted registry entry, using scanf-style format.
 
FXint FXint readFormatEntry (const FXString &section, const FXchar *name, const FXchar *fmt,...) const FX_SCANF(4
 
FXint FXint FXint readFormatEntry (const FXString &section, const FXString &name, const FXchar *fmt,...) const FX_SCANF(4
 
FXint FXint FXint FXint writeFormatEntry (const FXchar *section, const FXchar *name, const FXchar *fmt,...) FX_PRINTF(4
 Write a formatted registry entry, using printf-style format.
 
FXint FXint FXint FXint FXint writeFormatEntry (const FXString &section, const FXchar *name, const FXchar *fmt,...) FX_PRINTF(4
 
FXint FXint FXint FXint FXint FXint writeFormatEntry (const FXString &section, const FXString &name, const FXchar *fmt,...) FX_PRINTF(4
 
FXint FXint FXint FXint FXint FXint const FXchar * readStringEntry (const FXchar *section, const FXchar *name, const FXchar *def=nullptr) const
 Read a string registry entry; if no value is found, the default value def is returned.
 
const FXchar * readStringEntry (const FXString &section, const FXchar *name, const FXchar *def=nullptr) const
 
const FXchar * readStringEntry (const FXString &section, const FXString &name, const FXchar *def=nullptr) const
 
FXbool writeStringEntry (const FXchar *section, const FXchar *name, const FXchar *val)
 Write a string registry entry.
 
FXbool writeStringEntry (const FXString &section, const FXchar *name, const FXchar *val)
 
FXbool writeStringEntry (const FXString &section, const FXString &name, const FXchar *val)
 
FXint readIntEntry (const FXchar *section, const FXchar *name, FXint def=0) const
 Read a integer registry entry; if no value is found, the default value def is returned.
 
FXint readIntEntry (const FXString &section, const FXchar *name, FXint def=0) const
 
FXint readIntEntry (const FXString &section, const FXString &name, FXint def=0) const
 
FXbool writeIntEntry (const FXchar *section, const FXchar *name, FXint val)
 Write a integer registry entry.
 
FXbool writeIntEntry (const FXString &section, const FXchar *name, FXint val)
 
FXbool writeIntEntry (const FXString &section, const FXString &name, FXint val)
 
FXuint readUIntEntry (const FXchar *section, const FXchar *name, FXuint def=0) const
 Read a unsigned integer registry entry; if no value is found, the default value def is returned.
 
FXuint readUIntEntry (const FXString &section, const FXchar *name, FXuint def=0) const
 
FXuint readUIntEntry (const FXString &section, const FXString &name, FXuint def=0) const
 
FXbool writeUIntEntry (const FXchar *section, const FXchar *name, FXuint val)
 Write a unsigned integer registry entry.
 
FXbool writeUIntEntry (const FXString &section, const FXchar *name, FXuint val)
 
FXbool writeUIntEntry (const FXString &section, const FXString &name, FXuint val)
 
FXlong readLongEntry (const FXchar *section, const FXchar *name, FXlong def=0) const
 Read a 64-bit long integer registry entry; if no value is found, the default value def is returned.
 
FXlong readLongEntry (const FXString &section, const FXchar *name, FXlong def=0) const
 
FXlong readLongEntry (const FXString &section, const FXString &name, FXlong def=0) const
 
FXbool writeLongEntry (const FXchar *section, const FXchar *name, FXlong val)
 Write a 64-bit long integer registry entry.
 
FXbool writeLongEntry (const FXString &section, const FXchar *name, FXlong val)
 
FXbool writeLongEntry (const FXString &section, const FXString &name, FXlong val)
 
FXulong readULongEntry (const FXchar *section, const FXchar *name, FXulong def=0) const
 Read a 64-bit unsigned long integer registry entry; if no value is found, the default value def is returned.
 
FXulong readULongEntry (const FXString &section, const FXchar *name, FXulong def=0) const
 
FXulong readULongEntry (const FXString &section, const FXString &name, FXulong def=0) const
 
FXbool writeULongEntry (const FXchar *section, const FXchar *name, FXulong val)
 Write a 64-bit unsigned long integer registry entry.
 
FXbool writeULongEntry (const FXString &section, const FXchar *name, FXulong val)
 
FXbool writeULongEntry (const FXString &section, const FXString &name, FXulong val)
 
FXdouble readRealEntry (const FXchar *section, const FXchar *name, FXdouble def=0.0) const
 Read a double-precision floating point registry entry; if no value is found, the default value def is returned.
 
FXdouble readRealEntry (const FXString &section, const FXchar *name, FXdouble def=0.0) const
 
FXdouble readRealEntry (const FXString &section, const FXString &name, FXdouble def=0.0) const
 
FXbool writeRealEntry (const FXchar *section, const FXchar *name, FXdouble val)
 Write a double-precision floating point registry entry.
 
FXbool writeRealEntry (const FXString &section, const FXchar *name, FXdouble val)
 
FXbool writeRealEntry (const FXString &section, const FXString &name, FXdouble val)
 
FXColor readColorEntry (const FXchar *section, const FXchar *name, FXColor def=0) const
 Read a color value registry entry; if no value is found, the default value def is returned.
 
FXColor readColorEntry (const FXString &section, const FXchar *name, FXColor def=0) const
 
FXColor readColorEntry (const FXString &section, const FXString &name, FXColor def=0) const
 
FXbool writeColorEntry (const FXchar *section, const FXchar *name, FXColor val)
 Write a color value entry.
 
FXbool writeColorEntry (const FXString &section, const FXchar *name, FXColor val)
 
FXbool writeColorEntry (const FXString &section, const FXString &name, FXColor val)
 
FXbool readBoolEntry (const FXchar *section, const FXchar *name, FXbool def=false) const
 Read a boolean registry entry.
 
FXbool readBoolEntry (const FXString &section, const FXchar *name, FXbool def=false) const
 
FXbool readBoolEntry (const FXString &section, const FXString &name, FXbool def=false) const
 
FXbool writeBoolEntry (const FXchar *section, const FXchar *name, FXbool val)
 Write a boolean value entry.
 
FXbool writeBoolEntry (const FXString &section, const FXchar *name, FXbool val)
 
FXbool writeBoolEntry (const FXString &section, const FXString &name, FXbool val)
 
FXbool existingEntry (const FXchar *section, const FXchar *name) const
 See if entry exists.
 
FXbool existingEntry (const FXString &section, const FXchar *name) const
 
FXbool existingEntry (const FXString &section, const FXString &name) const
 
FXbool existingSection (const FXchar *section) const
 See if section exists.
 
FXbool existingSection (const FXString &section) const
 
void deleteEntry (const FXchar *section, const FXchar *name)
 Delete a registry entry.
 
void deleteEntry (const FXString &section, const FXchar *name)
 
void deleteEntry (const FXString &section, const FXString &name)
 
void deleteSection (const FXchar *section)
 Delete section.
 
void deleteSection (const FXString &section)
 
void clear ()
 Clear all sections.
 
 ~FXSettings ()
 Cleanup.
 

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
 
- Protected Attributes inherited from FX::FXSettings
Entrytable
 
FXbool modified
 

Additional Inherited Members

- Protected Member Functions inherited from FX::FXSettings
FXbool no (FXival n)
 
void used (FXival u)
 
void free (FXival f)
 
FXbool resize (FXival n)
 

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

◆ FXRegistry()

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-2022 Jeroen van der Zijp