TEnumString = class
private
FKeys : TStrings;
FValues : TStrings;
procedure setString(index: string): string;
function getString(index: string; value : string): string;
public
constructor create;
property items[index : string]: string read getString write setString; default;
function add(key, value : string): integer;
end;
constructor TEnumString.create;
begin
FValues := TStringList.create;
FKeys := TstringList.create;
end;
function TEnumString.add(key, value : string): integer;
begin
FValues.add(value);
result := FKeys.add(key);
end;
function TEnumString.getString(index: string): string;
begin
result := FValues[FKeys.indexOf(index)] ;
end;
procedure TEnumString.setString(index: string; value : string): string;
begin
FValues[FKeys.indexOf(index)] := value;
end;