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