-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDGL_WideStringCaseInsensitive.pas
99 lines (81 loc) · 2.99 KB
/
DGL_WideStringCaseInsensitive.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
(*
* Copyright (c) 2004
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*)
//------------------------------------------------------------------------------
// 具现化的大小写不敏感的WideString类型的声明
// Create by HouSisong, 2006.10.21
//------------------------------------------------------------------------------
unit DGL_WideStringCaseInsensitive;
interface
uses
SysUtils;
{$I DGLCfg.inc_h}
const
_NULL_Value:WideString='';
type
_ValueType = WideString; //大小写不敏感的String
function _HashValue(const Key: _ValueType):Cardinal;{$ifdef _DGL_Inline} inline; {$endif}//Hash函数
{$define _DGL_Compare} //比较函数
function _IsEqual(const a,b :_ValueType):boolean;{$ifdef _DGL_Inline} inline; {$endif} //result:=(a=b);
function _IsLess(const a,b :_ValueType):boolean; {$ifdef _DGL_Inline} inline; {$endif} //result:=(a<b); 默认排序准则
{$I DGL.inc_h}
type
TCIWStrAlgorithms = _TAlgorithms;
ICIWStrIterator = _IIterator;
ICIWStrContainer = _IContainer;
ICIWStrSerialContainer = _ISerialContainer;
ICIWStrVector = _IVector;
ICIWStrList = _IList;
ICIWStrDeque = _IDeque;
ICIWStrStack = _IStack;
ICIWStrQueue = _IQueue;
ICIWStrPriorityQueue = _IPriorityQueue;
TCIWStrVector = _TVector;
TCIWStrDeque = _TDeque;
TCIWStrList = _TList;
ICIWStrVectorIterator = _IVectorIterator; //速度比_IIterator稍快一点:)
ICIWStrDequeIterator = _IDequeIterator; //速度比_IIterator稍快一点:)
ICIWStrListIterator = _IListIterator; //速度比_IIterator稍快一点:)
TCIWStrStack = _TStack;
TCIWStrQueue = _TQueue;
TCIWStrPriorityQueue = _TPriorityQueue;
//
ICIWStrMapIterator = _IMapIterator;
ICIWStrMap = _IMap;
ICIWStrMultiMap = _IMultiMap;
TCIWStrSet = _TSet;
TCIWStrMultiSet = _TMultiSet;
TCIWStrMap = _TMap;
TCIWStrMultiMap = _TMultiMap;
TCIWStrHashSet = _THashSet;
TCIWStrHashMultiSet = _THashMultiSet;
TCIWStrHashMap = _THashMap;
TCIWStrHashMultiMap = _THashMultiMap;
implementation
uses
HashFunctions;
function _HashValue(const Key :_ValueType):Cardinal; overload;
begin
result:=HashValue_WideStrCaseInsensitive(Key);
end;
function _IsEqual(const a,b :_ValueType):boolean; //result:=(a=b);
begin
result:=IsEqual_WideStrCaseInsensitive(a,b);
end;
function _IsLess(const a,b :_ValueType):boolean; //result:=(a<b); 默认排序准则
begin
result:=IsLess_WideStrCaseInsensitive(a,b);
end;
{$I DGL.inc_pas}
end.