8 #include "uniconfroot.h" 9 #include "uniunwrapgen.h" 10 #include "wvlinkerhack.h" 15 UniUnwrapGen::UniUnwrapGen(
const UniConf &inner)
17 refreshing = committing =
false;
22 UniUnwrapGen::~UniUnwrapGen()
30 void UniUnwrapGen::setinner(
const UniConf &inner)
41 root->mounts.
add_callback(
this, wv::bind(&UniUnwrapGen::gencallback,
87 return _sub(key).
getme();
93 _sub(key).
setme(value);
107 return _sub(key).
exists();
120 return gen ? gen->
isok() :
false;
137 virtual bool next() {
return i.next(); }
156 virtual bool next() {
return i.next(); }
164 return new Iter(_sub(key));
178 delta(subkey, value);
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
bool isempty() const
Returns true if this path has zero segments (also known as root).
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
This iterator performs depth-first traversal of a subtree.
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
This iterator walks through all immediate children of a UniConf node.
virtual WvString value() const
Returns the value of the current key.
bool suborsame(const UniConfKey &key) const
Returns true if 'key' is a the same, or a subkey, of this UniConfKey.
An abstract data container that backs a UniConf tree.
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
An abstract iterator over keys and values in a generator.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
bool refresh() const
Refreshes information about this key recursively.
void setme(WvStringParm value) const
Stores a string value for this key into the registry.
bool haschildren() const
Returns true if this key has children.
virtual void setv(const UniConfPairList &pairs)
Stores multiple key-value pairs into the registry.
const UniConf & inner() const
Returns the inner generator.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
virtual void del_callback(void *cookie)
Removes a callback for change notification.
virtual void prefetch(const UniConfKey &key, bool recursive)
Indicate that we will eventually be interested in doing get(), haschildren(), or other "get-like" ope...
bool exists() const
Without fetching its value, returns true if this key exists.
virtual void commit()
Commits any changes.
virtual void add_callback(void *cookie, const UniConfGenCallback &callback)
Adds a callback for change notification.
UniConfKey fullkey() const
Returns the full path of this node, starting at the root.
virtual void rewind()
Rewinds the iterator.
IUniConfGen * whichmount(UniConfKey *mountpoint=NULL) const
Finds the generator that owns this key.
virtual ~Iter()
Destroys the iterator.
virtual bool next()
Seeks to the next element in the sequence.
virtual bool refresh()
Refreshes information about a key recursively.
virtual WvString value() const
Returns the value of the current key.
virtual void setv(const UniConfPairList &pairs)
Stores multiple key-value pairs into the registry.
virtual bool next()
Seeks to the next element in the sequence.
UniConf instances function as handles to subtrees of a UniConf tree and expose a high-level interface...
virtual UniConfKey key() const
Returns the current key.
virtual void rewind()
Rewinds the iterator.
virtual UniConfKey key() const
Returns the current key.
virtual bool isok()=0
Determines if the generator is usable and working properly.
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
void commit() const
Commits information about this key recursively.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
void prefetch(bool recursive) const
See UniConfGen::prefetch().
WvString getme(WvStringParm defvalue=WvString::null) const
Fetches the string value for this key from the registry.
WvString is an implementation of a simple and efficient printable-string class.
Deprecated: a UniConfGen that delegates all requests to an inner UniConf.
virtual bool isok()
Determines if the generator is usable and working properly.
UniConfRoot * rootobj() const
Returns a pointer to the UniConfRoot that manages this node.
Represents the root of a hierarhical registry consisting of pairs of UniConfKeys and associated strin...
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.