Public Types | |
| enum | Root { SYSTEM, USER } |
Public Member Functions | |
| Preferences (Root root, const char *vendor, const char *application) | |
| Preferences (const char *path, const char *vendor, const char *application) | |
| Preferences (Preferences &, const char *group) | |
| Preferences (Preferences *, const char *group) | |
| ~Preferences () | |
| int | groups () |
| const char * | group (int) |
| bool | groupExists (const char *group) |
| bool | deleteGroup (const char *group) |
| int | entries () |
| const char * | entry (int) |
| bool | entryExists (const char *entry) |
| bool | deleteEntry (const char *entry) |
| bool | set (const char *entry, int value) |
| bool | set (const char *entry, float value) |
| bool | set (const char *entry, double value) |
| bool | set (const char *entry, const char *value) |
| bool | set (const char *entry, const void *value, int size) |
| bool | get (const char *entry, int &value, int defaultValue) |
| bool | get (const char *entry, float &value, float defaultValue) |
| bool | get (const char *entry, double &value, double defaultValue) |
| bool | get (const char *entry, char *&value, const char *defaultValue) |
| bool | get (const char *entry, char *value, const char *defaultValue, int maxSize) |
| bool | get (const char *entry, void *&value, const void *defaultValue, int defaultSize) |
| bool | get (const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize) |
| int | size (const char *entry) |
| bool | getUserdataPath (char *path, int pathlen) |
| void | flush () |
Friends | |
| class | Node |
| class | RootNode |
|
||||||||||||||||
|
create the initial preferences base
|
|
||||||||||||||||
|
create the initial preferences base
|
|
||||||||||||
|
create a Preferences node in relation to a parent node for reading and writing
|
|
||||||||||||
|
create a Preferences node in relation to a parent node for reading and writing
|
|
|
destroy individual keys
|
|
|
remove a single entry (name/value pair) example: buttonColor.deleteEntry( "red" ); |
|
|
delete a group example: setup.deleteGroup( "colors/buttons" ); |
|
|
return the number of entries (name/value) pairs for a group example: int n = buttonColor.entries(); |
|
|
return the name of an entry
|
|
|
return 1, if an entry with this name exists example: if ( buttonColor.entryExists( "red" ) ) ... |
|
|
write all preferences to disk
|
|
||||||||||||||||||||||||
|
read a binary entry from the group the data will be moved into the given destination buffer data will be clipped to the buffer size |
|
||||||||||||||||||||
|
read a binary entry from the group 'data' will be changed to point to a new data buffer the data buffer must be deleted with "delete[] (char*)data" by the user. |
|
||||||||||||||||||||
|
read a text entry from the group the text will be moved into the given text buffer text will be clipped to the buffer size |
|
||||||||||||||||
|
read a text entry from the group 'text' will be changed to point to a new text buffer the text buffer must be freed with "delete[] text" by the user. |
|
||||||||||||||||
|
read an entry from the group |
|
||||||||||||||||
|
read an entry from the group |
|
||||||||||||||||
|
read an entry from the group |
|
||||||||||||
|
creates a path that is related to the preferences file and that is usable for application data beyond what is covered by Preferences.
|
|
|
return the group name of the n'th group
|
|
|
return 1, if a group with this name exists example: if ( base.groupExists( "setup/colors" ) ) ... |
|
|
return the number of groups that are contained within a group example: int n = base.groups(); |
|
||||||||||||||||
|
set an entry (name/value pair) |
|
||||||||||||
|
set an entry (name/value pair) |
|
||||||||||||
|
set an entry (name/value pair) |
|
||||||||||||
|
set an entry (name/value pair) |
|
||||||||||||
|
set an entry (name/value pair) |
|
|
return the size of the value part of an entry |
©2006 Bill Spitzak and others.