FX::FXRegistry Class Reference

#include <FXRegistry.h>

Inheritance diagram for FX::FXRegistry:

Inheritance graph
[legend]

List of all members.


Detailed Description

The registry maintains a database of persistent settings for an application. The settings database is organized in two groups of three layers each. The system-wide settings group contains settings information pertaining to all users on a system. The per-user settings group contains settings affecting that user only. Each settings group contains a desktop layer, which comprises the settings which affect all FOX programs, a vendor layer which holds settings that affect all applications from that vendor (e.g. a application-suite), and an application layer which holds settings only for a single application. The vendor-key and application-key determine which files these layers come from, while the "Desktop" key is used for all FOX applications. Settings in the system-wide group are overwritten by the per-user group, and settings from the "Desktop" layer are overwritten by the vendor-layer; vendor-layer settings are overwritten by the application-layer settings. Only the per-user, per-application settings ever gets written; the layers in the system-group only get written during installation and configuration of the application. The registry is read when FXApp::init() is called, and written back to the system when FXApp::exit() is called.

Public Member Functions

 FXRegistry (const FXString &akey=FXString::null, const FXString &vkey=FXString::null)
bool read ()
bool write ()
const FXStringgetAppKey () const
const FXStringgetVendorKey () const
void setAsciiMode (bool asciiMode)
bool getAsciiMode () const
void * insert (const FXchar *ky, const void *ptr, bool mrk=false)
void * replace (const FXchar *ky, const void *ptr, bool mrk=false)
bool parseFile (const FXString &filename, bool mark)
bool unparseFile (const FXString &filename)
FXStringDictdata (FXuint pos) const
FXStringDictfind (const FXchar *section) const
FXint readFormatEntry (const FXchar *section, const FXchar *key, const FXchar *fmt,...) FX_SCANF(4
FXint const FXchar * readStringEntry (const FXchar *section, const FXchar *key, const FXchar *def=NULL)
FXint readIntEntry (const FXchar *section, const FXchar *key, FXint def=0)
FXuint readUnsignedEntry (const FXchar *section, const FXchar *key, FXuint def=0)
FXdouble readRealEntry (const FXchar *section, const FXchar *key, FXdouble def=0.0)
FXColor readColorEntry (const FXchar *section, const FXchar *key, FXColor def=0)
FXbool readBoolEntry (const FXchar *section, const FXchar *key, FXbool def=FALSE)
FXint writeFormatEntry (const FXchar *section, const FXchar *key, const FXchar *fmt,...) FX_PRINTF(4
FXint bool writeStringEntry (const FXchar *section, const FXchar *key, const FXchar *val)
bool writeIntEntry (const FXchar *section, const FXchar *key, FXint val)
bool writeUnsignedEntry (const FXchar *section, const FXchar *key, FXuint val)
bool writeRealEntry (const FXchar *section, const FXchar *key, FXdouble val)
bool writeColorEntry (const FXchar *section, const FXchar *key, FXColor val)
bool writeBoolEntry (const FXchar *section, const FXchar *key, FXbool val)
bool deleteEntry (const FXchar *section, const FXchar *key)
bool existingEntry (const FXchar *section, const FXchar *key)
bool deleteSection (const FXchar *section)
bool existingSection (const FXchar *section)
bool clear ()
void setModified (bool mdfy=true)
bool isModified () const
void size (FXint m)
FXint size () const
FXint no () const
bool empty (FXint pos) const
const FXchar * key (FXuint pos) const
bool mark (FXuint pos) const
FXint first () const
FXint last () const
FXint next (FXint pos) const
FXint prev (FXint pos) const
virtual long onDefault (FXObject *, FXSelector, void *)
const FXchar * getClassName () const
bool isMemberOf (const FXMetaClass *metaclass) const
virtual long tryHandle (FXObject *sender, FXSelector sel, void *ptr)
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
QTransString tr (const char *text, const char *hint=0)
virtual void * getPythonObject () const
virtual void decouplePythonObject () const

Protected Member Functions

bool readFromDir (const FXString &dirname, bool mark)
virtual void * createData (const void *)
virtual void deleteData (void *)
FXchar * dequote (FXchar *text) const
FXchar * enquote (FXchar *result, const FXchar *text)
FXStringDictinsert (const FXchar *ky)
FXStringDictreplace (const FXchar *ky, FXStringDict *section)
FXStringDictremove (const FXchar *ky)

Static Protected Member Functions

static FXint hash (const FXchar *str)

Protected Attributes

FXString applicationkey
FXString vendorkey
bool ascii
bool modified
FXDictEntry * dict
FXint total
FXint number

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!


Member Function Documentation

bool FX::FXRegistry::read (  ) 

Read registry.

bool FX::FXRegistry::write (  ) 

Write registry.

const FXString& FX::FXRegistry::getAppKey (  )  const [inline]

Return application key.

const FXString& FX::FXRegistry::getVendorKey (  )  const [inline]

Return vendor key.

void FX::FXRegistry::setAsciiMode ( bool  asciiMode  )  [inline]

Set ASCII mode; under MS-Windows, this will switch the system to a file-based registry system, instead of using the System Registry API.

bool FX::FXRegistry::getAsciiMode (  )  const [inline]

Get ASCII mode.

virtual void* FX::FXSettings::createData ( const void *   )  [protected, virtual, inherited]

Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer.

Reimplemented from FX::FXDict.

virtual void FX::FXSettings::deleteData ( void *   )  [protected, virtual, inherited]

Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing.

Reimplemented from FX::FXDict.

void* FX::FXDict::insert ( const FXchar *  ky,
const void *  ptr,
bool  mrk = false 
) [inherited]

Insert a new entry into the table given key and mark. If there is already an entry with that key, leave it unchanged, otherwise insert the new entry.

Referenced by FX::FXStringDict::insert(), and FX::FXIconDict::insert().

void* FX::FXDict::replace ( const FXchar *  ky,
const void *  ptr,
bool  mrk = false 
) [inherited]

Replace data at key, if the entry's mark is less than or equal to the given mark. If there was no existing entry, a new entry is inserted with the given mark.

Referenced by FX::FXStringDict::replace().

FXStringDict* FX::FXSettings::remove ( const FXchar *  ky  )  [inline, protected, inherited]

Remove data given key.

Reimplemented from FX::FXDict.

References FX::FXDict::remove().

bool FX::FXSettings::parseFile ( const FXString filename,
bool  mark 
) [inherited]

Parse a file containing a settings database.

bool FX::FXSettings::unparseFile ( const FXString filename  )  [inherited]

Unparse settings database into given file.

FXStringDict* FX::FXSettings::data ( FXuint  pos  )  const [inline, inherited]

Obtain the string dictionary for the given section.

Reimplemented from FX::FXDict.

References FX::FXDict::data().

FXStringDict* FX::FXSettings::find ( const FXchar *  section  )  const [inline, inherited]

Find string dictionary for the given section; may be NULL.

Reimplemented from FX::FXDict.

References FX::FXDict::find().

FXint FX::FXSettings::readFormatEntry ( const FXchar *  section,
const FXchar *  key,
const FXchar *  fmt,
  ... 
) [inherited]

Read a formatted registry entry, using scanf-style format.

FXint const FXchar* FX::FXSettings::readStringEntry ( const FXchar *  section,
const FXchar *  key,
const FXchar *  def = NULL 
) [inherited]

Read a string registry entry; if no value is found, the default value def is returned.

FXint FX::FXSettings::readIntEntry ( const FXchar *  section,
const FXchar *  key,
FXint  def = 0 
) [inherited]

Read a integer registry entry; if no value is found, the default value def is returned.

FXuint FX::FXSettings::readUnsignedEntry ( const FXchar *  section,
const FXchar *  key,
FXuint  def = 0 
) [inherited]

Read a unsigned integer registry entry; if no value is found, the default value def is returned.

FXdouble FX::FXSettings::readRealEntry ( const FXchar *  section,
const FXchar *  key,
FXdouble  def = 0.0 
) [inherited]

Read a double-precision floating point registry entry; if no value is found, the default value def is returned.

FXColor FX::FXSettings::readColorEntry ( const FXchar *  section,
const FXchar *  key,
FXColor  def = 0 
) [inherited]

Read a color value registry entry; if no value is found, the default value def is returned.

FXbool FX::FXSettings::readBoolEntry ( const FXchar *  section,
const FXchar *  key,
FXbool  def = FALSE 
) [inherited]

Read a boolean registry entry.

FXint FX::FXSettings::writeFormatEntry ( const FXchar *  section,
const FXchar *  key,
const FXchar *  fmt,
  ... 
) [inherited]

Write a formatted registry entry, using printf-style format.

FXint bool FX::FXSettings::writeStringEntry ( const FXchar *  section,
const FXchar *  key,
const FXchar *  val 
) [inherited]

Write a string registry entry.

bool FX::FXSettings::writeIntEntry ( const FXchar *  section,
const FXchar *  key,
FXint  val 
) [inherited]

Write a integer registry entry.

bool FX::FXSettings::writeUnsignedEntry ( const FXchar *  section,
const FXchar *  key,
FXuint  val 
) [inherited]

Write a unsigned integer registry entry.

bool FX::FXSettings::writeRealEntry ( const FXchar *  section,
const FXchar *  key,
FXdouble  val 
) [inherited]

Write a double-precision floating point registry entry.

bool FX::FXSettings::writeColorEntry ( const FXchar *  section,
const FXchar *  key,
FXColor  val 
) [inherited]

Write a color value entry.

bool FX::FXSettings::writeBoolEntry ( const FXchar *  section,
const FXchar *  key,
FXbool  val 
) [inherited]

Write a boolean value entry.

bool FX::FXSettings::deleteEntry ( const FXchar *  section,
const FXchar *  key 
) [inherited]

Delete a registry entry.

bool FX::FXSettings::existingEntry ( const FXchar *  section,
const FXchar *  key 
) [inherited]

See if entry exists.

bool FX::FXSettings::deleteSection ( const FXchar *  section  )  [inherited]

Delete section.

bool FX::FXSettings::existingSection ( const FXchar *  section  )  [inherited]

See if section exists.

bool FX::FXSettings::clear (  )  [inherited]

Clear all sections.

Reimplemented from FX::FXDict.

void FX::FXSettings::setModified ( bool  mdfy = true  )  [inline, inherited]

Mark as changed.

bool FX::FXSettings::isModified (  )  const [inline, inherited]

Is it modified.

void FX::FXDict::size ( FXint  m  )  [inherited]

Resize the table to the given size.

FXint FX::FXDict::size (  )  const [inline, inherited]

Return the size of the table, including the empty slots.

FXint FX::FXDict::no (  )  const [inline, inherited]

Return the total number of entries in the table.

bool FX::FXDict::empty ( FXint  pos  )  const [inline, inherited]

Return true if slot is empty.

const FXchar* FX::FXDict::key ( FXuint  pos  )  const [inline, inherited]

Return key at position pos.

bool FX::FXDict::mark ( FXuint  pos  )  const [inline, inherited]

Return mark flag of entry at position pos.

FXint FX::FXDict::first (  )  const [inherited]

Return position of first filled slot, or >= total

FXint FX::FXDict::last (  )  const [inherited]

Return position of last filled slot or -1

FXint FX::FXDict::next ( FXint  pos  )  const [inherited]

Return position of next filled slot in hash table or a value greater than or equal to total if no filled slot was found

FXint FX::FXDict::prev ( FXint  pos  )  const [inherited]

Return position of previous filled slot in hash table or a -1 if no filled slot was found

virtual long FX::FXObject::onDefault ( FXObject ,
FXSelector  ,
void *   
) [virtual, inherited]

Called for unhandled messages.

Reimplemented in FX::FXDelegator, FX::FXGLViewer, FX::FXMDIChild, and FX::FXMDIClient.

const FXchar* FX::FXObject::getClassName (  )  const [inherited]

Get class name of some object.

bool FX::FXObject::isMemberOf ( const FXMetaClass metaclass  )  const [inherited]

Check if object is member of metaclass.

virtual long FX::FXObject::tryHandle ( FXObject sender,
FXSelector  sel,
void *  ptr 
) [virtual, inherited]

Try handle message safely.

virtual void FX::FXObject::save ( FXStream store  )  const [virtual, inherited]

Save object to stream.

Reimplemented in FX::FX4Splitter, FX::FX7Segment, FX::FXAccelTable, FX::FXApp, FX::FXArrowButton, FX::FXBitmap, FX::FXBitmapFrame, FX::FXBitmapView, FX::FXCheckButton, FX::FXChoiceBox, FX::FXColorBar, FX::FXColorDialog, FX::FXColorRing, FX::FXColorSelector, FX::FXColorWell, FX::FXColorWheel, FX::FXComboBox, FX::FXCursor, FX::FXDial, FX::FXDirBox, FX::FXDirDialog, FX::FXDirList, FX::FXDirSelector, FX::FXDockBar, FX::FXDockHandler, FX::FXDockTitle, FX::FXDocument, FX::FXDragCorner, FX::FXDrawable, FX::FXDriveBox, FX::FXFileDialog, FX::FXFileDict, FX::FXFileList, FX::FXFileSelector, FX::FXFoldingItem, FX::FXFoldingList, FX::FXFont, FX::FXFontDialog, FX::FXFontSelector, FX::FXFrame, FX::FXGLCanvas, FX::FXGLCone, FX::FXGLContext, FX::FXGLCube, FX::FXGLCylinder, FX::FXGLGroup, FX::FXGLShape, FX::FXGLSphere, FX::FXGLTriangleMesh, FX::FXGLVertices, FX::FXGLViewer, FX::FXGLVisual, FX::FXGradientBar, FX::FXGroupBox, FX::FXHeaderItem, FX::FXHeader, FX::FXIconDict, FX::FXIconItem, FX::FXIconList, FX::FXIconSource, FX::FXId, FX::FXImage, FX::FXImageFrame, FX::FXImageView, FX::FXKnob, FX::FXLabel, FX::FXListItem, FX::FXList, FX::FXListBox, FX::FXMDIChild, FX::FXMDIClient, FX::FXMenuButton, FX::FXMenuCaption, FX::FXMenuCascade, FX::FXMenuCheck, FX::FXMenuCommand, FX::FXMenuRadio, FX::FXMenuSeparator, FX::FXMenuTitle, FX::FXOptionMenu, FX::FXPacker, FX::FXPrimaryButton, FX::FXPrintDialog, FX::FXProgressBar, FX::FXRadioButton, FX::FXRealSlider, FX::FXRealSpinner, FX::FXRecentFiles, FX::FXReplaceDialog, FX::FXRuler, FX::FXRulerView, FX::FXScrollBar, FX::FXSlider, FX::FXSpinner, FX::FXSplashWindow, FX::FXSplitter, FX::FXSpring, FX::FXStatusBar, FX::FXStatusLine, FX::FXSwitcher, FX::FXTabBar, FX::FXTableItem, FX::FXTable, FX::FXText, FX::FXTextField, FX::FXToggleButton, FX::FXToolBarGrip, FX::FXToolBarShell, FX::FXToolBarTab, FX::FXToolTip, FX::FXTopWindow, FX::FXTreeItem, FX::FXTreeList, FX::FXTreeListBox, FX::FXTriStateButton, FX::FXVisual, FX::FXWindow, and FX::FXWizard.

virtual void FX::FXObject::load ( FXStream store  )  [virtual, inherited]

Load object from stream.

Reimplemented in FX::FX4Splitter, FX::FX7Segment, FX::FXAccelTable, FX::FXApp, FX::FXArrowButton, FX::FXBitmap, FX::FXBitmapFrame, FX::FXBitmapView, FX::FXCheckButton, FX::FXChoiceBox, FX::FXColorBar, FX::FXColorDialog, FX::FXColorRing, FX::FXColorSelector, FX::FXColorWell, FX::FXColorWheel, FX::FXComboBox, FX::FXCursor, FX::FXDial, FX::FXDirBox, FX::FXDirDialog, FX::FXDirList, FX::FXDirSelector, FX::FXDockBar, FX::FXDockHandler, FX::FXDockTitle, FX::FXDocument, FX::FXDragCorner, FX::FXDrawable, FX::FXDriveBox, FX::FXFileDialog, FX::FXFileDict, FX::FXFileList, FX::FXFileSelector, FX::FXFoldingItem, FX::FXFoldingList, FX::FXFont, FX::FXFontDialog, FX::FXFontSelector, FX::FXFrame, FX::FXGLCanvas, FX::FXGLCone, FX::FXGLContext, FX::FXGLCube, FX::FXGLCylinder, FX::FXGLGroup, FX::FXGLShape, FX::FXGLSphere, FX::FXGLTriangleMesh, FX::FXGLVertices, FX::FXGLViewer, FX::FXGLVisual, FX::FXGradientBar, FX::FXGroupBox, FX::FXHeaderItem, FX::FXHeader, FX::FXIconDict, FX::FXIconItem, FX::FXIconList, FX::FXIconSource, FX::FXId, FX::FXImage, FX::FXImageFrame, FX::FXImageView, FX::FXKnob, FX::FXLabel, FX::FXListItem, FX::FXList, FX::FXListBox, FX::FXMDIChild, FX::FXMDIClient, FX::FXMenuButton, FX::FXMenuCaption, FX::FXMenuCascade, FX::FXMenuCheck, FX::FXMenuCommand, FX::FXMenuRadio, FX::FXMenuSeparator, FX::FXMenuTitle, FX::FXOptionMenu, FX::FXPacker, FX::FXPrimaryButton, FX::FXPrintDialog, FX::FXProgressBar, FX::FXRadioButton, FX::FXRealSlider, FX::FXRealSpinner, FX::FXRecentFiles, FX::FXReplaceDialog, FX::FXRuler, FX::FXRulerView, FX::FXScrollBar, FX::FXSlider, FX::FXSpinner, FX::FXSplashWindow, FX::FXSplitter, FX::FXSpring, FX::FXStatusBar, FX::FXStatusLine, FX::FXSwitcher, FX::FXTabBar, FX::FXTableItem, FX::FXTable, FX::FXText, FX::FXTextField, FX::FXToggleButton, FX::FXToolBarGrip, FX::FXToolBarShell, FX::FXToolBarTab, FX::FXToolTip, FX::FXTopWindow, FX::FXTreeItem, FX::FXTreeList, FX::FXTreeListBox, FX::FXTriStateButton, FX::FXVisual, FX::FXWindow, and FX::FXWizard.

QTransString FX::FXObject::tr ( const char *  text,
const char *  hint = 0 
) [inherited]

Returns a human translated version of the text to the locale language (warning: uses a virtual method call, so can't use before construction)

virtual void* FX::FXObject::getPythonObject (  )  const [inline, virtual, inherited]

Returns the python object representing this instance (if created in python).

virtual void FX::FXObject::decouplePythonObject (  )  const [inline, virtual, inherited]

Causes decoupling of python object from this object (deletes self).


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

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:11:44 2008 for TnFOX by doxygen v1.5.6