Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

WordSet Class Reference

A generic class that provides a neat and easy to use wrapper to a hash_set<char *>. More...

#include <WordSet.hpp>

Inheritance diagram for WordSet:

Stopper List of all members.

Public Methods

 WordSet ()
 WordSet (const string &filename)
 Create object, and load set from file.

 ~WordSet ()
void load (const string &filename)
 Load a set from file. Does not clear the set first.

void add (const char *word)
 Add a word (char *) to the set.

bool contains (const char *word) const
 Check for the existence of a word in the set.

void clear ()
 Empty the set and free memory.


Protected Attributes

set< char *, lt_strwords

Detailed Description

A generic class that provides a neat and easy to use wrapper to a hash_set<char *>.

A generic class that provides a neat and easy to use wrapper to a hash_set<char *>. It can load items in the set from a file (one item per line). It also handles its own memory conveniently.


Constructor & Destructor Documentation

WordSet::WordSet  
 

WordSet::WordSet const string &    filename
 

Create object, and load set from file.

WordSet::~WordSet  
 


Member Function Documentation

void WordSet::add const char *    word
 

Add a word (char *) to the set.

void WordSet::clear  
 

Empty the set and free memory.

bool WordSet::contains const char *    word const
 

Check for the existence of a word in the set.

void WordSet::load const string &    filename
 

Load a set from file. Does not clear the set first.


Member Data Documentation

set<char *, lt_str> WordSet::words [protected]
 

The set used to store words. once a word is stored, we do not change it


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 13:00:01 2004 for Lemur Toolkit by doxygen1.2.18