]>
Commit | Line | Data |
---|---|---|
b93d05be | 1 | //======================================================================== |
2 | // | |
3 | // NameToCharCode.h | |
4 | // | |
1d9595ab | 5 | // Copyright 2001-2003 Glyph & Cog, LLC |
b93d05be | 6 | // |
7 | //======================================================================== | |
8 | ||
9 | #ifndef NAMETOCHARCODE_H | |
10 | #define NAMETOCHARCODE_H | |
11 | ||
ae65da6c | 12 | #include <config.h> |
13 | ||
14 | #ifdef USE_GCC_PRAGMAS | |
b93d05be | 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 | ||
ae65da6c | 30 | void add(char *name, CharCode c); |
31 | CharCode lookup(char *name); | |
b93d05be | 32 | |
33 | private: | |
34 | ||
ae65da6c | 35 | int hash(char *name); |
b93d05be | 36 | |
37 | NameToCharCodeEntry *tab; | |
38 | int size; | |
39 | int len; | |
40 | }; | |
41 | ||
42 | #endif |