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::FXRegistry

Classes

struct  Entry
 

Public Member Functions

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

Protected Member Functions

FXbool no (FXival n)
 
void used (FXival u)
 
void free (FXival f)
 
FXbool resize (FXival n)
 

Protected Attributes

Entrytable
 
FXbool modified
 

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.


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

Copyright © 1997-2022 Jeroen van der Zijp