Subversion Repositories oidplus

Rev

Rev 734 | Rev 739 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 734 Rev 735
Line 23... Line 23...
23
    Description: string;
23
    Description: string;
24
    SubIds: PStringList; (* first 8 chars are FileId, followed by Dot-Notation *)
24
    SubIds: PStringList; (* first 8 chars are FileId, followed by Dot-Notation *)
25
    Parent: string; (* First 8 chars are FileId, followed by Dot-Notation *)
25
    Parent: string; (* First 8 chars are FileId, followed by Dot-Notation *)
26
  end;
26
  end;
27
 
27
 
28
procedure InitOidDef(oid: POid);
28
procedure CreateOidDef(var oid: POid);
29
procedure FreeOidDef(oid: POid);
29
procedure FreeOidDef(oid: POid);
30
procedure ClearOidDef(oid: POid);
30
procedure ClearOidDef(oid: POid);
31
procedure WriteOidFile(filename: string; oid: POid);
31
procedure WriteOidFile(filename: string; oid: POid);
32
procedure ReadOidFile(filename: string; oid: POid);
32
procedure ReadOidFile(filename: string; oid: POid);
33
 
33
 
-
 
34
(* For the fields "SubIds" and "Parent" *)
-
 
35
function FileIdPart(s: string): string;
-
 
36
function DotNotationPart(s: string): string;
-
 
37
 
34
implementation
38
implementation
35
 
39
 
36
uses
40
uses
37
  VtsFuncs;
41
  VtsFuncs;
38
 
42
 
39
const
43
const
40
  WANT_VERS = '2022';
44
  WANT_VERS = '2022';
41
 
45
 
42
procedure InitOidDef(oid: POid);
46
procedure CreateOidDef(var oid: POid);
43
begin
47
begin
-
 
48
  GetMem(oid, SizeOf(TOID));
44
  oid^.FileId := '';
49
  oid^.FileId := '';
45
  oid^.DotNotation := '';
50
  oid^.DotNotation := '';
46
  oid^.Description := '';
51
  oid^.Description := '';
47
  oid^.Parent := '';
52
  oid^.Parent := '';
48
  InitList(oid^.ASNIds);
53
  CreateList(oid^.ASNIds);
49
  InitList(oid^.SubIds);
54
  CreateList(oid^.SubIds);
50
end;
55
end;
51
 
56
 
52
procedure FreeOidDef(oid: POid);
57
procedure FreeOidDef(oid: POid);
53
begin
58
begin
54
  FreeList(oid^.ASNIds);
59
  FreeList(oid^.ASNIds);
55
  FreeList(oid^.SubIds);
60
  FreeList(oid^.SubIds);
-
 
61
  FreeMem(oid, SizeOf(TOID));
56
end;
62
end;
57
 
63
 
58
procedure ClearOidDef(oid: POid);
64
procedure ClearOidDef(oid: POid);
59
begin
65
begin
60
  FreeOidDef(oid);
66
  FreeOidDef(oid);
61
  InitOidDef(oid);
67
  CreateOidDef(oid);
62
end;
68
end;
63
 
69
 
64
procedure WriteOidFile(filename: string; oid: POid);
70
procedure WriteOidFile(filename: string; oid: POid);
65
var
71
var
66
  f: Text;
72
  f: Text;
Line 91... Line 97...
91
  end;
97
  end;
92
 
98
 
93
  desc := Trim(oid^.Description);
99
  desc := Trim(oid^.Description);
94
  if desc <> '' then
100
  if desc <> '' then
95
  begin
101
  begin
96
    InitList(lines);
102
    CreateList(lines);
97
    SplitStrToList(desc, lines, #13#10);
103
    SplitStrToList(desc, lines, #13#10);
98
    for i := 0 to ListCount(lines)-1 do
104
    for i := 0 to ListCount(lines)-1 do
99
    begin
105
    begin
100
      sTmp := ListGetElement(lines, i);
106
      sTmp := ListGetElement(lines, i);
101
      WriteLn(f, 'DESC' + sTmp);
107
      WriteLn(f, 'DESC' + sTmp);
Line 167... Line 173...
167
  end;
173
  end;
168
 
174
 
169
  Close(f);
175
  Close(f);
170
end;
176
end;
171
 
177
 
-
 
178
function FileIdPart(s: string): string;
-
 
179
begin
-
 
180
  FileIdPart := Copy(s,1,8);
-
 
181
end;
-
 
182
 
-
 
183
function DotNotationPart(s: string): string;
-
 
184
begin
-
 
185
  Delete(s,1,8);
-
 
186
  DotNotationPart := s;
-
 
187
end;
-
 
188
 
172
end.
189
end.