00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "Exception.hpp"
00013 #include <set>
00014
00015
00016 #ifndef _LT_STR
00017 #define _LT_STR
00018
00019 #include "common_headers.hpp"
00020
00021
00022 struct lt_str
00023 {
00024 bool operator()(const char* s1, const char* s2) const
00025 {
00026 return strcmp(s1, s2) < 0;
00027 }
00028 };
00029 #endif
00030
00031 #ifndef _WORDSET_HPP
00032 #define _WORDSET_HPP
00033
00035
00042 class WordSet {
00043
00044 public:
00045 WordSet();
00047 WordSet(const string &filename);
00048 ~WordSet();
00049
00051 void load(const string &filename);
00053 void add(const char * word);
00055 bool contains(const char * word) const;
00056
00058 void clear();
00059
00060
00061 protected:
00062
00065 set<char *, lt_str> words;
00066
00067
00068 };
00069
00070 #endif