mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-06 04:52:26 +00:00
circular dependencies problem fixed.
This commit is contained in:
parent
d3be79cbe9
commit
42f574ad95
2 changed files with 123 additions and 0 deletions
32
src/vpkRetriever.Mod
Normal file
32
src/vpkRetriever.Mod
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
MODULE vpkRetriever;
|
||||
IMPORT StringList, strutils, vpkJsonParser, vpkStorage, vpkSettings;
|
||||
|
||||
|
||||
PROCEDURE getDeps*(VAR name: ARRAY OF CHAR): StringList.TStringList;
|
||||
VAR
|
||||
jsonRecord, dependencies: vpkJsonParser.JsonTypePointer;
|
||||
p: strutils.pstring;
|
||||
b: BOOLEAN;
|
||||
result: StringList.TStringList;
|
||||
pkgName : ARRAY 32 OF CHAR;
|
||||
BEGIN
|
||||
result := NIL;
|
||||
p := NIL;
|
||||
vpkStorage.json2pstring(name, p);
|
||||
IF p # NIL THEN
|
||||
jsonRecord := vpkJsonParser.Create(p^);
|
||||
b := jsonRecord.GetTerminal(jsonRecord, vpkSettings.pkgTypKey, pkgName);
|
||||
IF b THEN
|
||||
dependencies := NIL;
|
||||
dependencies := jsonRecord.GetNonTerminal(jsonRecord, vpkSettings.depTypKey);
|
||||
IF dependencies # NIL THEN
|
||||
dependencies.GetTerminalKeys(dependencies, result);
|
||||
RETURN result
|
||||
END
|
||||
END
|
||||
END;
|
||||
RETURN result
|
||||
END getDeps;
|
||||
|
||||
|
||||
END vpkRetriever.
|
||||
Loading…
Add table
Add a link
Reference in a new issue