Saner handling if config.mk doesn't exist: use a default config.defaults.mk.
[wvstreams.git] / include / unilistgen.h
blob2f9dc9e68efeefbb0b9cdc6a653ffc65474516b6
1 /* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 * UniListGen is a UniConf generator to allow multiple generators to be
6 * stacked in a priority sequence for get/set/etc.
8 */
10 #ifndef __UNICONFLISTGEN_H
11 #define __UNICONFLISTGEN_H
13 #include "uniconfgen.h"
14 #include "wvscatterhash.h"
16 /**
17 * Accepts a list of UniConf generators, and stacks them, treating them as one
18 * uniconf source.
20 * The standard way of using the list generator would be with a moniker. The
21 * moniker takes the form of list:(tcl style string list).
23 * For example: list:readonly:ini:admin.ini ini:user.ini
25 * The list can also contain a list. This still uses tcl style string lists as
26 * follows:
28 * list:readonly:ini:admin.ini list:{ini:user1.ini ini:user2.ini} ini:def.ini
30 class UniListGen : public UniConfGen
32 public:
33 UniListGen(UniConfGenList *_l);
34 virtual ~UniListGen();
36 UniConfGenList *l;
38 /***** Overridden members *****/
40 virtual void commit();
41 virtual bool refresh();
42 virtual void flush_buffers() { }
43 virtual WvString get(const UniConfKey &key);
44 virtual void set(const UniConfKey &key, WvStringParm value);
45 virtual void setv(const UniConfPairList &pairs);
46 virtual bool exists(const UniConfKey &key);
47 virtual bool haschildren(const UniConfKey &key);
48 virtual bool isok();
49 virtual Iter *iterator(const UniConfKey &key);
51 class IterIter;
53 protected:
54 /**
55 * Called by first generator when a key changes.
56 * The default implementation calls delta(key).
58 virtual void gencallback(const UniConfKey &key, WvStringParm value);
62 #endif // __UNICONFLISTGEN_H