next up previous contents
Next: GoGui Up: Iterators Previous: Other non-pointer Point

Iterating for all the strings

The StringView can be used to maintain a list of all strings (it's stringtable). To iterate over these strings we have,

class StringTableIterator
{

public:
    StringTableIterator(const StringTable *);
    GoString *        nextString();  // should be next ???
private:
    int               _next;
    const GoString ** _id2string;
};

The above understands about skipping id's that have been merged.

It would be easy to subclass this to make a white or black string iterator.



P J Leonard
Tue Oct 1 15:25:19 BST 1996