util/dsymtable.hh
changeset 972 bc90dd4bbf4f
parent 723 d475ae61c7f8
equal deleted inserted replaced
971:8aee27d46208 972:bc90dd4bbf4f
    42 #include <string>
    42 #include <string>
    43 
    43 
    44 
    44 
    45 
    45 
    46 
    46 
    47 template<typename value_type, value_type null_value> class dsymtable_c {
    47 template<typename value_type> class dsymtable_c {
    48   /* Case insensitive string compare copied from
    48   /* Case insensitive string compare copied from
    49    * "The C++ Programming Language" - 3rd Edition
    49    * "The C++ Programming Language" - 3rd Edition
    50    * by Bjarne Stroustrup, ISBN 0201889544.
    50    * by Bjarne Stroustrup, ISBN 0201889544.
    51    */
    51    */
    52   class nocase_c {
    52   class nocase_c {
    90     /* Determine how many entries are associated to key identifier_str */ 
    90     /* Determine how many entries are associated to key identifier_str */ 
    91     /* returns: 0 if no entry is found, 1 if 1 entry is found, ..., n if n entries are found */
    91     /* returns: 0 if no entry is found, 1 if 1 entry is found, ..., n if n entries are found */
    92     int count(const char *identifier_str)    {return _base.count(identifier_str);}
    92     int count(const char *identifier_str)    {return _base.count(identifier_str);}
    93     int count(const symbol_c *symbol)        {return count(symbol_to_string(symbol));}
    93     int count(const symbol_c *symbol)        {return count(symbol_to_string(symbol));}
    94     
    94     
    95     /* Search for an entry. Will return end_value() if not found */
       
    96     value_t end_value(void)                          {return null_value;}
       
    97     value_t find_value(const char *identifier_str);
       
    98     value_t find_value(const symbol_c *symbol)       {return find_value(symbol_to_string(symbol));}
       
    99 
       
   100     /* Search for an entry associated with identifier_str. Will return end() if not found */
    95     /* Search for an entry associated with identifier_str. Will return end() if not found */
   101     iterator find(const char *identifier_str)        {return _base.find(identifier_str);}
    96     iterator find(const char *identifier_str)        {return _base.find(identifier_str);}
   102     iterator find(const symbol_c *symbol)            {return find(symbol_to_string(symbol));}
    97     iterator find(const symbol_c *symbol)            {return find(symbol_to_string(symbol));}
   103     
    98     
   104     /* Search for the first entry associated with (i.e. with key ==) identifier_str. Will return end() if not found (NOTE: end() != end_value()) */
    99     /* Search for the first entry associated with (i.e. with key ==) identifier_str. Will return end() if not found (NOTE: end() != end_value()) */