8 #include "uniconfroot.h"
9 #include "uniconfgen.h"
17 : xroot(root), xfullkey(fullkey)
30 : xroot(other.xroot), xfullkey(other.xfullkey)
52 return xroot->mounts.exists(xfullkey);
58 return xroot->mounts.haschildren(xfullkey);
64 xroot->mounts.prefetch(xfullkey, recursive);
70 WvString value = xroot->mounts.get(xfullkey);
79 return xroot->mounts.str2int(
getme(), defvalue);
85 xroot->mounts.set(xfullkey, value);
110 for (i.rewind(); i.next(); )
112 UniConf dst2 = dst[i->fullkey(*
this)];
114 dst2.
setme(i->getme());
121 return xroot->mounts.refresh();
127 xroot->mounts.commit();
133 return xroot->mounts.mount(xfullkey, moniker, refresh);
139 return xroot->mounts.mountgen(xfullkey, gen, refresh);
145 return xroot->mounts.unmount(gen, commit);
151 return xroot->mounts.ismountpoint(xfullkey);
157 return xroot->mounts.whichmount(xfullkey, mountpoint);
164 return gen && gen->
isok();
171 xroot->add_callback(cookie, xfullkey, callback, recurse);
177 xroot->del_callback(cookie, xfullkey, recurse);
183 xroot->add_setbool(xfullkey, flag, recurse);
189 xroot->del_setbool(xfullkey, flag, recurse);
195 xroot->mounts.hold_delta();
201 xroot->mounts.unhold_delta();
207 xroot->mounts.clear_delta();
213 xroot->mounts.flush_delta();
220 for (it.rewind(); it.next(); )
223 if (everything || !!value)
224 stream.print(
"%s = %s\n", it->fullkey(), value);
254 :
IterBase(_top), pathead(pattern.first()),
255 pattail(pattern.removefirst()), subit(NULL), it(NULL), recit(NULL)
264 if (patnext.iswild())
273 UniConf::XIter::~XIter()
279 void UniConf::XIter::cleanup()
299 void UniConf::XIter::rewind()
304 if (pathead.isempty())
307 ready = current.exists();
317 ready = current.exists();
328 current = top[pathead];
329 if (pattail.isempty())
333 ready = current.exists();
344 inline bool UniConf::XIter::qnext()
348 bool found = subit->next();
367 void UniConf::XIter::enter(
const UniConf &child)
374 bool UniConf::XIter::next()
384 if (it && it->next())
394 if (recit && recit->next())
411 UniConf::SortedIterBase::SortedIterBase(
const UniConf &
root,
412 UniConf::SortedIterBase::Comparator comparator)
413 : IterBase(root), xcomparator(comparator), xkeys()
418 UniConf::SortedIterBase::~SortedIterBase()
431 static UniConf::SortedIterBase::Comparator innercomparator = NULL;
435 return innercomparator(a, b) < 0;
439 void UniConf::SortedIterBase::_purge()
441 count = xkeys.size();
446 void UniConf::SortedIterBase::_rewind()
449 count = xkeys.size();
452 innercomparator = xcomparator;
453 std::sort(xkeys.begin(), xkeys.end(), wrapcomparator);
457 bool UniConf::SortedIterBase::next()
461 current = xkeys[index];