-
Notifications
You must be signed in to change notification settings - Fork 0
/
uROPSImports.pas
366 lines (305 loc) · 10.3 KB
/
uROPSImports.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
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
unit uROPSImports;
interface
uses
uPSCompiler, uPSRuntime, uROBINMessage, uROIndyHTTPChannel,
uROXMLSerializer, uROIndyTCPChannel, idTcpClient,
uROPSServerLink, uROWinInetHttpChannel;
procedure SIRegisterTROBINMESSAGE(CL: TIFPSPascalCompiler);
procedure SIRegisterTROINDYHTTPCHANNEL(CL: TIFPSPascalCompiler);
procedure SIRegisterTROINDYTCPCHANNEL(CL: TIFPSPascalCompiler);
procedure SIRegisterTIDTCPCLIENT(CL: TIFPSPascalCompiler);
procedure SIRegisterRODLImports(Cl: TIFPSPascalCompiler);
procedure RIRegisterTROBINMESSAGE(Cl: TIFPSRuntimeClassImporter);
procedure RIRegisterTROINDYHTTPCHANNEL(Cl: TIFPSRuntimeClassImporter);
procedure RIRegisterTROINDYTCPCHANNEL(Cl: TIFPSRuntimeClassImporter);
procedure RIRegisterTIDTCPCLIENT(Cl: TIFPSRuntimeClassImporter);
procedure RIRegisterRODLImports(CL: TIFPSRuntimeClassImporter);
(*
Todo:
TROWinInetHTTPChannel = class(TROTransportChannel, IROTransport, IROTCPTransport, IROHTTPTransport)
published
property UserAgent:string read GetUserAgent write SetUserAgent;
property TargetURL : string read fTargetURL write SetTargetURL;
property StoreConnected:boolean read fStoreConnected write fStoreConnected default false;
property KeepConnection:boolean read fKeepConnection write fKeepConnection default false;
end;
*)
type
TPSROIndyTCPModule = class(TPSROModule)
protected
class procedure ExecImp(exec: TIFPSExec; ri: TIFPSRuntimeClassImporter); override;
class procedure CompImp(comp: TIFPSPascalCompiler); override;
end;
TPSROIndyHTTPModule = class(TPSROModule)
protected
class procedure ExecImp(exec: TIFPSExec; ri: TIFPSRuntimeClassImporter); override;
class procedure CompImp(comp: TIFPSPascalCompiler); override;
end;
TPSROBinModule = class(TPSROModule)
protected
class procedure ExecImp(exec: TIFPSExec; ri: TIFPSRuntimeClassImporter); override;
class procedure CompImp(comp: TIFPSPascalCompiler); override;
end;
implementation
{procedure TROSOAPMESSAGESERIALIZATIONOPTIONS_W(Self: TROSOAPMESSAGE;
const T: TXMLSERIALIZATIONOPTIONS);
begin
Self.SERIALIZATIONOPTIONS := T;
end;
procedure TROSOAPMESSAGESERIALIZATIONOPTIONS_R(Self: TROSOAPMESSAGE;
var T: TXMLSERIALIZATIONOPTIONS);
begin
T := Self.SERIALIZATIONOPTIONS;
end;
procedure TROSOAPMESSAGECUSTOMLOCATION_W(Self: TROSOAPMESSAGE; const T: string);
begin
Self.CUSTOMLOCATION := T;
end;
procedure TROSOAPMESSAGECUSTOMLOCATION_R(Self: TROSOAPMESSAGE; var T: string);
begin
T := Self.CUSTOMLOCATION;
end;
procedure TROSOAPMESSAGELIBRARYNAME_W(Self: TROSOAPMESSAGE; const T: string);
begin
Self.LIBRARYNAME := T;
end;
procedure TROSOAPMESSAGELIBRARYNAME_R(Self: TROSOAPMESSAGE; var T: string);
begin
T := Self.LIBRARYNAME;
end; }
procedure TROBINMESSAGEUSECOMPRESSION_W(Self: TROBINMESSAGE; const T: boolean);
begin
Self.USECOMPRESSION := T;
end;
procedure TROBINMESSAGEUSECOMPRESSION_R(Self: TROBINMESSAGE; var T: boolean);
begin
T := Self.USECOMPRESSION;
end;
procedure TROINDYHTTPCHANNELTARGETURL_W(Self: TROINDYHTTPCHANNEL; const T: string);
begin
Self.TARGETURL := T;
end;
procedure TROINDYHTTPCHANNELTARGETURL_R(Self: TROINDYHTTPCHANNEL; var T: string);
begin
T := Self.TARGETURL;
end;
procedure TROINDYTCPCHANNELINDYCLIENT_R(Self: TROINDYTCPCHANNEL; var T: TIdTCPClientBaseClass);
begin
T := Self.INDYCLIENT;
end;
procedure TIDTCPCLIENTPORT_W(Self: TIDTCPCLIENT; const T: integer);
begin
Self.PORT := T;
end;
procedure TIDTCPCLIENTPORT_R(Self: TIdTCPClientBaseClass; var T: integer);
begin
T := TIdIndy10HackClient(Self).PORT;
end;
procedure TIDTCPCLIENTHOST_W(Self: TIdTCPClientBaseClass; const T: string);
begin
TIdIndy10HackClient(Self).HOST := T;
end;
procedure TIDTCPCLIENTHOST_R(Self: TIdTCPClientBaseClass; var T: string);
begin
T := TIdIndy10HackClient(Self).HOST;
end;
{procedure TIDTCPCLIENTBOUNDPORT_W(Self: TIdTCPClientBaseClass; const T: integer);
begin
Self.BOUNDPORT := T;
end;
procedure TIDTCPCLIENTBOUNDPORT_R(Self: TIdTCPClientBaseClass; var T: integer);
begin
T := Self.BOUNDPORT;
end;
procedure TIDTCPCLIENTBOUNDIP_W(Self: TIdTCPClientBaseClass; const T: string);
begin
Self.BOUNDIP := T;
end;
procedure TIDTCPCLIENTBOUNDIP_R(Self: TIdTCPClientBaseClass; var T: string);
begin
T := Self.BOUNDIP;
end;]
procedure TIDTCPCLIENTBOUNDPORTMIN_W(Self: TIdTCPClientBaseClass; const T: integer);
begin
Self.BOUNDPORTMIN := T;
end;
procedure TIDTCPCLIENTBOUNDPORTMIN_R(Self: TIdTCPClientBaseClass; var T: integer);
begin
T := Self.BOUNDPORTMIN;
end;
procedure TIDTCPCLIENTBOUNDPORTMAX_W(Self: TIdTCPClientBaseClass; const T: integer);
begin
Self.BOUNDPORTMAX := T;
end;
procedure TIDTCPCLIENTBOUNDPORTMAX_R(Self: TIdTCPClientBaseClass; var T: integer);
begin
T := Self.BOUNDPORTMAX;
end;
{procedure RIRegisterTROSOAPMESSAGE(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROSOAPMESSAGE) do
begin
RegisterPropertyHelper(@TROSOAPMESSAGELIBRARYNAME_R, @TROSOAPMESSAGELIBRARYNAME_W,
'LIBRARYNAME');
RegisterPropertyHelper(@TROSOAPMESSAGECUSTOMLOCATION_R,
@TROSOAPMESSAGECUSTOMLOCATION_W, 'CUSTOMLOCATION');
RegisterPropertyHelper(@TROSOAPMESSAGESERIALIZATIONOPTIONS_R,
@TROSOAPMESSAGESERIALIZATIONOPTIONS_W, 'SERIALIZATIONOPTIONS');
end;
end; }
procedure RIRegisterTROBINMESSAGE(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROBINMESSAGE) do
begin
RegisterPropertyHelper(@TROBINMESSAGEUSECOMPRESSION_R,
@TROBINMESSAGEUSECOMPRESSION_W, 'USECOMPRESSION');
end;
end;
procedure RIRegisterTROINDYHTTPCHANNEL(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROINDYHTTPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYHTTPCHANNELTARGETURL_R,
@TROINDYHTTPCHANNELTARGETURL_W, 'TARGETURL');
end;
end;
procedure RIRegisterTROINDYTCPCHANNEL(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROINDYTCPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYTCPCHANNELINDYCLIENT_R, nil, 'INDYCLIENT');
end;
end;
procedure RIRegisterTIDTCPCLIENT(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TIdTCPClientBaseClass) do
begin
{RegisterPropertyHelper(@TIDTCPCLIENTBOUNDPORTMAX_R, @TIDTCPCLIENTBOUNDPORTMAX_W,
'BOUNDPORTMAX');
RegisterPropertyHelper(@TIDTCPCLIENTBOUNDPORTMIN_R, @TIDTCPCLIENTBOUNDPORTMIN_W,
'BOUNDPORTMIN');
RegisterPropertyHelper(@TIDTCPCLIENTBOUNDIP_R, @TIDTCPCLIENTBOUNDIP_W, 'BOUNDIP');
RegisterPropertyHelper(@TIDTCPCLIENTBOUNDPORT_R, @TIDTCPCLIENTBOUNDPORT_W,
'BOUNDPORT');}
RegisterPropertyHelper(@TIDTCPCLIENTHOST_R, @TIDTCPCLIENTHOST_W, 'HOST');
RegisterPropertyHelper(@TIDTCPCLIENTPORT_R, @TIDTCPCLIENTPORT_W, 'PORT');
end;
end;
procedure RIRegisterRODLImports(CL: TIFPSRuntimeClassImporter);
begin
RIRegisterTIDTCPCLIENT(Cl);
RIRegisterTROINDYTCPCHANNEL(Cl);
RIRegisterTROINDYHTTPCHANNEL(Cl);
RIRegisterTROBINMESSAGE(Cl);
//RIRegisterTROSOAPMESSAGE(Cl);
end;
function RegClassS(cl: TIFPSPascalCompiler; const InheritsFrom,
ClassName: string): TPSCompileTimeClass;
begin
Result := cl.FindClass(ClassName);
if Result = nil then
Result := cl.AddClassN(cl.FindClass(InheritsFrom), ClassName)
else
Result.ClassInheritsFrom := cl.FindClass(InheritsFrom);
end;
{procedure SIRegisterTROSOAPMESSAGE(CL: TIFPSPascalCompiler);
begin
Cl.addTypeS('TXMLSERIALIZATIONOPTIONS', 'BYTE');
Cl.AddConstantN('XSOWRITEMULTIREFARRAY', 'BYTE').SetInt(1);
Cl.AddConstantN('XSOWRITEMULTIREFOBJECT', 'BYTE').SetInt(2);
Cl.AddConstantN('XSOSENDUNTYPED', 'BYTE').SetInt(4);
with RegClassS(cl, 'TROMESSAGE', 'TROSOAPMESSAGE') do
begin
RegisterProperty('LIBRARYNAME', 'STRING', iptrw);
RegisterProperty('CUSTOMLOCATION', 'STRING', iptrw);
RegisterProperty('SERIALIZATIONOPTIONS', 'TXMLSERIALIZATIONOPTIONS', iptrw);
end;
end;}
procedure SIRegisterTROBINMESSAGE(CL: TIFPSPascalCompiler);
begin
with RegClassS(cl, 'TROMESSAGE', 'TROBINMESSAGE') do
begin
RegisterProperty('USECOMPRESSION', 'BOOLEAN', iptrw);
end;
end;
procedure SIRegisterTROINDYHTTPCHANNEL(CL: TIFPSPascalCompiler);
begin
with RegClassS(cl, 'TROINDYTCPCHANNEL', 'TROINDYHTTPCHANNEL') do
begin
RegisterProperty('TARGETURL', 'STRING', iptrw);
end;
end;
procedure SIRegisterTROINDYTCPCHANNEL(CL: TIFPSPascalCompiler);
begin
with RegClassS(cl, 'TROTRANSPORTCHANNEL', 'TROINDYTCPCHANNEL') do
begin
RegisterProperty('INDYCLIENT', 'TIdTCPClientBaseClass', iptr);
end;
end;
procedure SIRegisterTIDTCPCLIENT(CL: TIFPSPascalCompiler);
begin
with RegClassS(cl, 'TCOMPONENT', 'TIdTCPClientBaseClass') do
begin
RegisterProperty('BOUNDPORTMAX', 'INTEGER', iptrw);
RegisterProperty('BOUNDPORTMIN', 'INTEGER', iptrw);
RegisterProperty('BOUNDIP', 'STRING', iptrw);
RegisterProperty('BOUNDPORT', 'INTEGER', iptrw);
RegisterProperty('HOST', 'STRING', iptrw);
RegisterProperty('PORT', 'INTEGER', iptrw);
end;
end;
procedure SIRegisterRODLImports(Cl: TIFPSPascalCompiler);
begin
SIRegisterTIDTCPCLIENT(Cl);
SIRegisterTROINDYTCPCHANNEL(Cl);
SIRegisterTROINDYHTTPCHANNEL(Cl);
SIRegisterTROBINMESSAGE(Cl);
//SIRegisterTROSOAPMESSAGE(Cl);
end;
{ TPSROIndyTCPModule }
class procedure TPSROIndyTCPModule.CompImp(comp: TIFPSPascalCompiler);
begin
SIRegisterTIDTCPCLIENT(Comp);
SIRegisterTROINDYTCPCHANNEL(Comp);
end;
class procedure TPSROIndyTCPModule.ExecImp(exec: TIFPSExec;
ri: TIFPSRuntimeClassImporter);
begin
RIRegisterTIDTCPCLIENT(ri);
RIRegisterTROINDYTCPCHANNEL(ri);
end;
{ TPSROIndyHTTPModule }
class procedure TPSROIndyHTTPModule.CompImp(comp: TIFPSPascalCompiler);
begin
if Comp.FindClass('TROINDYTCPCHANNEL') = nil then
TPSROIndyTCPModule.CompImp(Comp);
SIRegisterTROINDYHTTPCHANNEL(Comp);
end;
class procedure TPSROIndyHTTPModule.ExecImp(exec: TIFPSExec;
ri: TIFPSRuntimeClassImporter);
begin
if ri.FindClass('TROINDYTCPCHANNEL') = nil then
TPSROIndyTCPModule.ExecImp(exec, ri);
RIRegisterTROINDYHTTPCHANNEL(ri);
end;
{ TPSROSoapModule }
{class procedure TPSROSoapModule.CompImp(comp: TIFPSPascalCompiler);
begin
SIRegisterTROSOAPMESSAGE(comp);
end;
class procedure TPSROSoapModule.ExecImp(exec: TIFPSExec;
ri: TIFPSRuntimeClassImporter);
begin
RIRegisterTROSOAPMESSAGE(ri);
end;}
{ TPSROBinModule }
class procedure TPSROBinModule.CompImp(comp: TIFPSPascalCompiler);
begin
SIRegisterTROBINMESSAGE(Comp);
end;
class procedure TPSROBinModule.ExecImp(exec: TIFPSExec;
ri: TIFPSRuntimeClassImporter);
begin
RIRegisterTROBINMESSAGE(ri);
end;
end.