Annotation of parser3/src/include/pa_dictionary.h, revision 1.11

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

E-mail: