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