Annotation of parser3/src/include/pa_dictionary.h, revision 1.4
1.1 parser 1: /** @file
2: Parser: dictionary class decl.
3:
4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
5:
6: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
7:
1.4 ! parser 8: $Id: pa_dictionary.h,v 1.3 2001/08/28 10:32:08 parser Exp $
1.1 parser 9: */
10:
11: #ifndef PA_DICTIONARY_H
12: #define PA_DICTIONARY_H
13:
14: #include "pa_config_includes.h"
15: #include "pa_table.h"
16:
17: /// simple dictionary, speding up lookups on contained two columned table
18: class Dictionary : public Pooled {
19: public:
20:
21: /// construct wrapper, grabbing first letters of first column into @b first
1.2 parser 22: Dictionary(Table& atable, double amin_ratio=1);
23:
24: /// get max ratio
25: double max_ratio() { return fmax_ratio; }
1.1 parser 26:
27: /// find first row that contains string in first column which starts @b src
28: void* first_that_starts(const char *src) const;
29:
30: /// where this table came from, may be NULL. proxy to Table
31: const String *origin_string() { return table.origin_string(); }
32:
1.2 parser 33: private:
1.1 parser 34:
1.2 parser 35: Table& table;
36: double fmax_ratio;
1.1 parser 37:
38: private:
39:
1.2 parser 40: int starting_line_of[0x100]; int constructor_line;
1.1 parser 41:
1.4 ! parser 42: static void add_first(Array::Item *value, void *info);
1.1 parser 43: };
44:
45: #endif
E-mail: