]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | //======================================================================== |
2 | // | |
3 | // NameToCharCode.h | |
4 | // | |
5 | // Copyright 2001-2003 Glyph & Cog, LLC | |
6 | // | |
7 | //======================================================================== | |
8 | ||
9 | #ifndef NAMETOCHARCODE_H | |
10 | #define NAMETOCHARCODE_H | |
11 | ||
12 | #include <config.h> | |
13 | ||
14 | #ifdef USE_GCC_PRAGMAS | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "CharTypes.h" | |
19 | ||
20 | struct NameToCharCodeEntry; | |
21 | ||
22 | //------------------------------------------------------------------------ | |
23 | ||
24 | class NameToCharCode { | |
25 | public: | |
26 | ||
27 | NameToCharCode(); | |
28 | ~NameToCharCode(); | |
29 | ||
30 | void add(char *name, CharCode c); | |
31 | CharCode lookup(char *name); | |
32 | ||
33 | private: | |
34 | ||
35 | int hash(char *name); | |
36 | ||
37 | NameToCharCodeEntry *tab; | |
38 | int size; | |
39 | int len; | |
40 | }; | |
41 | ||
42 | #endif |