![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
The Settings class manages a key-value database. More...
#include <FXSettings.h>
Public Member Functions | |
| FXSettings () | |
| Construct settings database. | |
| 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. | |
| FXStringDict * | find (const FXchar *section) const |
| Find string dictionary for the given section; may be NULL. | |
| FXStringDict * | find (const FXString §ion) const |
| FXStringDict * | data (FXint pos) const |
| Obtain the string dictionary for the given section. | |
| 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 §ion, const FXchar *name, const FXchar *fmt,...) const FX_SCANF(4 |
| FXint FXint FXint | readFormatEntry (const FXString §ion, 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 §ion, const FXchar *name, const FXchar *fmt,...) FX_PRINTF(4 |
| FXint FXint FXint FXint FXint FXint | writeFormatEntry (const FXString §ion, 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=NULL) const |
| Read a string registry entry; if no value is found, the default value def is returned. | |
| const FXchar * | readStringEntry (const FXString §ion, const FXchar *name, const FXchar *def=NULL) const |
| const FXchar * | readStringEntry (const FXString §ion, const FXString &name, const FXchar *def=NULL) const |
| FXbool | writeStringEntry (const FXchar *section, const FXchar *name, const FXchar *val) |
| Write a string registry entry. | |
| FXbool | writeStringEntry (const FXString §ion, const FXchar *name, const FXchar *val) |
| FXbool | writeStringEntry (const FXString §ion, 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 §ion, const FXchar *name, FXint def=0) const |
| FXint | readIntEntry (const FXString §ion, 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 §ion, const FXchar *name, FXint val) |
| FXbool | writeIntEntry (const FXString §ion, 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 §ion, const FXchar *name, FXuint def=0) const |
| FXuint | readUIntEntry (const FXString §ion, 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 §ion, const FXchar *name, FXuint val) |
| FXbool | writeUIntEntry (const FXString §ion, 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 §ion, const FXchar *name, FXlong def=0) const |
| FXlong | readLongEntry (const FXString §ion, 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 §ion, const FXchar *name, FXlong val) |
| FXbool | writeLongEntry (const FXString §ion, 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 §ion, const FXchar *name, FXulong def=0) const |
| FXulong | readULongEntry (const FXString §ion, 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 §ion, const FXchar *name, FXulong val) |
| FXbool | writeULongEntry (const FXString §ion, 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 §ion, const FXchar *name, FXdouble def=0.0) const |
| FXdouble | readRealEntry (const FXString §ion, 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 §ion, const FXchar *name, FXdouble val) |
| FXbool | writeRealEntry (const FXString §ion, 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 §ion, const FXchar *name, FXColor def=0) const |
| FXColor | readColorEntry (const FXString §ion, 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 §ion, const FXchar *name, FXColor val) |
| FXbool | writeColorEntry (const FXString §ion, 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 §ion, const FXchar *name, FXbool def=false) const |
| FXbool | readBoolEntry (const FXString §ion, 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 §ion, const FXchar *name, FXbool val) |
| FXbool | writeBoolEntry (const FXString §ion, const FXString &name, FXbool val) |
| FXbool | existingEntry (const FXchar *section, const FXchar *name) const |
| See if entry exists. | |
| FXbool | existingEntry (const FXString §ion, const FXchar *name) const |
| FXbool | existingEntry (const FXString §ion, const FXString &name) const |
| FXbool | deleteEntry (const FXchar *section, const FXchar *name) |
| Delete a registry entry. | |
| FXbool | deleteEntry (const FXString §ion, const FXchar *name) |
| FXbool | deleteEntry (const FXString §ion, const FXString &name) |
| FXbool | existingSection (const FXchar *section) const |
| See if section exists. | |
| FXbool | existingSection (const FXString §ion) const |
| FXbool | deleteSection (const FXchar *section) |
| Delete section. | |
| FXbool | deleteSection (const FXString §ion) |
| FXbool | clear () |
| Clear all sections. | |
| virtual | ~FXSettings () |
| Cleanup. | |
Public Member Functions inherited from FX::FXDict | |
| FXDict () | |
| Construct an empty dictionary. | |
| FXbool | size (FXint m) |
| Resize the table to the given size. | |
| FXint | size () const |
| Return the size of the table, including the empty slots. | |
| FXint | no () const |
| Return the total number of entries in the table. | |
| void * | insert (const FXchar *ky, void *ptr=NULL, FXbool mrk=false) |
| Insert a new entry into the table given key and mark. | |
| void * | replace (const FXchar *ky, void *ptr=NULL, FXbool mrk=false) |
| Replace data at key, if the entry's mark is less than or equal to the given mark. | |
| FXbool | empty (FXint pos) const |
| Return true if slot is empty. | |
| const FXchar * | key (FXint pos) const |
| Return key at position pos. | |
| FXbool | mark (FXint pos) const |
| Return mark flag of entry at position pos. | |
| FXint | first () const |
| Return position of first filled slot, or >= total. | |
| FXint | last () const |
| Return position of last filled slot or -1. | |
| FXint | next (FXint pos) const |
| 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 | prev (FXint pos) const |
| Return position of previous filled slot in hash table or a -1 if no filled slot was found. | |
| virtual | ~FXDict () |
| Destructor. | |
Public Member Functions inherited from FX::FXObject | |
| const FXchar * | getClassName () const |
| Get class name of some object. | |
| FXbool | isMemberOf (const FXMetaClass *metaclass) const |
| Check if object is member of metaclass. | |
| virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
| Try handle message safely, catching certain exceptions. | |
| virtual long | onDefault (FXObject *, FXSelector, void *) |
| Called for unhandled messages. | |
| virtual void | save (FXStream &store) const |
| Save object to stream. | |
| virtual void | load (FXStream &store) |
| Load object from stream. | |
| virtual | ~FXObject () |
| Virtual destructor. | |
Protected Member Functions | |
| virtual void * | createData (void *) |
| Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer. | |
| virtual void | deleteData (void *) |
| Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing. | |
| FXStringDict * | insert (const FXchar *ky) |
| FXStringDict * | replace (const FXchar *ky, FXStringDict *section) |
| FXStringDict * | remove (const FXchar *ky) |
| Remove data given key. | |
Protected Attributes | |
| FXbool | modified |
Protected Attributes inherited from FX::FXDict | |
| FXArray< Entry > | table |
| FXint | used |
| FXint | free |
Additional Inherited Members | |
Static Protected Member Functions inherited from FX::FXDict | |
| static FXint | hash (const FXchar *str) |
Static Protected Attributes inherited from FX::FXDict | |
| static const Entry | init |
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.
|
|