71 unsigned int count, size;
87 void SetSize(
int newsize);
100 void * Object(
int i)
const
104 void * Object(
const String & key)
const
106 int index = Find(key);
108 return index >= 0 ? objects[index] : NULL;
110 void * Object(
const String & key,
void *(*create_object)())
112 int index = Find(key, create_object);
114 return objects[index];
117 void SetObject(
int i,
void *
object)
121 void SetObject(
const String & key,
void *
object)
126 int Add(
const String & s,
void *
object = NULL);
127 int Find(
const String & s,
void *(*create_object)() = NULL);
128 int Find(
const String & s)
const;
132 const String & operator [](
int i)
const
134 return *(strings[i]);
136 String & operator [](
int i)
138 return *(strings[i]);
142 static void * CreateHash();
144 void Delete(
unsigned int index);
145 void Delete(
const String & key)
150 bool SlotInUse(
int index)
const
152 return strings[index] != NULL;
156 void Print(FILE * file);
157 void Print(
const char * filename);
159 String StringList(
char separator =
',');
162 void ReadLinesFromFile(FILE * file);
163 void ReadLinesFromFile(
const char * filename);
165 void ReadLinesFromFile(
IFILE & file);
171 unsigned int Iterate(
unsigned int key,
const String &
string)
const
173 unsigned int h = key & mask;
175 while (strings[h] != NULL &&
177 (!stringsEqual(*(strings[h]),
string))))
183 void Insert(
unsigned int where,
unsigned int key,
const String &
string)
185 strings[where] =
new String;
186 *(strings[where]) =
string;