9 #include "unilistgen.h"
10 #include "wvmoniker.h"
12 #include "wvstringlist.h"
13 #include "wvlinkerhack.h"
43 UniConfGenList *l =
new UniConfGenList();
47 WvStringList::Iter i(gens);
49 for (i.rewind(); i.next();)
52 IUniConfGen *gen = wvcreate<IUniConfGen>(i(), _obj);
63 UniListGen::UniListGen(UniConfGenList *_l) : l(_l)
65 UniConfGenList::Iter i(*l);
66 for (i.rewind(); i.next(); )
71 UniListGen::~UniListGen()
73 UniConfGenList::Iter i(*l);
74 for (i.rewind(); i.next(); )
75 i->del_callback(
this);
82 UniConfGenList::Iter i(*l);
83 for (i.rewind(); i.next();)
92 UniConfGenList::Iter i(*l);
93 for (i.rewind(); i.next();)
94 result = i->refresh() && result;
101 UniConfGenList::Iter i(*l);
102 for (i.rewind(); i.next(); )
105 return WvString::null;
112 UniConfGenList::Iter i(*l);
113 for (i.rewind(); i.next(); )
120 UniConfGenList::Iter i(*l);
121 for (i.rewind(); i.next(); )
128 UniConfGenList::Iter i(*l);
129 for (i.rewind(); i.next();)
140 UniConfGenList::Iter i(*l);
141 for (i.rewind(); i.next();)
143 if (i->haschildren(key))
152 UniConfGenList::Iter i(*l);
153 for (i.rewind(); i.next();)
178 UniConfGenList::Iter geniter(*gen->l);
179 for (geniter.rewind(); geniter.next(); )
181 Iter *it = geniter->iterator(key);
186 i =
new IterList::Iter(l);
192 for ((*i).rewind(); (*i).next(); )
235 return (*i)->value();
virtual void commit()
Commits any changes.
virtual UniConfKey key() const
Returns the current key.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
WvString is an implementation of a simple and efficient printable-string class.
An abstract data container that backs a UniConf tree.
virtual void setv(const UniConfPairList &pairs)
Stores multiple key-value pairs into the registry.
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
A type-safe version of WvMonikerBase that lets you provide create functions for object types other th...
virtual unsigned int release()=0
Indicate that you are finished using this object.
virtual void gencallback(const UniConfKey &key, WvStringParm value)
Called by first generator when a key changes.
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual bool refresh()
Refreshes information about a key recursively.
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
Accepts a list of UniConf generators, and stacks them, treating them as one uniconf source.
virtual bool next()
Seeks to the next element in the sequence.
This is a WvList of WvStrings, and is a really handy way to parse strings.
void wvtcl_decode(WvList< WvString > &l, WvStringParm _s, const WvStringMask &splitchars=WVTCL_SPLITCHARS, bool do_unescape=true)
split a tcl-style list.
virtual void rewind()
Rewinds the iterator.
virtual WvString value() const
Returns the value of the current key.
virtual bool isok()
Determines if the generator is usable and working properly.
virtual unsigned int addRef()=0
Indicate you are using this object.
An abstract iterator over keys and values in a generator.