WvStreams
uniunwrapgen.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2004 Net Integration Technologies, Inc.
4 *
5 * A totally evil UniConfGen that "unwraps" a UniConf object by turning it
6 * back into a UniConfGen.
7 */
8#ifndef __UNIUNWRAPGEN_H
9#define __UNIUNWRAPGEN_H
10
11#include "uniconf.h"
12
34{
35 UniConf xinner;
36 UniConfKey xfullkey;
37
38public:
40 virtual ~UniUnwrapGen();
41
42 void setinner(const UniConf &inner);
43
45 const UniConf &inner() const
46 { return xinner; }
47
48 /***** Overridden methods *****/
49 virtual void commit();
50 virtual bool refresh();
51 virtual void flush_buffers() { }
52 virtual void prefetch(const UniConfKey &key, bool recursive);
53 virtual WvString get(const UniConfKey &key);
54 virtual void set(const UniConfKey &key, WvStringParm value);
55 virtual void setv(const UniConfPairList &pairs);
56 virtual bool exists(const UniConfKey &key);
57 virtual bool haschildren(const UniConfKey &key);
58 virtual bool isok();
59 virtual Iter *iterator(const UniConfKey &key);
60 virtual Iter *recursiveiterator(const UniConfKey &key);
61
62private:
67 virtual void gencallback(const UniConfKey &key, WvStringParm value);
68
70 UniConf _sub(const UniConfKey &key);
71
72 class Iter;
73 class RecursiveIter;
74
75 bool refreshing, committing;
76};
77
78#endif //__UNIUNWRAPGEN_H
A default implementation of IUniConfGen, providing various handy features that save trouble when impl...
Definition uniconfgen.h:200
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
Definition uniconfkey.h:39
UniConf instances function as handles to subtrees of a UniConf tree and expose a high-level interface...
Definition uniconf.h:51
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 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.
virtual void flush_buffers()
Flushes any commitment/notification buffers .
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...
Definition wvstring.h:94
WvString is an implementation of a simple and efficient printable-string class.
Definition wvstring.h:330