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 ()
 FXSettings (const FXSettings &orig)
FXSettingsoperator= (const FXSettings &orig)
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 FXcharreadStringEntry (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
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. String values can contain any character, and will be escaped when written to the file.


Constructor & Destructor Documentation

FX::FXSettings::FXSettings  ) 
 

Construct settings database.

FX::FXSettings::FXSettings const FXSettings orig  ) 
 

Construct copy of existing database.

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

Cleanup.


Member Function Documentation

FXSettings& FX::FXSettings::operator= const FXSettings orig  ) 
 

Assignment operator.

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

Parse a file containing a settings database.

bool 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.

FXint 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.

FXbool FX::FXSettings::readBoolEntry const FXchar section,
const FXchar key,
FXbool  def = FALSE
 

Read a boolean registry entry.

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

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

FXint bool FX::FXSettings::writeStringEntry const FXchar section,
const FXchar key,
const FXchar val
 

Write a string registry entry.

bool FX::FXSettings::writeIntEntry const FXchar section,
const FXchar key,
FXint  val
 

Write a integer registry entry.

bool FX::FXSettings::writeUnsignedEntry const FXchar section,
const FXchar key,
FXuint  val
 

Write a unsigned integer registry entry.

bool FX::FXSettings::writeRealEntry const FXchar section,
const FXchar key,
FXdouble  val
 

Write a double-precision floating point registry entry.

bool FX::FXSettings::writeColorEntry const FXchar section,
const FXchar key,
FXColor  val
 

Write a color value entry.

bool FX::FXSettings::writeBoolEntry const FXchar section,
const FXchar key,
FXbool  val
 

Write a boolean value entry.

bool FX::FXSettings::deleteEntry const FXchar section,
const FXchar key
 

Delete a registry entry.

bool FX::FXSettings::existingEntry const FXchar section,
const FXchar key
 

See if entry exists.

bool FX::FXSettings::deleteSection const FXchar section  ) 
 

Delete section.

bool FX::FXSettings::existingSection const FXchar section  ) 
 

See if section exists.

bool FX::FXSettings::clear  ) 
 

Clear all sections.

Reimplemented from FX::FXDict.

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

Mark as changed.

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

Is it modified.

Copyright © 1997-2005 Jeroen van der Zijp