Skip to content

Commit edb2b86

Browse files
author
delphidabbler
committed
Add helper method to return license name followed by URL
1 parent d334732 commit edb2b86

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Src/DB.UMetaData.pas

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ TDBLicenseInfo = record
125125
property URL: string read fURL;
126126
/// <summary>Full text of license.</summary>
127127
property Text: string read fText;
128+
/// <summary>Returns a string containing license name followed by any URL
129+
/// in parentheses.</summary>
130+
/// <remarks>If no URL is available then only the license name is returned.
131+
/// </remarks>
132+
function NameWithURL: string;
128133
end;
129134

130135
/// <summary>Record providing informaton about the main database copyright.
@@ -938,6 +943,13 @@ constructor TDBLicenseInfo.Create(const AName, ASPDX, AURL, AText: string);
938943
fText := AText;
939944
end;
940945

946+
function TDBLicenseInfo.NameWithURL: string;
947+
begin
948+
Result := fName;
949+
if fURL <> '' then
950+
Result := Result + ' (' + fURL + ')';
951+
end;
952+
941953
{ TDBCopyrightInfo }
942954

943955
constructor TDBCopyrightInfo.Create(const ADate, AHolder, AHolderURL: string);

0 commit comments

Comments
 (0)