7 #include "unitempgen.h"
10 #include "wvstringcache.h"
11 #include "unilistiter.h"
12 #include "wvlinkerhack.h"
26 UniTempGen::UniTempGen()
32 UniTempGen::~UniTempGen()
44 return WvString::null;
49 return WvString::null;
64 bool trailing_slash =
false;
71 trailing_slash =
true;
86 node->
visit(wv::bind(&UniTempGen::notify_deleted,
this,
97 else if (!trailing_slash)
107 bool more = it.next();
114 more ? WvString::empty : value);
131 if (value != node->
value())
176 for (i.rewind(); i.next(); )
177 it->
add(i->key(), i->value());
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.
UniConfKey pop(int n=1)
Returns the path formed by the first n segments of this path and removes them from the key.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
An iterator that iterates through a constant list of keys.
void add(const UniConfKey &k, WvStringParm v=WvString::null)
Add a key/value pair to the list that gets returned by this iterator.
::UniListIter ListIter
An iterator over a constant list of keys (see below)
WvString get(WvStringParm s)
Get a shared string corresponding to 's'.
void unhold_delta()
Resumes notifications when each hold_delta() has been matched.
WvString is an implementation of a simple and efficient printable-string class.
virtual void commit()
Commits any changes.
An abstract data container that backs a UniConf tree.
Sub * findchild(const UniConfKey &key) const
Finds the direct child node with the specified key.
const WvString & value() const
Returns the value field.
void visit(const Visitor &visitor, void *userdata, bool preorder=true, bool postorder=false) const
Performs a traversal on this tree using the specified visitor function and traversal type(s).
bool isnull() const
returns true if this string is null
An iterator over the segments of a key.
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
void setvalue(WvStringParm value)
Sets the value field.
A type-safe version of WvMonikerBase that lets you provide create functions for object types other th...
bool isempty() const
Returns true if this path has zero segments (also known as root).
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
virtual void commit()
Commits any changes.
UniConfKey fullkey(const Sub *ancestor=NULL) const
Returns full path of this node relative to an ancestor.
virtual bool refresh()
Refreshes information about a key recursively.
A plain UniConfTree that holds keys and values.
virtual void setv(const UniConfPairList &pairs)
Stores multiple key-value pairs into the registry.
bool haschildren() const
Returns true if the node has children.
Sub * find(const UniConfKey &key) const
Finds the sub-node with the specified key.
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 refresh()
Refreshes information about a key recursively.
void hold_delta()
Pauses notifications until matched with a call to unhold_delta().
A UniConf generator that stores keys in memory.
An abstract iterator over keys and values in a generator.