-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathExplicitStringLists_Wide.pas
141 lines (97 loc) · 4.36 KB
/
ExplicitStringLists_Wide.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{-------------------------------------------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-------------------------------------------------------------------------------}
{===============================================================================
Explicit string lists - Wide
Implementation of list of wide strings.
Version 1.1.3 (2024-05-05)
Last change 2024-05-05
©2017-2024 František Milt
Contacts:
František Milt: frantisek.milt@gmail.com
Support:
If you find this code useful, please consider supporting its author(s) by
making a small donation using the following link(s):
https://www.paypal.me/FMilt
Changelog:
For detailed changelog and history please refer to this git repository:
github.com/TheLazyTomcat/ExplicitStringLists
Dependencies:
AuxClasses - github.com/TheLazyTomcat/Lib.AuxClasses
* AuxExceptions - github.com/TheLazyTomcat/Lib.AuxExceptions
AuxTypes - github.com/TheLazyTomcat/Lib.AuxTypes
* BinaryStreamingLite - github.com/TheLazyTomcat/Lib.BinaryStreamingLite
ListSorters - github.com/TheLazyTomcat/Lib.ListSorters
MemoryBuffer - github.com/TheLazyTomcat/Lib.MemoryBuffer
StaticMemoryStream - github.com/TheLazyTomcat/Lib.StaticMemoryStream
StrRect - github.com/TheLazyTomcat/Lib.StrRect
Library AuxExceptions is required only when rebasing local exception classes
(see symbol ExplicitStringLists_UseAuxExceptions for details).
BinaryStreamingLite can be replaced by full BinaryStreaming.
Library AuxExceptions might also be required as an indirect dependency.
Indirect dependencies:
SimpleCPUID - github.com/TheLazyTomcat/Lib.SimpleCPUID
UInt64Utils - github.com/TheLazyTomcat/Lib.UInt64Utils
WinFileInfo - github.com/TheLazyTomcat/Lib.WinFileInfo
===============================================================================}
unit ExplicitStringLists_Wide;
{$INCLUDE '.\ExplicitStringLists_defs.inc'}
interface
uses
Classes,
AuxTypes,
ExplicitStringLists_Base;
{$DEFINE ESL_Wide}
type
TESLCharType = WideChar;
TESLPCharType = PWideChar;
TESLStringType = WideString;
TESLPStringType = PWideString;
TESLLongStringType = WideString;
type
TWideStringList = class; // forward declaration
TESLClassType = TWideStringList;
TESLWideSortCompareIndex = Function(List: TWideStringList; Idx1,Idx2: Integer): Integer;
TESLWideSortCompareString = Function(List: TWideStringList; const Str1,Str2: TESLStringType): Integer;
TESLSortCompareIndexType = TESLWideSortCompareIndex;
TESLSortCompareStringType = TESLWideSortCompareString;
{$DEFINE ESL_ClassTypes}
{$INCLUDE './ExplicitStringLists.inc'}
{$UNDEF ESL_ClassTypes}
TESLWideItemBinaryIOEvent = procedure(Sender: TObject; Stream: TStream; var Item: TESLListItem) of Object;
TESLWideItemBinaryIOCallback = procedure(Sender: TObject; Stream: TStream; var Item: TESLListItem);
TESLItemBinaryIOEventType = TESLWideItemBinaryIOEvent;
TESLItemBinaryIOCallbackType = TESLWideItemBinaryIOCallback;
TWideStringList = class(TExplicitStringList)
{$DEFINE ESL_ClassDeclaration}
{$INCLUDE './ExplicitStringLists.inc'}
{$UNDEF ESL_ClassDeclaration}
end;
implementation
uses
SysUtils,
StrRect, BinaryStreamingLite, MemoryBuffer, StaticMemoryStream;
{$IFDEF FPC_DisableWarns}
{$DEFINE FPCDWM}
{$DEFINE W5024:={$WARN 5024 OFF}} // Parameter "$1" not used
{$ENDIF}
{===============================================================================
Main implementation
===============================================================================}
const
ESL_IMPLSTR_NAME = 'wide';
//------------------------------------------------------------------------------
{$DEFINE ESL_ClassAuxiliary}
{$INCLUDE './ExplicitStringLists.inc'}
{$UNDEF ESL_ClassAuxiliary}
//------------------------------------------------------------------------------
{$DEFINE ESL_ClassDelimitedTextParser}
{$INCLUDE './ExplicitStringLists.inc'}
{$UNDEF ESL_ClassDelimitedTextParser}
//------------------------------------------------------------------------------
{$DEFINE ESL_ClassImplementation}
{$INCLUDE './ExplicitStringLists.inc'}
{$UNDEF ESL_ClassImplementation}
end.