now the retriever function is the installable method of dep object.

This commit is contained in:
Norayr Chilingarian 2020-06-14 19:49:06 +04:00
parent e6823cb373
commit db0a32e674
4 changed files with 22 additions and 9 deletions

View file

@ -1,32 +0,0 @@
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.