summaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-09-14 15:11:20 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-09-15 18:12:34 (GMT)
commitbca6baee6685b489c36abec5a3b550921294e228 (patch)
treea9f2f6d2622e8aba8beed7477e87d7c9c7a468e1 /src/util.h
parentf6bc941e73bd562b15705f7bc3c958267f75f842 (diff)
downloadDoxygen-bca6baee6685b489c36abec5a3b550921294e228.zip
Doxygen-bca6baee6685b489c36abec5a3b550921294e228.tar.gz
Doxygen-bca6baee6685b489c36abec5a3b550921294e228.tar.bz2
Bug 705910 - Indexing and searching cannot treat non ASCII identifiers
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 1aba005..0cbe450 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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