Last change
on this file was 13, checked in by chronos, 10 years ago |
- Added: Basic parsing of "Depends on" expressions.
|
File size:
1.1 KB
|
Line | |
---|
1 | {$IFDEF INTERFACE}
|
---|
2 |
|
---|
3 | {$DEFINE TGListIndex := TGSetIndex}
|
---|
4 | {$DEFINE TGListItem := TGSetItem}
|
---|
5 | {$DEFINE TGList := TGSetList}
|
---|
6 | {$DEFINE INTERFACE}
|
---|
7 | {$I 'GenericList.inc'}
|
---|
8 |
|
---|
9 | // TGSet<TGSetIndex, TGSetItem> = class
|
---|
10 | TGSet = class
|
---|
11 | private
|
---|
12 | FList: TGList;
|
---|
13 | public
|
---|
14 | function IsIn(Item: TGSetItem): Boolean;
|
---|
15 | constructor Create;
|
---|
16 | destructor Destroy; override;
|
---|
17 | property List: TGList read FList;
|
---|
18 | end;
|
---|
19 |
|
---|
20 | {$UNDEF INTERFACE}
|
---|
21 | {$ENDIF}
|
---|
22 |
|
---|
23 | {$IFDEF IMPLEMENTATION_USES}
|
---|
24 |
|
---|
25 | {$DEFINE IMPLEMENTATION_USES}
|
---|
26 | {$I 'GenericList.inc'}
|
---|
27 |
|
---|
28 | {$UNDEF IMPLEMENTATION_USES}
|
---|
29 | {$ENDIF}
|
---|
30 |
|
---|
31 | {$IFDEF IMPLEMENTATION}
|
---|
32 |
|
---|
33 | {$DEFINE TGListIndex := TGSetIndex}
|
---|
34 | {$DEFINE TGListItem := TGSetItem}
|
---|
35 | {$DEFINE TGList := TGSetList}
|
---|
36 | {$DEFINE IMPLEMENTATION}
|
---|
37 | {$I 'GenericList.inc'}
|
---|
38 |
|
---|
39 | { TGSet }
|
---|
40 |
|
---|
41 | function TGSet.IsIn(Item: TGSetItem): Boolean;
|
---|
42 | begin
|
---|
43 | Result := FList.IndexOf(Item) <> -1;
|
---|
44 | end;
|
---|
45 |
|
---|
46 | constructor TGSet.Create;
|
---|
47 | begin
|
---|
48 | FList := TGList.Create;
|
---|
49 | end;
|
---|
50 |
|
---|
51 | destructor TGSet.Destroy;
|
---|
52 | begin
|
---|
53 | FList.Free;
|
---|
54 | inherited Destroy;
|
---|
55 | end;
|
---|
56 |
|
---|
57 | {$UNDEF IMPLEMENTATION}
|
---|
58 | {$ENDIF}
|
---|
Note:
See
TracBrowser
for help on using the repository browser.