New type system
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user