1 // Copyright 2009 The Archiveopteryx Developers <info@aox.org> 2 3 #include "dict.h" 4 5 #include "allocator.h" 6 7 8 /*! \class Dict dict.h 9 The Dict class provides a simple string-to-object dictionary. 10 11 It is optimized for simplicity, and for extremely fast lookups when 12 the number of items can be estimated in advance. Its other 13 facilities are somewhat primitive. There is no iterator, for 14 example, and no way to remove an object from the dictionary. 15 16 An item can be added with insert(), retrieved with find() or the 17 presence of an item can be tested with contains(). That's it. 18 */ 19 20 21 /*! \fn Dict::Dict() 22 Creates an empty dictionary. 23 */ 24 25 /*! \fn T * Dict::find( const EString &s ) const 26 Looks for the object identified by \a s in the dictionary, and 27 returns a pointer to it (or 0 if no such object was found). 28 */ 29 30 /*! \fn void Dict::insert( const EString &s, T* r ) 31 Inserts the object \a r into the dictionary, identified by the 32 string \a s. 33 */ 34 35 /*! \fn bool Dict::contains( const EString &s ) const 36 Returns true if an object identified by \a s exists in the 37 dictionary, and false otherwise. 38 */ 39 40 /*! \class UDict dict.h 41 A Dict that takes UString keys. 42 */ 43 44 /*! \fn UDict::UDict() 45 Creates an empty dictionary. 46 */ 47 48 /*! \fn T * UDict::find( const UString &s ) const 49 Looks for the object identified by \a s in the dictionary, and 50 returns a pointer to it (or 0 if no such object was found). 51 */ 52 53 /*! \fn void UDict::insert( const UString &s, T* r ) 54 Inserts the object \a r into the dictionary, identified by the 55 UString \a s. 56 */ 57 58 /*! \fn bool UDict::contains( const UString &s ) const 59 Returns true if an object identified by \a s exists in the 60 dictionary, and false otherwise. 61 */ 62