New type system

This commit is contained in:
Michael Schimmel
2025-08-26 15:49:28 +02:00
parent e9608a746a
commit 54d470b2f8
15 changed files with 58 additions and 364 deletions
-17
View File
@@ -21,9 +21,6 @@ type
implementation
uses
System.Rtti;
type
TImplDataTextValue = class(TInterfacedObject, IDataValue, IDataTextValue)
private
@@ -31,7 +28,6 @@ type
function GetDataType: IDataType;
function GetAsString: string;
function GetValue: string;
function AsTValue: TValue;
public
constructor Create(const AValue: string);
end;
@@ -41,13 +37,11 @@ type
strict private
class var
FSingleton: IDataTextValue;
FEmptyTValue: TValue;
class constructor CreateClass;
private
function GetDataType: IDataType;
function GetAsString: string;
function GetValue: string;
function AsTValue: TValue;
public
class property Singleton: IDataTextValue read FSingleton;
end;
@@ -101,17 +95,11 @@ begin
Result := FValue;
end;
function TImplDataTextValue.AsTValue: TValue;
begin
Result := TValue.From<string>(FValue);
end;
{ TImplDataTextValueEmpty }
class constructor TImplDataTextValueEmpty.CreateClass;
begin
FSingleton := TImplDataTextValueEmpty.Create;
FEmptyTValue := TValue.From<string>('');
end;
function TImplDataTextValueEmpty.GetAsString: string;
@@ -129,9 +117,4 @@ begin
Result := '';
end;
function TImplDataTextValueEmpty.AsTValue: TValue;
begin
Result := FEmptyTValue;
end;
end.