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
@@ -28,6 +28,7 @@ type
FArrayType: IDataArrayType;
FItems: TArray<IDataValue>;
function GetDataType: IDataType;
function GetAsString: string;
function GetElementCount: Integer;
function GetItem(Idx: Integer): IDataValue;
public
@@ -57,6 +58,27 @@ begin
Result := FArrayType;
end;
function TImplDataArrayValue.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 TImplDataArrayValue.GetElementCount: Integer;
begin
Result := Length(FItems);