22#ifndef Fl_Preferences_H
23# define Fl_Preferences_H
26# include "Fl_Export.H"
80 static const char *newUUID();
83 Fl_Preferences(
const char *path,
const char *vendor,
const char *application );
102 const char *
name() {
return node->name(); }
106 const char *
path() {
return node->path(); }
109 const char *group(
int num_group );
110 char groupExists(
const char *key );
111 char deleteGroup(
const char *group );
112 char deleteAllGroups();
115 const char *entry(
int index );
116 char entryExists(
const char *key );
117 char deleteEntry(
const char *entry );
118 char deleteAllEntries();
122 char set(
const char *entry,
int value );
123 char set(
const char *entry,
float value );
124 char set(
const char *entry,
float value,
int precision );
125 char set(
const char *entry,
double value );
126 char set(
const char *entry,
double value,
int precision );
127 char set(
const char *entry,
const char *value );
128 char set(
const char *entry,
const void *value,
int size );
130 char get(
const char *entry,
int &value,
int defaultValue );
131 char get(
const char *entry,
float &value,
float defaultValue );
132 char get(
const char *entry,
double &value,
double defaultValue );
133 char get(
const char *entry,
char *&value,
const char *defaultValue );
134 char get(
const char *entry,
char *value,
const char *defaultValue,
int maxSize );
135 char get(
const char *entry,
void *&value,
const void *defaultValue,
int defaultSize );
136 char get(
const char *entry,
void *value,
const void *defaultValue,
int defaultSize,
int maxSize );
138 int size(
const char *entry );
140 char getUserdataPath(
char *path,
int pathlen );
164 Name(
unsigned int n );
165 Name(
const char *format, ... );
171 operator const char *() {
return data_; }
184 static char nameBuffer[128];
185 static char uuidBuffer[40];
193 Node *child_, *next_;
200 int nEntry_, NEntry_;
201 unsigned char dirty_:1;
202 unsigned char top_:1;
203 unsigned char indexed_:1;
206 int nIndex_, NIndex_;
211 static int lastEntrySet;
213 Node(
const char *path );
216 int write( FILE *f );
218 const char *path() {
return path_; }
219 Node *find(
const char *path );
220 Node *search(
const char *path,
int offset=0 );
221 Node *childNode(
int ix );
222 Node *addChild(
const char *path );
223 void setParent(
Node *parent );
224 Node *parent() {
return top_?0L:parent_; }
225 void setRoot(
RootNode *r) { root_ = r; top_ = 1; }
229 void deleteAllChildren();
232 const char *child(
int ix );
233 void set(
const char *name,
const char *value );
234 void set(
const char *line );
235 void add(
const char *line );
236 const char *get(
const char *name );
237 int getEntry(
const char *name );
238 char deleteEntry(
const char *name );
239 void deleteAllEntries();
240 int nEntry() {
return nEntry_; }
241 Entry &entry(
int i) {
return entry_[i]; }
248 char *vendor_, *application_;
256 char getPath(
char *path,
int pathlen );
'Name' provides a simple method to create numerical or more complex procedural names for entries and ...
Definition: Fl_Preferences.H:159
Definition: Fl_Preferences.H:191
Definition: Fl_Preferences.H:245
Fl_Preferences provides methods to store user settings between application starts.
Definition: Fl_Preferences.H:60
Root
Define the scope of the preferences.
Definition: Fl_Preferences.H:66
ID id()
Return an ID that can later be reused to open more references to this dataset.
Definition: Fl_Preferences.H:94
const char * path()
Return the full path to this entry.
Definition: Fl_Preferences.H:106
void * ID
Every Fl_Preferences-Group has a uniqe ID.
Definition: Fl_Preferences.H:78
const char * name()
Return the name of this entry.
Definition: Fl_Preferences.H:102
static char remove(ID id_)
Remove the group with this ID from a database.
Definition: Fl_Preferences.H:98
Definition: Fl_Preferences.H:176