Warn about "assert X,Y"
[delight/core.git] / dmd2 / stringtable.h
blob1d85994d3c5f30a4f9786cebdfb6053673a0b7fe
1 // Copyright (c) 1999-2008 by Digital Mars
2 // All Rights Reserved
3 // written by Walter Bright
4 // http://www.digitalmars.com
5 // License for redistribution is by either the Artistic License
6 // in artistic.txt, or the GNU General Public License in gnu.txt.
7 // See the included readme.txt for details.
10 #ifndef STRINGTABLE_H
11 #define STRINGTABLE_H
13 #if __SC__
14 #pragma once
15 #endif
17 #include "root.h"
18 #include "dchar.h"
19 #include "lstring.h"
21 struct StringValue
23 union
24 { int intvalue;
25 void *ptrvalue;
26 dchar *string;
28 Lstring lstring;
31 struct StringTable : Object
33 void **table;
34 unsigned count;
35 unsigned tabledim;
37 StringTable(unsigned size = 37);
38 ~StringTable();
40 StringValue *lookup(const dchar *s, unsigned len);
41 StringValue *insert(const dchar *s, unsigned len);
42 StringValue *update(const dchar *s, unsigned len);
44 private:
45 void **search(const dchar *s, unsigned len);
48 #endif