* Merging revisions r43353 from trunk:

------------------------------------------------------------------------
    r43353 | michael | 2019-11-02 11:25:42 +0100 (Sat, 02 Nov 2019) | 1 line
    
    * Fix bug ID #0036246, delphi compatibility property
    ------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@43731 -
This commit is contained in:
michael 2019-12-23 13:32:53 +00:00
parent 35f2b45849
commit 00f800b0dd
2 changed files with 15 additions and 0 deletions

View File

@ -624,6 +624,7 @@ type
function GetCommaText: string;
function GetMissingNameValueSeparatorAction: TMissingNameValueSeparatorAction;
function GetName(Index: Integer): string;
function GetTrailingLineBreak: Boolean;
function GetValue(const Name: string): string;
Function GetLBS : TTextLineBreakStyle;
procedure SetDefaultEncoding(const ADefaultEncoding: TEncoding);
@ -633,6 +634,7 @@ type
procedure SetCommaText(const Value: string);
procedure SetMissingNameValueSeparatorAction(AValue: TMissingNameValueSeparatorAction);
procedure SetStringsAdapter(const Value: IStringsAdapter);
procedure SetTrailingLineBreak(AValue: Boolean);
procedure SetValue(const Name, Value: string);
procedure SetDelimiter(c:Char);
procedure SetQuoteChar(c:Char);
@ -732,6 +734,8 @@ type
property Objects[Index: Integer]: TObject read GetObject write PutObject;
property QuoteChar: Char read GetQuoteChar write SetQuoteChar;
Property SkipLastLineBreak : Boolean Read GetSkipLastLineBreak Write SetSkipLastLineBreak;
// Same as SkipLastLineBreak but for Delphi compatibility. Note it has opposite meaning.
Property TrailingLineBreak : Boolean Read GetTrailingLineBreak Write SetTrailingLineBreak;
Property StrictDelimiter : Boolean Read FStrictDelimiter Write FStrictDelimiter;
property Strings[Index: Integer]: string read Get write Put; default;
property StringsAdapter: IStringsAdapter read FAdapter write SetStringsAdapter;

View File

@ -163,6 +163,7 @@ begin
end;
Function TStrings.GetNameValueSeparator :Char;
begin
CheckSpecialChars;
@ -292,6 +293,11 @@ begin
GetNameValue(Index,Result,V);
end;
function TStrings.GetTrailingLineBreak: Boolean;
begin
Result:=Not SkipLastLineBreak;
end;
Function TStrings.GetValue(const Name: string): string;
Var
@ -476,6 +482,11 @@ Procedure TStrings.SetStringsAdapter(const Value: IStringsAdapter);
begin
end;
procedure TStrings.SetTrailingLineBreak(AValue: Boolean);
begin
SkipLastLineBreak:=Not aValue;
end;
Procedure TStrings.SetDefaultEncoding(const ADefaultEncoding: TEncoding);