diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -25,6 +25,7 @@ #include <qlist.h> #include <ctype.h> #include "types.h" +#include "sortdict.h" //-------------------------------------------------------------------- @@ -87,6 +88,33 @@ class TextGeneratorOLImpl : public TextGeneratorIntf //-------------------------------------------------------------------- +/** @brief maps a unicode character code to a list of T::ElementType's + */ +template<class T> +class LetterToIndexMap : public SIntDict<T> +{ + public: + LetterToIndexMap() { SIntDict<T>::setAutoDelete(TRUE); } + int compareItems(QCollection::Item item1, QCollection::Item item2) + { + T *l1=(T *)item1; + T *l2=(T *)item2; + return (int)l1->letter()-(int)l2->letter(); + } + void append(uint letter,typename T::ElementType *elem) + { + T *l = SIntDict<T>::find((int)letter); + if (l==0) + { + l = new T(letter); + SIntDict<T>::inSort((int)letter,l); + } + l->append(elem); + } +}; + +//-------------------------------------------------------------------- + QCString langToString(SrcLangExt lang); QCString getLanguageSpecificSeparator(SrcLangExt lang,bool classScope=FALSE); @@ -411,5 +439,9 @@ bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile); void addDocCrossReference(MemberDef *src,MemberDef *dst); +uint getUtf8Code( const QCString& s, int idx ); +uint getUtf8CodeToLower( const QCString& s, int idx ); +uint getUtf8CodeToUpper( const QCString& s, int idx ); + #endif |