31 #ifndef _UCOMMON_KEYDATA_H_ 32 #define _UCOMMON_KEYDATA_H_ 34 #ifndef _UCOMMON_CONFIG_H_ 38 #ifndef _UCOMMON_LINKED_H_ 42 #ifndef _UCOMMON_MEMORY_H_ 58 class __EXPORT keydata :
public OrderedObject
67 keydata(keyfile *file);
68 keydata(keyfile *file,
const char *
id);
69 __DELETE_COPY(keydata);
77 class __LOCAL keyvalue :
public OrderedObject
82 keyvalue(keyfile *allocator, keydata *section,
const char *key,
const char *data);
83 __DELETE_COPY(keyvalue);
90 friend class keyvalue;
97 const char *
get(
const char *id)
const;
104 inline const char *operator()(
const char *
id)
const {
115 void set(
const char *id,
const char *value);
122 void clear(
const char *
id);
128 inline const char *
get(void)
const {
136 inline keyvalue *begin(
void)
const {
137 return (keyvalue *)index.begin();
144 inline keyvalue *end(
void)
const {
145 return (keyvalue*)index.end();
151 typedef linked_pointer<keyvalue> pointer;
160 class __EXPORT keyfile :
public memalloc
163 friend class keydata;
169 keydata *create(
const char *section);
172 void load(HKEY root, keydata *section = NULL,
const char *path = NULL);
173 bool save(HKEY root, keydata *section = NULL,
const char *path = NULL);
181 keyfile(
size_t pagesize = 0);
188 keyfile(
const char *path,
size_t pagesize = 0);
190 keyfile(
const keyfile &
copy,
size_t pagesize = 0);
198 void load(
const char *path);
205 bool save(
const char *path);
211 void load(
const keyfile *source);
217 void load(
const keydata *source);
229 keydata *
get(
const char *section)
const;
231 inline keydata *operator()(
const char *section)
const {
235 inline keydata *operator[](
const char *section)
const {
243 inline keydata *
get(void)
const {
251 inline keydata *begin(
void)
const {
252 return (keydata *)index.begin();
259 inline keydata *end(
void)
const {
260 return (keydata *)index.end();
266 typedef linked_pointer<keydata> pointer;
268 inline int err(
void)
const {
276 void assign(keyfile& source);
278 inline keyfile& operator=(keyfile& source) {
Various miscellaneous platform specific headers and defines.
Private heaps, pools, and associations.
Common namespace for all ucommon objects.
T copy(const T &src)
Convenience function to copy objects.
Linked objects, lists, templates, and containers.