wvstringmask.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 2005 Net Integration Technologies, Inc.
00004  *
00005  * Implementation of an efficient lookup for a set characters.
00006  *
00007  * It is, however, a little space intensive, but you should statically
00008  * create them in your functions, and then they won't be so bad.
00009  */
00010 #ifndef __WVSTRINGMASK_H
00011 #define __WVSTRINGMASK_H
00012 
00013 #include "wvstring.h"
00014 
00018 class WvStringMask
00019 {
00020 public:
00025     WvStringMask(WvStringParm s = WvString::null);
00026     WvStringMask(char c);
00027 
00031     bool operator[](const char c) const;
00032     bool operator[](const int i) const;
00033 
00037     const char first() const;
00038 
00042     void zap();
00043 
00047     void set(const char c, bool value);
00048 
00052     void set(WvStringParm s, bool value);
00053 
00054 private:
00055     bool _set[256];
00056     char _first;
00057 };
00058 
00059 #endif // __WVSTRINGMASK_H

Generated on Wed Jul 12 17:53:21 2006 for WvStreams by  doxygen 1.4.7