1515
1616[Code]
1717
18+ // Wrapper function for returning a path relative to {tmp}
1819function Tmp (Path: String): String;
1920begin
2021 Result := ExpandConstant(' {tmp}\' ) + Path;
2122end ;
2223
24+ // Recursive function called by SplitString
2325function SplitStringRec (Str: String; Delim: String; StrList: TStringList): TStringList;
2426var
2527 StrHead: String;
@@ -42,11 +44,14 @@ begin
4244 end ;
4345end ;
4446
47+ // Given a string and a delimiter, returns the strings separated by the delimiter
48+ // as a TStringList object
4549function SplitString (Str: String; Delim: String): TStringList;
4650begin
4751 Result := SplitStringRec(Str, Delim, TStringList.Create);
4852end ;
4953
54+ // Recursive function called by GetURLFilePart
5055function GetURLFilePartRec (URL: String): String;
5156var
5257 SlashPos: Integer;
@@ -60,12 +65,17 @@ begin
6065 end ;
6166end ;
6267
68+ // Given a URL to a file, returns the filename portion of the URL
6369function GetURLFilePart (URL: String): String;
6470begin
6571 Delete(URL, 1 , Pos(' ://' , URL) + 2 );
6672 Result := GetURLFilePartRec(URL);
6773end ;
6874
75+ // Given two software version strings (ex. '1.5.0'), returns:
76+ // 1 if the second version is later than the first
77+ // -1 if the second version is earlier than the first
78+ // 0 if equivalent (
6979function CompareVersions (VerL, VerR: String): Integer;
7080var
7181 VerLExplode: TStrings;
94104 end ;
95105end ;
96106
107+ // Given an array of strings representing software versions, returns
108+ // the latest of those versions
97109function GetLatestVersion (Versions: TArrayOfString): String;
98110var
99111 i: Integer;
0 commit comments