ReactOS  0.4.14-dev-854-gb9426a3
collate.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1999
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Copyright (c) 1999
6  * Boris Fomitchev
7  *
8  * This material is provided "as is", with absolutely no warranty expressed
9  * or implied. Any use is at your own risk.
10  *
11  * Permission to use or copy this software for any purpose is hereby granted
12  * without fee, provided the above notices are retained on all copies.
13  * Permission to modify the code and to distribute modified code is granted,
14  * provided the above notices are retained, and a notice that the code was
15  * modified is included with the above copyright notice.
16  *
17  */
18 #include "stlport_prefix.h"
19 
20 #include <locale>
21 
23 
24 // collate<char>
25 
27 
28 int collate<char>::do_compare(const char* low1, const char* high1,
29  const char* low2, const char* high2) const
30 { return _STLP_PRIV __lexicographical_compare_3way(low1, high1, low2, high2); }
31 
32 string collate<char>::do_transform(const char* low, const char* high) const
33 { return string(low, high); }
34 
35 long collate<char>::do_hash(const char* low, const char* high) const {
36  unsigned long result = 0;
37  for ( ; low < high; ++low)
38  result = 5 * result + *low;
39  return result;
40 }
41 
42 #if !defined (_STLP_NO_WCHAR_T)
43 // collate<wchar_t>
44 
46 
47 int
48 collate<wchar_t>::do_compare(const wchar_t* low1, const wchar_t* high1,
49  const wchar_t* low2, const wchar_t* high2) const
50 { return _STLP_PRIV __lexicographical_compare_3way(low1, high1, low2, high2); }
51 
52 wstring collate<wchar_t>::do_transform(const wchar_t* low, const wchar_t* high) const
53 { return wstring(low, high); }
54 
55 long collate<wchar_t>::do_hash(const wchar_t* low, const wchar_t* high) const {
56  unsigned long result = 0;
57  for ( ; low < high; ++low)
58  result = 5 * result + *low;
59  return result;
60 }
61 #endif
62 
64 
65 
66 // Local Variables:
67 // mode:C++
68 // End:
69 
static __inline int do_hash(unsigned char *name, int len, int size)
Definition: hash.c:63
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_PRIV_NAMESPACE int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2)
Definition: _algobase.c:78
char string[160]
Definition: util.h:11
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
GLuint64EXT * result
Definition: glext.h:11304