8 #include "uniwvconfgen.h"
17 WvConfigSection::Iter i;
39 void UniWvConfGen::notify(
void *userdata, WvStringParm section,
40 WvStringParm entry, WvStringParm oldval,
52 UniWvConfGen::UniWvConfGen(
WvConf *_cfg):
53 tempkey(NULL), tempvalue(), cfg(_cfg)
55 cfg->add_callback(wv::bind(&UniWvConfGen::notify,
this, _1, _2, _3, _4, _5),
60 UniWvConfGen::~UniWvConfGen()
69 if (tempkey && key == *tempkey)
82 if (value == WvString::null && sect)
83 cfg->delete_section(key);
85 cfg->set(section, keyname, value);
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
virtual void setv(const UniConfPairList &pairs)
Stores multiple key-value pairs into the registry.
WvConf configuration file management class: used to read/write config files that are formatted in the...
virtual UniConfKey key() const
Returns the current key.
WvString is an implementation of a simple and efficient printable-string class.
An abstract data container that backs a UniConf tree.
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...
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
UniConfKey first(int n=1) const
Returns the path formed by the n first segments of this path.
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual void rewind()
Rewinds the iterator.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
A wrapper class for the wvconf iters to provide a UniConfGen iter.
virtual bool next()
Seeks to the next element in the sequence.
UniConfKey last(int n=1) const
Returns the path formed by the n last segments of this path.
int numsegments() const
Returns the number of segments in this path.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
A UniConf generator for backwards compatibility with WvConf.
virtual WvString value() const
Returns the value of the current key.
An abstract iterator over keys and values in a generator.