r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / guicast / defaults.h
blob37502e2295d01ccd8f7b96bd9d8629d3090a03ca
1 #ifndef DEFAULTS_H
2 #define DEFAULTS_H
6 // Hash table with persistent storage in stringfiles.
9 #include "stringfile.inc"
10 #include "units.h"
13 class Defaults
15 public:
16 Defaults();
17 Defaults(char *filename);
18 virtual ~Defaults();
20 int load(); // load from disk file
21 int save(); // save to disk file
22 int load_string(char *string); // load from string
23 int save_string(char* &string); // save to new string
24 void save_stringfile(StringFile *file);
25 void load_stringfile(StringFile *file);
26 int update(char *name, Freq value); // update a value if it exists
27 int update(char *name, double value); // update a value if it exists
28 int update(char *name, float value); // update a value if it exists
29 int update(char *name, int32_t value); // update a value if it exists
30 int update(char *name, int64_t value); // update a value if it exists
31 int update(char *name, char *value); // create it if it doesn't
33 double get(char *name, double default_); // retrieve a value if it exists
34 float get(char *name, float default_); // retrieve a value if it exists
35 int32_t get(char *name, int32_t default_); // retrieve a value if it exists
36 int64_t get(char *name, int64_t default_); // retrieve a value if it exists
37 char* get(char *name, char *default_); // return 1 if it doesn't
39 char *names[1024]; // list of string names
40 char *values[1024]; // list of values
41 int total; // number of defaults
42 char filename[1024]; // filename the defaults are stored in
45 #endif