-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathExplicitStringLists.pas
More file actions
128 lines (93 loc) · 4.97 KB
/
ExplicitStringLists.pas
File metadata and controls
128 lines (93 loc) · 4.97 KB
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
{-------------------------------------------------------------------------------
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
This library/framework implements and provides string list classes, where
the individual items/strings have explicitly defined type - that is, they
are NOT of default type String, which might be defined differently
depending on compiler and its settings.
The classes are created to be maximally similar in function and interface
to a standard TStrings and TStringList classes, but are completely
unrelated to them.
They are meant for situation, where there is a need for storing strings of
type that differs from default type String in a list, and any implicit or
explicit conversion is undesirable or impossible.
Individual classes are implemented on the same codebase using template and
type aliases. It is not done using generics because of backward
compatibility with compilers that do not support generics.
At this moment, lists for the following string types are implemented:
ShortString - TShortStringList in ExplicitStringLists_Short.pas
AnsiString - TAnsiStringList in ExplicitStringLists_Ansi.pas
UTF8String - TUTF8StringList in ExplicitStringLists_UTF8.pas
WideString - TWideStringList in ExplicitStringLists_Wide.pas
UnicodeString - TUnicodeStringList in ExplicitStringLists_Unicode.pas
String - TDefaultStringList in ExplicitStringLists_Default.pas
UCS4String - TUCS4StringList in ExplicitStringLists_UCS4.pas
NOTE - TDefaultStringList is pretty much identical to standard TStringList,
and can be, to some extent, used as its replacement.
Note that this unit does not implement anything, it is only forwarding list
classes that otherwise reside in their own separate units.
Also, some other types that might be needed, eg. enumerated types or
records, are declared in ExplicitStringLists_Base or in respective units
for each class.
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;
{$INCLUDE '.\ExplicitStringLists_defs.inc'}
interface
uses
ExplicitStringLists_Base,
ExplicitStringLists_Short,
ExplicitStringLists_Ansi,
ExplicitStringLists_UTF8,
ExplicitStringLists_Wide,
ExplicitStringLists_Unicode,
ExplicitStringLists_Default,
ExplicitStringLists_UCS4;
{===============================================================================
Forwarded classes
===============================================================================}
type
// common ancestor
TExplicitStringList = ExplicitStringLists_Base.TExplicitStringList;
// specialized classes...
TShortStringList = ExplicitStringLists_Short.TShortStringList;
TAnsiStringList = ExplicitStringLists_Ansi.TAnsiStringList;
TUTF8StringList = ExplicitStringLists_UTF8.TUTF8StringList;
TWideStringList = ExplicitStringLists_Wide.TWideStringList;
TUnicodeStringList = ExplicitStringLists_Unicode.TUnicodeStringList;
TDefaultStringList = ExplicitStringLists_Default.TDefaultStringList;
TUCS4StringList = ExplicitStringLists_UCS4.TUCS4StringList;
implementation
end.