• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

  • libkonq
konq_string_compare.h
1 #ifndef KONQ_STRING_COMPARE_H
2 #define KONQ_STRING_COMPARE_H
3 
4 #include "konq_sort_constants.h"
5 
6 static inline int stringCompare(
7  const TextSortOrder sortorder,
8  const TQString& a,
9  const TQString& b
10 )
11 {
12  // Our caller probably determined sortorder from KonqPropsView::getSortOrder()
13  // but we have a reasonable fallback position for bogus values.
14 
15  switch(sortorder) {
16 
17  case UNICODE_UNMODIFIED:
18  /*
19  * Strictly character code(point) numeric comparison as defined
20  * by the Unicode Standard that is backward compatible with the
21  * the ASCII standard.
22  . */
23  return a.compare( b );
24  break;
25 
26  case UNICODE_CASEINSENSITIVE:
27  /*
28  * This is the traditional "case-insensitive" variation on character
29  * code order that ensures that ASCII lowercase and uppercase alphabetic
30  * characters are are grouped together instead of being separated by
31  * non-alphabetic ASCII characters [ \ ] ^ _ `
32  */
33  return a.lower().compare( b.lower() );
34  break;
35 
36  case LOCALE_UNMODIFIED:
37  /*
38  * This is the pure locale-aware comparison as defined by ICU.
39  * Note: if LC_COLLATE == 'C' or 'Posix', this will produce same
40  * result as UNICODE_UNMODIFIED.
41  */
42  return a.localeAwareCompare( b );
43  break;
44 
45  default: // Treat as UNICODE_UNMODIFIED
46  return a.compare( b );
47  break;
48  }
49 }
50 
51 #endif // KONQ_STRING_COMPARE_H

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.9.1
This website is maintained by Timothy Pearson.