Data Types

This commit is contained in:
Michael Schimmel
2025-08-25 14:48:06 +02:00
parent ce653c83b1
commit c9e28a946d
10 changed files with 374 additions and 3 deletions
+22
View File
@@ -12,6 +12,7 @@ type
private
FItems: TArray<IDataValue>;
function GetDataType: IDataType;
function GetAsString: string;
function GetItemCount: Integer;
function GetItem(Idx: Integer): IDataValue;
public
@@ -51,6 +52,27 @@ begin
Result := TImplDataTupleType.Singleton;
end;
function TImplDataTupleValue.GetAsString: string;
var
sb: TStringBuilder;
i: Integer;
begin
sb := TStringBuilder.Create;
try
sb.Append('(');
for i := 0 to High(FItems) do
begin
sb.Append(FItems[i].AsString);
if (i < High(FItems)) then
sb.Append(', ');
end;
sb.Append(')');
Result := sb.ToString;
finally
sb.Free;
end;
end;
function TImplDataTupleValue.GetItem(Idx: Integer): IDataValue;
begin
Result := FItems[Idx];