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()
26 root->mounts.del_callback(
this);
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));
177 if (xfullkey.suborsame(key, subkey))
178 delta(subkey, value);
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
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.
const UniConf & inner() const
Returns the inner generator.
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.
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.
virtual UniConfKey key() const
Returns the current key.
void commit() const
Commits information about this key recursively.
IUniConfGen * whichmount(UniConfKey *mountpoint=NULL) const
Finds the generator that owns this key.
An abstract iterator over keys and values in a generator.
void prefetch(bool recursive) const
See UniConfGen::prefetch().
bool haschildren() const
Returns true if this key has children.
bool exists() const
Without fetching its value, returns true if this key exists.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
UniConfRoot * rootobj() const
Returns a pointer to the UniConfRoot that manages this node.
virtual void prefetch(const UniConfKey &key, bool recursive)
Indicate that we will eventually be interested in doing get(), haschildren(), or other "get-like" ope...
WvString getme(WvStringParm defvalue=WvString::null) const
Fetches the string value for this key from the registry.
virtual void commit()
Commits any changes.
virtual void rewind()
Rewinds the iterator.
virtual WvString value() const
Returns the value of the current key.
virtual ~Iter()
Destroys the iterator.
virtual bool next()
Seeks to the next element in the sequence.
bool isempty() const
Returns true if this path has zero segments (also known as root).
virtual bool refresh()
Refreshes information about a key recursively.
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 void rewind()
Rewinds the iterator.
virtual WvString value() const
Returns the value of 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...
UniConfKey fullkey() const
Returns the full path of this node, starting at the root.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
void setme(WvStringParm value) const
Stores a string value for this key into the registry.
bool refresh() const
Refreshes information about this key recursively.
WvString is an implementation of a simple and efficient printable-string class.
virtual UniConfKey key() const
Returns the current key.
Deprecated: a UniConfGen that delegates all requests to an inner UniConf.
virtual bool isok()
Determines if the generator is usable and working properly.
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.