unit ansistring_traits;

{$MODE FPC}
{$MODESWITCH DEFAULTPARAMETERS}
{$MODESWITCH OUT}
{$MODESWITCH RESULT}

interface

type
TAnsiStringTraits = object
public type
  TValue = AnsiString;
public
  procedure Initialize(out Value: TValue); static; inline;
  procedure Finalize(var Value: TValue); static; inline;
  procedure Copy(const Src: TValue; out Dst: TValue); static; inline;
  function Equal(const A, B: TValue): Boolean; static; inline;
end;

implementation

procedure TAnsiStringTraits.Initialize(out Value: TValue);
begin
  Value := '';
end;

procedure TAnsiStringTraits.Finalize(var Value: TValue);
begin
  Value := '';
end;

procedure TAnsiStringTraits.Copy(const Src: TValue; out Dst: TValue);
begin
  Dst := Src;
end;

function TAnsiStringTraits.Equal(const A, B: TValue): Boolean;
begin
  Exit(A = B);
end;

end.
