* Overloaded version of TStrings.Add that accepts Fmt,Args

git-svn-id: trunk@30301 -
This commit is contained in:
michael 2015-03-24 08:47:14 +00:00
parent e3111faa2e
commit 063d7f1ce2
2 changed files with 14 additions and 2 deletions

View File

@ -654,8 +654,10 @@ type
Function GetNextLinebreak (Const Value : String; Var S : String; Var P : Integer) : Boolean;
public
destructor Destroy; override;
function Add(const S: string): Integer; virtual;
function AddObject(const S: string; AObject: TObject): Integer; virtual;
function Add(const S: string): Integer; virtual; overload;
function AddObject(const S: string; AObject: TObject): Integer; virtual; overload;
function Add(const Fmt : string; const Args : Array of const): Integer; overload;
function AddObject(const Fmt: string; Args : Array of const; AObject: TObject): Integer; overload;
procedure Append(const S: string);
procedure AddStrings(TheStrings: TStrings); overload; virtual;
procedure AddStrings(const TheStrings: array of string); overload; virtual;

View File

@ -675,6 +675,11 @@ begin
Insert (Count,S);
end;
function TStrings.Add(const Fmt : string; const Args : Array of const): Integer;
begin
Result:=Add(Format(Fmt,Args));
end;
Function TStrings.AddObject(const S: string; AObject: TObject): Integer;
@ -684,6 +689,11 @@ begin
Objects[result]:=AObject;
end;
function TStrings.AddObject(const Fmt: string; Args : Array of const; AObject: TObject): Integer;
begin
Result:=AddObject(Format(Fmt,Args),AObject);
end;
Procedure TStrings.Append(const S: string);