-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathStringList.inc
281 lines (234 loc) · 9.27 KB
/
StringList.inc
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
//----------------------------------------
// ´úÂëÓÉGenlibVcl¹¤¾ß×Ô¶¯Éú³É¡£
// Copyright ? ying32. All Rights Reserved.
//
//----------------------------------------
function StringList_Create: TStringList; cdecl;
begin
Result := TStringList.Create;
end;
procedure StringList_Free(AObj: TStringList); cdecl;
begin
AObj.Free;
end;
function StringList_Add(AObj: TStringList; S: PWideChar): Integer; cdecl;
begin
Result := AObj.Add(S);
end;
function StringList_AddObject(AObj: TStringList; S: PWideChar; AObject: TObject): Integer; cdecl;
begin
Result := AObj.AddObject(S, AObject);
end;
procedure StringList_Assign(AObj: TStringList; Source: TPersistent); cdecl;
begin
AObj.Assign(Source);
end;
procedure StringList_Clear(AObj: TStringList); cdecl;
begin
AObj.Clear;
end;
procedure StringList_Delete(AObj: TStringList; Index: Integer); cdecl;
begin
AObj.Delete(Index);
end;
function StringList_IndexOf(AObj: TStringList; S: PWideChar): Integer; cdecl;
begin
Result := AObj.IndexOf(S);
end;
procedure StringList_Insert(AObj: TStringList; Index: Integer; S: PWideChar); cdecl;
begin
AObj.Insert(Index, S);
end;
procedure StringList_InsertObject(AObj: TStringList; Index: Integer; S: PWideChar; AObject: TObject); cdecl;
begin
AObj.InsertObject(Index, S, AObject);
end;
procedure StringList_Append(AObj: TStringList; S: PWideChar); cdecl;
begin
AObj.Append(S);
end;
procedure StringList_BeginUpdate(AObj: TStringList); cdecl;
begin
AObj.BeginUpdate;
end;
procedure StringList_EndUpdate(AObj: TStringList); cdecl;
begin
AObj.EndUpdate;
end;
function StringList_Equals(AObj: TStringList; Strings: TStrings): LongBool; cdecl;
begin
Result := AObj.Equals(Strings);
end;
function StringList_IndexOfName(AObj: TStringList; Name: PWideChar): Integer; cdecl;
begin
Result := AObj.IndexOfName(Name);
end;
function StringList_IndexOfObject(AObj: TStringList; AObject: TObject): Integer; cdecl;
begin
Result := AObj.IndexOfObject(AObject);
end;
procedure StringList_LoadFromFile(AObj: TStringList; FileName: PWideChar); cdecl;
begin
AObj.LoadFromFile(FileName);
end;
procedure StringList_LoadFromStream(AObj: TStringList; Stream: TStream); cdecl;
begin
AObj.LoadFromStream(Stream);
end;
procedure StringList_Move(AObj: TStringList; CurIndex: Integer; NewIndex: Integer); cdecl;
begin
AObj.Move(CurIndex, NewIndex);
end;
procedure StringList_SaveToFile(AObj: TStringList; FileName: PWideChar); cdecl;
begin
AObj.SaveToFile(FileName);
end;
procedure StringList_SaveToStream(AObj: TStringList; Stream: TStream); cdecl;
begin
AObj.SaveToStream(Stream);
end;
function StringList_GetNamePath(AObj: TStringList): PWideChar; cdecl;
begin
Result := PWideChar(AObj.GetNamePath);
end;
function StringList_ClassName(AObj: TStringList): PWideChar; cdecl;
begin
Result := ShortstrToPWideChar(AObj.ClassName);
end;
function StringList_GetHashCode(AObj: TStringList): Integer; cdecl;
begin
Result := AObj.GetHashCode;
end;
function StringList_ToString(AObj: TStringList): PWideChar; cdecl;
begin
Result := PWideChar(AObj.ToString);
end;
function StringList_GetSorted(AObj: TStringList): LongBool; cdecl;
begin
Result := AObj.Sorted;
end;
procedure StringList_SetSorted(AObj: TStringList; AValue: LongBool); cdecl;
begin
AObj.Sorted := AValue;
end;
procedure StringList_SetOnChange(AObj: TStringList; AEventId: NativeUInt); stdcall;
begin
if AEventId = 0 then
begin
AObj.OnChange := nil;
TEventClass.Remove(AObj, geChange);
Exit;
end;
AObj.OnChange := TEventClass.OnChange;
TEventClass.Add(AObj, geChange, AEventId);
end;
function StringList_GetCommaText(AObj: TStringList): PWideChar; cdecl;
begin
Result := PWideChar(AObj.CommaText);
end;
procedure StringList_SetCommaText(AObj: TStringList; AValue: PWideChar); cdecl;
begin
AObj.CommaText := AValue;
end;
function StringList_GetDelimiter(AObj: TStringList): Char; cdecl;
begin
Result := AObj.Delimiter;
end;
procedure StringList_SetDelimiter(AObj: TStringList; AValue: Char); cdecl;
begin
AObj.Delimiter := AValue;
end;
function StringList_GetText(AObj: TStringList): PWideChar; cdecl;
begin
Result := PWideChar(AObj.Text);
end;
procedure StringList_SetText(AObj: TStringList; AValue: PWideChar); cdecl;
begin
AObj.Text := AValue;
end;
function StringList_GetWriteBOM(AObj: TStringList): LongBool; cdecl;
begin
Result := AObj.WriteBOM;
end;
procedure StringList_SetWriteBOM(AObj: TStringList; AValue: LongBool); cdecl;
begin
AObj.WriteBOM := AValue;
end;
//function StringList_GetOptions(AObj: TStringList): TStringsOptions; cdecl;
//begin
// Result := AObj.Options;
//end;
//
//procedure StringList_SetOptions(AObj: TStringList; AValue: TStringsOptions); cdecl;
//begin
// AObj.Options := AValue;
//end;
function StringList_GetValues(AObj: TStringList; Name: PWideChar): PWideChar; cdecl;
begin
Result := PWideChar(AObj.Values[Name]);
end;
procedure StringList_SetValues(AObj: TStringList; Name: string; AValue: PWideChar); cdecl;
begin
AObj.Values[Name] := AValue;
end;
function StringList_GetValueFromIndex(AObj: TStringList; Index: Integer): PWideChar; cdecl;
begin
Result := PWideChar(AObj.ValueFromIndex[Index]);
end;
procedure StringList_SetValueFromIndex(AObj: TStringList; Index: Integer; AValue: PWideChar); cdecl;
begin
AObj.ValueFromIndex[Index] := AValue;
end;
function StringList_GetStrings(AObj: TStringList; Index: Integer): PWideChar; cdecl;
begin
Result := PWideChar(AObj.Strings[Index]);
end;
procedure StringList_SetStrings(AObj: TStringList; Index: Integer; AValue: PWideChar); cdecl;
begin
AObj.Strings[Index] := AValue;
end;
exports
StringList_Create {$IFNDEF MSWINDOWS}name '_StringList_Create'{$ENDIF},
StringList_Free {$IFNDEF MSWINDOWS}name '_StringList_Free'{$ENDIF},
StringList_Add {$IFNDEF MSWINDOWS}name '_StringList_Add'{$ENDIF},
StringList_AddObject {$IFNDEF MSWINDOWS}name '_StringList_AddObject'{$ENDIF},
StringList_Assign {$IFNDEF MSWINDOWS}name '_StringList_Assign'{$ENDIF},
StringList_Clear {$IFNDEF MSWINDOWS}name '_StringList_Clear'{$ENDIF},
StringList_Delete {$IFNDEF MSWINDOWS}name '_StringList_Delete'{$ENDIF},
StringList_IndexOf {$IFNDEF MSWINDOWS}name '_StringList_IndexOf'{$ENDIF},
StringList_Insert {$IFNDEF MSWINDOWS}name '_StringList_Insert'{$ENDIF},
StringList_InsertObject {$IFNDEF MSWINDOWS}name '_StringList_InsertObject'{$ENDIF},
StringList_Append {$IFNDEF MSWINDOWS}name '_StringList_Append'{$ENDIF},
StringList_BeginUpdate {$IFNDEF MSWINDOWS}name '_StringList_BeginUpdate'{$ENDIF},
StringList_EndUpdate {$IFNDEF MSWINDOWS}name '_StringList_EndUpdate'{$ENDIF},
StringList_Equals {$IFNDEF MSWINDOWS}name '_StringList_Equals'{$ENDIF},
StringList_IndexOfName {$IFNDEF MSWINDOWS}name '_StringList_IndexOfName'{$ENDIF},
StringList_IndexOfObject {$IFNDEF MSWINDOWS}name '_StringList_IndexOfObject'{$ENDIF},
StringList_LoadFromFile {$IFNDEF MSWINDOWS}name '_StringList_LoadFromFile'{$ENDIF},
StringList_LoadFromStream {$IFNDEF MSWINDOWS}name '_StringList_LoadFromStream'{$ENDIF},
StringList_Move {$IFNDEF MSWINDOWS}name '_StringList_Move'{$ENDIF},
StringList_SaveToFile {$IFNDEF MSWINDOWS}name '_StringList_SaveToFile'{$ENDIF},
StringList_SaveToStream {$IFNDEF MSWINDOWS}name '_StringList_SaveToStream'{$ENDIF},
StringList_GetNamePath {$IFNDEF MSWINDOWS}name '_StringList_GetNamePath'{$ENDIF},
StringList_ClassName {$IFNDEF MSWINDOWS}name '_StringList_ClassName'{$ENDIF},
StringList_GetHashCode {$IFNDEF MSWINDOWS}name '_StringList_GetHashCode'{$ENDIF},
StringList_ToString {$IFNDEF MSWINDOWS}name '_StringList_ToString'{$ENDIF},
StringList_GetSorted {$IFNDEF MSWINDOWS}name '_StringList_GetSorted'{$ENDIF},
StringList_SetSorted {$IFNDEF MSWINDOWS}name '_StringList_SetSorted'{$ENDIF},
StringList_SetOnChange {$IFNDEF MSWINDOWS}name '_StringList_SetOnChange'{$ENDIF},
StringList_GetCommaText {$IFNDEF MSWINDOWS}name '_StringList_GetCommaText'{$ENDIF},
StringList_SetCommaText {$IFNDEF MSWINDOWS}name '_StringList_SetCommaText'{$ENDIF},
StringList_GetDelimiter {$IFNDEF MSWINDOWS}name '_StringList_GetDelimiter'{$ENDIF},
StringList_SetDelimiter {$IFNDEF MSWINDOWS}name '_StringList_SetDelimiter'{$ENDIF},
StringList_GetText {$IFNDEF MSWINDOWS}name '_StringList_GetText'{$ENDIF},
StringList_SetText {$IFNDEF MSWINDOWS}name '_StringList_SetText'{$ENDIF},
StringList_GetWriteBOM {$IFNDEF MSWINDOWS}name '_StringList_GetWriteBOM'{$ENDIF},
StringList_SetWriteBOM {$IFNDEF MSWINDOWS}name '_StringList_SetWriteBOM'{$ENDIF},
//StringList_GetOptions {$IFNDEF MSWINDOWS}name '_StringList_GetOptions'{$ENDIF},
//StringList_SetOptions {$IFNDEF MSWINDOWS}name '_StringList_SetOptions'{$ENDIF},
StringList_GetValues {$IFNDEF MSWINDOWS}name '_StringList_GetValues'{$ENDIF},
StringList_SetValues {$IFNDEF MSWINDOWS}name '_StringList_SetValues'{$ENDIF},
StringList_GetValueFromIndex {$IFNDEF MSWINDOWS}name '_StringList_GetValueFromIndex'{$ENDIF},
StringList_SetValueFromIndex {$IFNDEF MSWINDOWS}name '_StringList_SetValueFromIndex'{$ENDIF},
StringList_GetStrings {$IFNDEF MSWINDOWS}name '_StringList_GetStrings'{$ENDIF},
StringList_SetStrings {$IFNDEF MSWINDOWS}name '_StringList_SetStrings'{$ENDIF};