WvStreams
debian/libwvstreams-dev/usr/include/wvstreams/unilistiter.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2002-2005 Net Integration Technologies, Inc.
4 *
5 * A simple implementation of a UniConfGen iterator.
6 */
7#ifndef __UNILISTITER_H
8#define __UNILISTITER_H
9
10#include "uniconfgen.h"
11#include "wvscatterhash.h"
12#include "wvstringcache.h"
13#include "wvstringlist.h"
14
28{
29 IUniConfGen *gen;
30
31 DeclareWvScatterTable(UniConfKey);
32 UniConfKeyTable keylook;
33
34
35 UniConfKeyList keys;
36 WvStringList values;
37
38 UniConfKeyList::Iter ki;
39 WvStringList::Iter vi;
40
41 WvStringCache scache;
42
43public:
45
54 void add(const UniConfKey &k, WvStringParm v = WvString::null);
55
65 void autofill(IUniConfGen::Iter *source);
66
67 /***** Overridden members *****/
68 virtual void rewind();
69 virtual bool next();
70 virtual UniConfKey key() const;
71 virtual WvString value() const;
72};
73
74#endif // __UNILISTITER_H
An abstract data container that backs a UniConf tree.
An abstract iterator over keys and values in a generator.
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
An iterator that iterates through a constant list of keys.
virtual void rewind()
Rewinds the iterator.
void autofill(IUniConfGen::Iter *source)
Automatically fill the contents of this iterator by calling add() for each element of the 'source' it...
void add(const UniConfKey &k, WvStringParm v=WvString::null)
Add a key/value pair to the list that gets returned by this iterator.
virtual WvString value() const
Returns the value of the current key.
virtual UniConfKey key() const
Returns the current key.
virtual bool next()
Seeks to the next element in the sequence.
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
This is a WvList of WvStrings, and is a really handy way to parse strings.
WvString is an implementation of a simple and efficient printable-string class.