Last change
on this file was 60, checked in by chronos, 8 months ago |
- Modified: Remove U prefix from unit names.
|
File size:
939 bytes
|
Line | |
---|
1 | unit Kernel.FileSystem;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Kernel.List;
|
---|
7 |
|
---|
8 | type
|
---|
9 | TFileSystemObject = class(TNamedObject)
|
---|
10 |
|
---|
11 | end;
|
---|
12 |
|
---|
13 | TFile = class(TFileSystemObject)
|
---|
14 | Size: Integer;
|
---|
15 | end;
|
---|
16 |
|
---|
17 | { TDirectory }
|
---|
18 |
|
---|
19 | TDirectory = class(TFileSystemObject)
|
---|
20 | Items: TNamedObjects<TFileSystemObject>;
|
---|
21 | constructor Create;
|
---|
22 | destructor Destroy; override;
|
---|
23 | end;
|
---|
24 |
|
---|
25 | { TFileSystem }
|
---|
26 |
|
---|
27 | TFileSystem = class
|
---|
28 | TopDirectory: TDirectory;
|
---|
29 | constructor Create;
|
---|
30 | destructor Destroy; override;
|
---|
31 | end;
|
---|
32 |
|
---|
33 | TFileSystemClass = class of TFileSystem;
|
---|
34 |
|
---|
35 |
|
---|
36 | implementation
|
---|
37 |
|
---|
38 | { TFileSystem }
|
---|
39 |
|
---|
40 | constructor TFileSystem.Create;
|
---|
41 | begin
|
---|
42 | TopDirectory := TDirectory.Create;
|
---|
43 | end;
|
---|
44 |
|
---|
45 | destructor TFileSystem.Destroy;
|
---|
46 | begin
|
---|
47 | TopDirectory.Free;
|
---|
48 | inherited Destroy;
|
---|
49 | end;
|
---|
50 |
|
---|
51 | { TDirectory }
|
---|
52 |
|
---|
53 | constructor TDirectory.Create;
|
---|
54 | begin
|
---|
55 | Items := TNamedObjects<TFileSystemObject>.Create;
|
---|
56 | end;
|
---|
57 |
|
---|
58 | destructor TDirectory.Destroy;
|
---|
59 | begin
|
---|
60 | FreeAndNil(Items);
|
---|
61 | inherited;
|
---|
62 | end;
|
---|
63 |
|
---|
64 | end.
|
---|
65 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.