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

FX::FXSettings Class Reference

The Settings class manages a key-value database. More...

#include <FXSettings.h>

Inheritance diagram for FX::FXSettings:

FX::FXDict FX::FXObject FX::FXRegistry List of all members.

Public Member Functions

 FXSettings ()
FXbool parseFile (const FXString &filename, FXbool mark)
FXbool 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
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)
FXint writeFormatEntry (const FXchar *section, const FXchar *key, const FXchar *fmt,...) FX_PRINTF(4
FXbool writeStringEntry (const FXchar *section, const FXchar *key, const FXchar *val)
FXbool writeIntEntry (const FXchar *section, const FXchar *key, FXint val)
FXbool writeUnsignedEntry (const FXchar *section, const FXchar *key, FXuint val)
FXbool writeRealEntry (const FXchar *section, const FXchar *key, FXdouble val)
FXbool writeColorEntry (const FXchar *section, const FXchar *key, FXColor val)
FXbool deleteEntry (const FXchar *section, const FXchar *key)
FXbool existingEntry (const FXchar *section, const FXchar *key)
FXbool deleteSection (const FXchar *section)
FXbool existingSection (const FXchar *section)
FXbool clear ()
void setModified (FXbool mdfy=TRUE)
FXbool isModified () const
virtual ~FXSettings ()

Detailed Description

The Settings class manages a key-value database.

This is normally used as part of Registry, but can also be used separately in applications that need to maintain a key-value database in a file of their own.


Constructor & Destructor Documentation

FX::FXSettings::FXSettings  ) 
 

Construct settings database.

virtual FX::FXSettings::~FXSettings  )  [virtual]
 

Cleanup.


Member Function Documentation

FXbool FX::FXSettings::parseFile const FXString filename,
FXbool  mark
 

Parse a file containing a settings database.

FXbool FX::FXSettings::unparseFile const FXString filename  ) 
 

Unparse settings database into given file.

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

Obtain the string dictionary for the given section.

Reimplemented from FX::FXDict.

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

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

Reimplemented from FX::FXDict.

FXint FX::FXSettings::readFormatEntry const FXchar *  section,
const FXchar *  key,
const FXchar *  fmt,
  ...
 

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

const FXchar* FX::FXSettings::readStringEntry const FXchar *  section,
const FXchar *  key,
const FXchar *  def = NULL
 

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
 

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
 

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
 

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
 

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

FXint FX::FXSettings::writeFormatEntry const FXchar *  section,
const FXchar *  key,
const FXchar *  fmt,
  ...
 

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

FXbool FX::FXSettings::writeStringEntry const FXchar *  section,
const FXchar *  key,
const FXchar *  val
 

Write a string registry entry.

FXbool FX::FXSettings::writeIntEntry const FXchar *  section,
const FXchar *  key,
FXint  val
 

Write a integer registry entry.

FXbool FX::FXSettings::writeUnsignedEntry const FXchar *  section,
const FXchar *  key,
FXuint  val
 

Write a unsigned integer registry entry.

FXbool FX::FXSettings::writeRealEntry const FXchar *  section,
const FXchar *  key,
FXdouble  val
 

Write a double-precision floating point registry entry.

FXbool FX::FXSettings::writeColorEntry const FXchar *  section,
const FXchar *  key,
FXColor  val
 

Write a color value entry.

FXbool FX::FXSettings::deleteEntry const FXchar *  section,
const FXchar *  key
 

Delete a registry entry.

FXbool FX::FXSettings::existingEntry const FXchar *  section,
const FXchar *  key
 

See if entry exists.

FXbool FX::FXSettings::deleteSection const FXchar *  section  ) 
 

Delete section.

FXbool FX::FXSettings::existingSection const FXchar *  section  ) 
 

See if section exists.

FXbool FX::FXSettings::clear  ) 
 

Clear all sections.

Reimplemented from FX::FXDict.

void FX::FXSettings::setModified FXbool  mdfy = TRUE  )  [inline]
 

Mark as changed.

FXbool FX::FXSettings::isModified  )  const [inline]
 

Is it modified.

Copyright © 1997-2005 Jeroen van der Zijp