2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2003 Net Integration Technologies, Inc.
5 * A generator that exposes the windows registry.
7 * When linking statically, use the following #pragma to ensure this
8 * generator gets registered:
9 * #pragma comment(linker, "/include:?UniRegistryGenMoniker@@3V?$WvMoniker@VUniConfGen@@@@A")
11 #ifndef __UNICONFREGISTRY_H
12 #define __UNICONFREGISTRY_H
14 #include "uniconfgen.h"
19 * A generator that exposes the windows registry.
21 * To mount, use the moniker "registry:".
24 class UniRegistryGen
: public UniConfGen
30 virtual void flush_buffers() { }
33 UniRegistryGen(WvString _base
);
34 virtual ~UniRegistryGen();
36 /***** Overridden methods *****/
39 virtual WvString
get(const UniConfKey
&key
);
40 virtual void set(const UniConfKey
&key
, WvStringParm value
);
41 virtual void setv(const UniConfPairList
&pairs
);
42 virtual bool exists(const UniConfKey
&key
);
43 virtual bool haschildren(const UniConfKey
&key
);
44 virtual Iter
*iterator(const UniConfKey
&key
);
47 class UniRegistryGenIter
: public UniConfGen::Iter
50 UniRegistryGenIter(UniRegistryGen
&gen
, const UniConfKey
&key
, HKEY base
);
52 /** Destroys the iterator. */
53 virtual ~UniRegistryGenIter();
56 * Rewinds the iterator.
57 * Must be called prior to the first invocation of next().
59 virtual void rewind();
62 * Seeks to the next element in the sequence.
63 * Returns true if that element exists.
64 * Must be called prior to the first invocation of key().
68 /** Returns the current key. */
69 virtual UniConfKey
key() const;
71 /** Returns the value of the current key. */
72 virtual WvString
value() const;
79 enum Enumerating
{ KEYS
, VALUES
} m_enumerating
;
82 const UniConfKey parent
;
83 UniConfKey current_key
;
84 const HKEY m_dontClose
;
87 #endif // __UNICONFREGISTRY_H