00001 //======================================================================== 00002 // 00003 // NameToCharCode.h 00004 // 00005 // Copyright 2001-2003 Glyph & Cog, LLC 00006 // 00007 //======================================================================== 00008 00009 #ifndef NAMETOCHARCODE_H 00010 #define NAMETOCHARCODE_H 00011 00012 #include <aconf.h> 00013 00014 #ifdef USE_GCC_PRAGMAS 00015 #pragma interface 00016 #endif 00017 00018 #include "CharTypes.h" 00019 00020 struct NameToCharCodeEntry; 00021 00022 //------------------------------------------------------------------------ 00023 00024 class NameToCharCode { 00025 public: 00026 00027 NameToCharCode(); 00028 ~NameToCharCode(); 00029 00030 void add(char *name, CharCode c); 00031 CharCode lookup(char *name); 00032 00033 private: 00034 00035 int hash(char *name); 00036 00037 NameToCharCodeEntry *tab; 00038 int size; 00039 int len; 00040 }; 00041 00042 #endif