-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVBScript_RegExp_55_TLB.pas
More file actions
1246 lines (1103 loc) · 40.7 KB
/
VBScript_RegExp_55_TLB.pas
File metadata and controls
1246 lines (1103 loc) · 40.7 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
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit VBScript_RegExp_55_TLB;
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// $Rev: 17244 $
// File generated on 21.10.2011 15:21:46 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\Windows\system32\vbscript.dll\3 (1)
// LIBID: {3F4DACA7-160D-11D2-A8E9-00104B365C9F}
// LCID: 0
// Helpfile:
// HelpString: Microsoft VBScript Regular Expressions 5.5
// DepndLst:
// (1) v2.0 stdole, (C:\Windows\system32\stdole2.tlb)
// Errors:
// Error creating palette bitmap of (TRegExp) : Server C:\Windows\system32\vbscript.dll contains no icons
// Error creating palette bitmap of (TMatch) : Server C:\Windows\system32\vbscript.dll contains no icons
// Error creating palette bitmap of (TMatchCollection) : Server C:\Windows\system32\vbscript.dll contains no icons
// Error creating palette bitmap of (TSubMatches) : Server C:\Windows\system32\vbscript.dll contains no icons
// ************************************************************************ //
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
{$ALIGN 4}
interface
uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants;
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
VBScript_RegExp_55MajorVersion = 5;
VBScript_RegExp_55MinorVersion = 5;
LIBID_VBScript_RegExp_55: TGUID = '{3F4DACA7-160D-11D2-A8E9-00104B365C9F}';
IID_IRegExp: TGUID = '{3F4DACA0-160D-11D2-A8E9-00104B365C9F}';
IID_IMatch: TGUID = '{3F4DACA1-160D-11D2-A8E9-00104B365C9F}';
IID_IMatchCollection: TGUID = '{3F4DACA2-160D-11D2-A8E9-00104B365C9F}';
IID_IRegExp2: TGUID = '{3F4DACB0-160D-11D2-A8E9-00104B365C9F}';
IID_IMatch2: TGUID = '{3F4DACB1-160D-11D2-A8E9-00104B365C9F}';
IID_IMatchCollection2: TGUID = '{3F4DACB2-160D-11D2-A8E9-00104B365C9F}';
IID_ISubMatches: TGUID = '{3F4DACB3-160D-11D2-A8E9-00104B365C9F}';
CLASS_RegExp: TGUID = '{3F4DACA4-160D-11D2-A8E9-00104B365C9F}';
CLASS_Match: TGUID = '{3F4DACA5-160D-11D2-A8E9-00104B365C9F}';
CLASS_MatchCollection: TGUID = '{3F4DACA6-160D-11D2-A8E9-00104B365C9F}';
CLASS_SubMatches: TGUID = '{3F4DACC0-160D-11D2-A8E9-00104B365C9F}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
IRegExp = interface;
IRegExpDisp = dispinterface;
IMatch = interface;
IMatchDisp = dispinterface;
IMatchCollection = interface;
IMatchCollectionDisp = dispinterface;
IRegExp2 = interface;
IRegExp2Disp = dispinterface;
IMatch2 = interface;
IMatch2Disp = dispinterface;
IMatchCollection2 = interface;
IMatchCollection2Disp = dispinterface;
ISubMatches = interface;
ISubMatchesDisp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
RegExp = IRegExp2;
Match = IMatch2;
MatchCollection = IMatchCollection2;
SubMatches = ISubMatches;
// *********************************************************************//
// Interface: IRegExp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACA0-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IRegExp = interface(IDispatch)
['{3F4DACA0-160D-11D2-A8E9-00104B365C9F}']
function Get_Pattern: WideString; safecall;
procedure Set_Pattern(const pPattern: WideString); safecall;
function Get_IgnoreCase: WordBool; safecall;
procedure Set_IgnoreCase(pIgnoreCase: WordBool); safecall;
function Get_Global: WordBool; safecall;
procedure Set_Global(pGlobal: WordBool); safecall;
function Execute(const sourceString: WideString): IDispatch; safecall;
function Test(const sourceString: WideString): WordBool; safecall;
function Replace(const sourceString: WideString; const replaceString: WideString): WideString; safecall;
property Pattern: WideString read Get_Pattern write Set_Pattern;
property IgnoreCase: WordBool read Get_IgnoreCase write Set_IgnoreCase;
property Global: WordBool read Get_Global write Set_Global;
end;
// *********************************************************************//
// DispIntf: IRegExpDisp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACA0-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IRegExpDisp = dispinterface
['{3F4DACA0-160D-11D2-A8E9-00104B365C9F}']
property Pattern: WideString dispid 10001;
property IgnoreCase: WordBool dispid 10002;
property Global: WordBool dispid 10003;
function Execute(const sourceString: WideString): IDispatch; dispid 10004;
function Test(const sourceString: WideString): WordBool; dispid 10005;
function Replace(const sourceString: WideString; const replaceString: WideString): WideString; dispid 10006;
end;
// *********************************************************************//
// Interface: IMatch
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACA1-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatch = interface(IDispatch)
['{3F4DACA1-160D-11D2-A8E9-00104B365C9F}']
function Get_Value: WideString; safecall;
function Get_FirstIndex: Integer; safecall;
function Get_Length: Integer; safecall;
property Value: WideString read Get_Value;
property FirstIndex: Integer read Get_FirstIndex;
property Length: Integer read Get_Length;
end;
// *********************************************************************//
// DispIntf: IMatchDisp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACA1-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatchDisp = dispinterface
['{3F4DACA1-160D-11D2-A8E9-00104B365C9F}']
property Value: WideString readonly dispid 0;
property FirstIndex: Integer readonly dispid 10001;
property Length: Integer readonly dispid 10002;
end;
// *********************************************************************//
// Interface: IMatchCollection
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACA2-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatchCollection = interface(IDispatch)
['{3F4DACA2-160D-11D2-A8E9-00104B365C9F}']
function Get_Item(index: Integer): IDispatch; safecall;
function Get_Count: Integer; safecall;
function Get__NewEnum: IUnknown; safecall;
property Item[index: Integer]: IDispatch read Get_Item;
property Count: Integer read Get_Count;
property _NewEnum: IUnknown read Get__NewEnum;
end;
// *********************************************************************//
// DispIntf: IMatchCollectionDisp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACA2-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatchCollectionDisp = dispinterface
['{3F4DACA2-160D-11D2-A8E9-00104B365C9F}']
property Item[index: Integer]: IDispatch readonly dispid 10001;
property Count: Integer readonly dispid 1;
property _NewEnum: IUnknown readonly dispid -4;
end;
// *********************************************************************//
// Interface: IRegExp2
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB0-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IRegExp2 = interface(IDispatch)
['{3F4DACB0-160D-11D2-A8E9-00104B365C9F}']
function Get_Pattern: WideString; safecall;
procedure Set_Pattern(const pPattern: WideString); safecall;
function Get_IgnoreCase: WordBool; safecall;
procedure Set_IgnoreCase(pIgnoreCase: WordBool); safecall;
function Get_Global: WordBool; safecall;
procedure Set_Global(pGlobal: WordBool); safecall;
function Get_Multiline: WordBool; safecall;
procedure Set_Multiline(pMultiline: WordBool); safecall;
function Execute(const sourceString: WideString): IDispatch; safecall;
function Test(const sourceString: WideString): WordBool; safecall;
function Replace(const sourceString: WideString; replaceVar: OleVariant): WideString; safecall;
property Pattern: WideString read Get_Pattern write Set_Pattern;
property IgnoreCase: WordBool read Get_IgnoreCase write Set_IgnoreCase;
property Global: WordBool read Get_Global write Set_Global;
property Multiline: WordBool read Get_Multiline write Set_Multiline;
end;
// *********************************************************************//
// DispIntf: IRegExp2Disp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB0-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IRegExp2Disp = dispinterface
['{3F4DACB0-160D-11D2-A8E9-00104B365C9F}']
property Pattern: WideString dispid 10001;
property IgnoreCase: WordBool dispid 10002;
property Global: WordBool dispid 10003;
property Multiline: WordBool dispid 10007;
function Execute(const sourceString: WideString): IDispatch; dispid 10004;
function Test(const sourceString: WideString): WordBool; dispid 10005;
function Replace(const sourceString: WideString; replaceVar: OleVariant): WideString; dispid 10006;
end;
// *********************************************************************//
// Interface: IMatch2
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB1-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatch2 = interface(IDispatch)
['{3F4DACB1-160D-11D2-A8E9-00104B365C9F}']
function Get_Value: WideString; safecall;
function Get_FirstIndex: Integer; safecall;
function Get_Length: Integer; safecall;
function Get_SubMatches: IDispatch; safecall;
property Value: WideString read Get_Value;
property FirstIndex: Integer read Get_FirstIndex;
property Length: Integer read Get_Length;
property SubMatches: IDispatch read Get_SubMatches;
end;
// *********************************************************************//
// DispIntf: IMatch2Disp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB1-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatch2Disp = dispinterface
['{3F4DACB1-160D-11D2-A8E9-00104B365C9F}']
property Value: WideString readonly dispid 0;
property FirstIndex: Integer readonly dispid 10001;
property Length: Integer readonly dispid 10002;
property SubMatches: IDispatch readonly dispid 10003;
end;
// *********************************************************************//
// Interface: IMatchCollection2
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB2-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatchCollection2 = interface(IDispatch)
['{3F4DACB2-160D-11D2-A8E9-00104B365C9F}']
function Get_Item(index: Integer): IDispatch; safecall;
function Get_Count: Integer; safecall;
function Get__NewEnum: IUnknown; safecall;
property Item[index: Integer]: IDispatch read Get_Item; default;
property Count: Integer read Get_Count;
property _NewEnum: IUnknown read Get__NewEnum;
end;
// *********************************************************************//
// DispIntf: IMatchCollection2Disp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB2-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
IMatchCollection2Disp = dispinterface
['{3F4DACB2-160D-11D2-A8E9-00104B365C9F}']
property Item[index: Integer]: IDispatch readonly dispid 0; default;
property Count: Integer readonly dispid 1;
property _NewEnum: IUnknown readonly dispid -4;
end;
// *********************************************************************//
// Interface: ISubMatches
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB3-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
ISubMatches = interface(IDispatch)
['{3F4DACB3-160D-11D2-A8E9-00104B365C9F}']
function Get_Item(index: Integer): OleVariant; safecall;
function Get_Count: Integer; safecall;
function Get__NewEnum: IUnknown; safecall;
property Item[index: Integer]: OleVariant read Get_Item; default;
property Count: Integer read Get_Count;
property _NewEnum: IUnknown read Get__NewEnum;
end;
// *********************************************************************//
// DispIntf: ISubMatchesDisp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {3F4DACB3-160D-11D2-A8E9-00104B365C9F}
// *********************************************************************//
ISubMatchesDisp = dispinterface
['{3F4DACB3-160D-11D2-A8E9-00104B365C9F}']
property Item[index: Integer]: OleVariant readonly dispid 0; default;
property Count: Integer readonly dispid 1;
property _NewEnum: IUnknown readonly dispid -4;
end;
// *********************************************************************//
// The Class CoRegExp provides a Create and CreateRemote method to
// create instances of the default interface IRegExp2 exposed by
// the CoClass RegExp. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoRegExp = class
class function Create: IRegExp2;
class function CreateRemote(const MachineName: string): IRegExp2;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TRegExp
// Help String :
// Default Interface: IRegExp2
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TRegExpProperties= class;
{$ENDIF}
TRegExp = class(TOleServer)
private
FIntf: IRegExp2;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TRegExpProperties;
function GetServerProperties: TRegExpProperties;
{$ENDIF}
function GetDefaultInterface: IRegExp2;
protected
procedure InitServerData; override;
function Get_Pattern: WideString;
procedure Set_Pattern(const pPattern: WideString);
function Get_IgnoreCase: WordBool;
procedure Set_IgnoreCase(pIgnoreCase: WordBool);
function Get_Global: WordBool;
procedure Set_Global(pGlobal: WordBool);
function Get_Multiline: WordBool;
procedure Set_Multiline(pMultiline: WordBool);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IRegExp2);
procedure Disconnect; override;
function Execute(const sourceString: WideString): IDispatch;
function Test(const sourceString: WideString): WordBool;
function Replace(const sourceString: WideString; replaceVar: OleVariant): WideString;
property DefaultInterface: IRegExp2 read GetDefaultInterface;
property Pattern: WideString read Get_Pattern write Set_Pattern;
property IgnoreCase: WordBool read Get_IgnoreCase write Set_IgnoreCase;
property Global: WordBool read Get_Global write Set_Global;
property Multiline: WordBool read Get_Multiline write Set_Multiline;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TRegExpProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TRegExp
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TRegExpProperties = class(TPersistent)
private
FServer: TRegExp;
function GetDefaultInterface: IRegExp2;
constructor Create(AServer: TRegExp);
protected
function Get_Pattern: WideString;
procedure Set_Pattern(const pPattern: WideString);
function Get_IgnoreCase: WordBool;
procedure Set_IgnoreCase(pIgnoreCase: WordBool);
function Get_Global: WordBool;
procedure Set_Global(pGlobal: WordBool);
function Get_Multiline: WordBool;
procedure Set_Multiline(pMultiline: WordBool);
public
property DefaultInterface: IRegExp2 read GetDefaultInterface;
published
property Pattern: WideString read Get_Pattern write Set_Pattern;
property IgnoreCase: WordBool read Get_IgnoreCase write Set_IgnoreCase;
property Global: WordBool read Get_Global write Set_Global;
property Multiline: WordBool read Get_Multiline write Set_Multiline;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoMatch provides a Create and CreateRemote method to
// create instances of the default interface IMatch2 exposed by
// the CoClass Match. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoMatch = class
class function Create: IMatch2;
class function CreateRemote(const MachineName: string): IMatch2;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TMatch
// Help String :
// Default Interface: IMatch2
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (0)
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TMatchProperties= class;
{$ENDIF}
TMatch = class(TOleServer)
private
FIntf: IMatch2;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TMatchProperties;
function GetServerProperties: TMatchProperties;
{$ENDIF}
function GetDefaultInterface: IMatch2;
protected
procedure InitServerData; override;
function Get_Value: WideString;
function Get_FirstIndex: Integer;
function Get_Length: Integer;
function Get_SubMatches: IDispatch;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IMatch2);
procedure Disconnect; override;
property DefaultInterface: IMatch2 read GetDefaultInterface;
property Value: WideString read Get_Value;
property FirstIndex: Integer read Get_FirstIndex;
property Length: Integer read Get_Length;
property SubMatches: IDispatch read Get_SubMatches;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TMatchProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TMatch
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TMatchProperties = class(TPersistent)
private
FServer: TMatch;
function GetDefaultInterface: IMatch2;
constructor Create(AServer: TMatch);
protected
function Get_Value: WideString;
function Get_FirstIndex: Integer;
function Get_Length: Integer;
function Get_SubMatches: IDispatch;
public
property DefaultInterface: IMatch2 read GetDefaultInterface;
published
end;
{$ENDIF}
// *********************************************************************//
// The Class CoMatchCollection provides a Create and CreateRemote method to
// create instances of the default interface IMatchCollection2 exposed by
// the CoClass MatchCollection. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoMatchCollection = class
class function Create: IMatchCollection2;
class function CreateRemote(const MachineName: string): IMatchCollection2;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TMatchCollection
// Help String :
// Default Interface: IMatchCollection2
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (0)
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TMatchCollectionProperties= class;
{$ENDIF}
TMatchCollection = class(TOleServer)
private
FIntf: IMatchCollection2;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TMatchCollectionProperties;
function GetServerProperties: TMatchCollectionProperties;
{$ENDIF}
function GetDefaultInterface: IMatchCollection2;
protected
procedure InitServerData; override;
function Get_Item(index: Integer): IDispatch;
function Get_Count: Integer;
function Get__NewEnum: IUnknown;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IMatchCollection2);
procedure Disconnect; override;
property DefaultInterface: IMatchCollection2 read GetDefaultInterface;
property Item[index: Integer]: IDispatch read Get_Item; default;
property Count: Integer read Get_Count;
property _NewEnum: IUnknown read Get__NewEnum;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TMatchCollectionProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TMatchCollection
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TMatchCollectionProperties = class(TPersistent)
private
FServer: TMatchCollection;
function GetDefaultInterface: IMatchCollection2;
constructor Create(AServer: TMatchCollection);
protected
function Get_Item(index: Integer): IDispatch;
function Get_Count: Integer;
function Get__NewEnum: IUnknown;
public
property DefaultInterface: IMatchCollection2 read GetDefaultInterface;
published
end;
{$ENDIF}
// *********************************************************************//
// The Class CoSubMatches provides a Create and CreateRemote method to
// create instances of the default interface ISubMatches exposed by
// the CoClass SubMatches. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoSubMatches = class
class function Create: ISubMatches;
class function CreateRemote(const MachineName: string): ISubMatches;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TSubMatches
// Help String :
// Default Interface: ISubMatches
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (0)
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TSubMatchesProperties= class;
{$ENDIF}
TSubMatches = class(TOleServer)
private
FIntf: ISubMatches;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TSubMatchesProperties;
function GetServerProperties: TSubMatchesProperties;
{$ENDIF}
function GetDefaultInterface: ISubMatches;
protected
procedure InitServerData; override;
function Get_Item(index: Integer): OleVariant;
function Get_Count: Integer;
function Get__NewEnum: IUnknown;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: ISubMatches);
procedure Disconnect; override;
property DefaultInterface: ISubMatches read GetDefaultInterface;
property Item[index: Integer]: OleVariant read Get_Item; default;
property Count: Integer read Get_Count;
property _NewEnum: IUnknown read Get__NewEnum;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TSubMatchesProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TSubMatches
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TSubMatchesProperties = class(TPersistent)
private
FServer: TSubMatches;
function GetDefaultInterface: ISubMatches;
constructor Create(AServer: TSubMatches);
protected
function Get_Item(index: Integer): OleVariant;
function Get_Count: Integer;
function Get__NewEnum: IUnknown;
public
property DefaultInterface: ISubMatches read GetDefaultInterface;
published
end;
{$ENDIF}
procedure Register;
resourcestring
dtlServerPage = 'ActiveX';
dtlOcxPage = 'ActiveX';
implementation
uses ComObj;
class function CoRegExp.Create: IRegExp2;
begin
Result := CreateComObject(CLASS_RegExp) as IRegExp2;
end;
class function CoRegExp.CreateRemote(const MachineName: string): IRegExp2;
begin
Result := CreateRemoteComObject(MachineName, CLASS_RegExp) as IRegExp2;
end;
procedure TRegExp.InitServerData;
const
CServerData: TServerData = (
ClassID: '{3F4DACA4-160D-11D2-A8E9-00104B365C9F}';
IntfIID: '{3F4DACB0-160D-11D2-A8E9-00104B365C9F}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TRegExp.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IRegExp2;
end;
end;
procedure TRegExp.ConnectTo(svrIntf: IRegExp2);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TRegExp.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TRegExp.GetDefaultInterface: IRegExp2;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
Result := FIntf;
end;
constructor TRegExp.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TRegExpProperties.Create(Self);
{$ENDIF}
end;
destructor TRegExp.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TRegExp.GetServerProperties: TRegExpProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TRegExp.Get_Pattern: WideString;
begin
Result := DefaultInterface.Pattern;
end;
procedure TRegExp.Set_Pattern(const pPattern: WideString);
{ Warning: The property Pattern has a setter and a getter whose
types do not match. Delphi was unable to generate a property of
this sort and so is using a Variant as a passthrough. }
var
InterfaceVariant: OleVariant;
begin
InterfaceVariant := DefaultInterface;
InterfaceVariant.Pattern := pPattern;
end;
function TRegExp.Get_IgnoreCase: WordBool;
begin
Result := DefaultInterface.IgnoreCase;
end;
procedure TRegExp.Set_IgnoreCase(pIgnoreCase: WordBool);
begin
DefaultInterface.Set_IgnoreCase(pIgnoreCase);
end;
function TRegExp.Get_Global: WordBool;
begin
Result := DefaultInterface.Global;
end;
procedure TRegExp.Set_Global(pGlobal: WordBool);
begin
DefaultInterface.Set_Global(pGlobal);
end;
function TRegExp.Get_Multiline: WordBool;
begin
Result := DefaultInterface.Multiline;
end;
procedure TRegExp.Set_Multiline(pMultiline: WordBool);
begin
DefaultInterface.Set_Multiline(pMultiline);
end;
function TRegExp.Execute(const sourceString: WideString): IDispatch;
begin
Result := DefaultInterface.Execute(sourceString);
end;
function TRegExp.Test(const sourceString: WideString): WordBool;
begin
Result := DefaultInterface.Test(sourceString);
end;
function TRegExp.Replace(const sourceString: WideString; replaceVar: OleVariant): WideString;
begin
Result := DefaultInterface.Replace(sourceString, replaceVar);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TRegExpProperties.Create(AServer: TRegExp);
begin
inherited Create;
FServer := AServer;
end;
function TRegExpProperties.GetDefaultInterface: IRegExp2;
begin
Result := FServer.DefaultInterface;
end;
function TRegExpProperties.Get_Pattern: WideString;
begin
Result := DefaultInterface.Pattern;
end;
procedure TRegExpProperties.Set_Pattern(const pPattern: WideString);
{ Warning: The property Pattern has a setter and a getter whose
types do not match. Delphi was unable to generate a property of
this sort and so is using a Variant as a passthrough. }
var
InterfaceVariant: OleVariant;
begin
InterfaceVariant := DefaultInterface;
InterfaceVariant.Pattern := pPattern;
end;
function TRegExpProperties.Get_IgnoreCase: WordBool;
begin
Result := DefaultInterface.IgnoreCase;
end;
procedure TRegExpProperties.Set_IgnoreCase(pIgnoreCase: WordBool);
begin
DefaultInterface.Set_IgnoreCase(pIgnoreCase);
end;
function TRegExpProperties.Get_Global: WordBool;
begin
Result := DefaultInterface.Global;
end;
procedure TRegExpProperties.Set_Global(pGlobal: WordBool);
begin
DefaultInterface.Set_Global(pGlobal);
end;
function TRegExpProperties.Get_Multiline: WordBool;
begin
Result := DefaultInterface.Multiline;
end;
procedure TRegExpProperties.Set_Multiline(pMultiline: WordBool);
begin
DefaultInterface.Set_Multiline(pMultiline);
end;
{$ENDIF}
class function CoMatch.Create: IMatch2;
begin
Result := CreateComObject(CLASS_Match) as IMatch2;
end;
class function CoMatch.CreateRemote(const MachineName: string): IMatch2;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Match) as IMatch2;
end;
procedure TMatch.InitServerData;
const
CServerData: TServerData = (
ClassID: '{3F4DACA5-160D-11D2-A8E9-00104B365C9F}';
IntfIID: '{3F4DACB1-160D-11D2-A8E9-00104B365C9F}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TMatch.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IMatch2;
end;
end;
procedure TMatch.ConnectTo(svrIntf: IMatch2);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TMatch.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TMatch.GetDefaultInterface: IMatch2;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
Result := FIntf;
end;
constructor TMatch.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TMatchProperties.Create(Self);
{$ENDIF}
end;
destructor TMatch.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TMatch.GetServerProperties: TMatchProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TMatch.Get_Value: WideString;
begin
Result := DefaultInterface.Value;
end;
function TMatch.Get_FirstIndex: Integer;
begin
Result := DefaultInterface.FirstIndex;
end;
function TMatch.Get_Length: Integer;
begin
Result := DefaultInterface.Length;
end;
function TMatch.Get_SubMatches: IDispatch;
begin
Result := DefaultInterface.SubMatches;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TMatchProperties.Create(AServer: TMatch);
begin
inherited Create;
FServer := AServer;
end;
function TMatchProperties.GetDefaultInterface: IMatch2;
begin
Result := FServer.DefaultInterface;
end;
function TMatchProperties.Get_Value: WideString;
begin
Result := DefaultInterface.Value;
end;
function TMatchProperties.Get_FirstIndex: Integer;
begin
Result := DefaultInterface.FirstIndex;
end;
function TMatchProperties.Get_Length: Integer;
begin
Result := DefaultInterface.Length;
end;
function TMatchProperties.Get_SubMatches: IDispatch;
begin
Result := DefaultInterface.SubMatches;
end;
{$ENDIF}
class function CoMatchCollection.Create: IMatchCollection2;
begin
Result := CreateComObject(CLASS_MatchCollection) as IMatchCollection2;
end;
class function CoMatchCollection.CreateRemote(const MachineName: string): IMatchCollection2;
begin
Result := CreateRemoteComObject(MachineName, CLASS_MatchCollection) as IMatchCollection2;
end;