mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 07:09:18 +02:00
* Merging revisions r42153,r42168,r42170,r42171,r42172,r42173,r42174 from trunk:
------------------------------------------------------------------------ r42153 | michael | 2019-06-01 11:42:27 +0200 (Sat, 01 Jun 2019) | 1 line * Fix bug #35660, introduce prefervaluestonames ------------------------------------------------------------------------ r42168 | michael | 2019-06-03 08:27:37 +0200 (Mon, 03 Jun 2019) | 1 line * Changed String.Split to conform to behaviour in Delphi Rio (bug ID 35669) ------------------------------------------------------------------------ r42170 | michael | 2019-06-04 09:00:48 +0200 (Tue, 04 Jun 2019) | 1 line * Better fix for 35660: Introduced TMissingNameValueSeparatorAction ------------------------------------------------------------------------ r42171 | michael | 2019-06-04 09:08:45 +0200 (Tue, 04 Jun 2019) | 1 line * Sort public properties/methods in stringlist ------------------------------------------------------------------------ r42172 | michael | 2019-06-04 09:29:53 +0200 (Tue, 04 Jun 2019) | 1 line * Added constant for new error message in stringlist ------------------------------------------------------------------------ r42173 | michael | 2019-06-04 10:31:39 +0200 (Tue, 04 Jun 2019) | 1 line Fix bug ID #0035672 ------------------------------------------------------------------------ r42174 | michael | 2019-06-05 13:42:40 +0200 (Wed, 05 Jun 2019) | 1 line * Fix bug ID #35674, do not create filestream for directories ------------------------------------------------------------------------ git-svn-id: branches/fixes_3_2@42429 -
This commit is contained in:
parent
0dfec0d081
commit
93ebf5468f
@ -2147,7 +2147,7 @@ Begin
|
|||||||
If Assigned(FOnCreateStream) then
|
If Assigned(FOnCreateStream) then
|
||||||
FOnCreateStream(Self, OutStream, Item);
|
FOnCreateStream(Self, OutStream, Item);
|
||||||
// If FOnCreateStream didn't create one, we create one now.
|
// If FOnCreateStream didn't create one, we create one now.
|
||||||
If (OutStream=Nil) then
|
If (OutStream=Nil) and (not Item.IsDirectory) then
|
||||||
begin
|
begin
|
||||||
if (Path<>'') then
|
if (Path<>'') then
|
||||||
ForceDirectories(Path);
|
ForceDirectories(Path);
|
||||||
@ -2173,6 +2173,7 @@ Begin
|
|||||||
OutStream := nil;
|
OutStream := nil;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
if Assigned(OutStream) then
|
||||||
FreeAndNil(OutStream);
|
FreeAndNil(OutStream);
|
||||||
DoEndOfFile;
|
DoEndOfFile;
|
||||||
end;
|
end;
|
||||||
|
@ -434,7 +434,7 @@ function ImmGetStatusWindowPos(imc: HIMC; lpptPos: LPPOINT): LongBool; stdcall ;
|
|||||||
function ImmSetStatusWindowPos(imc: HIMC; lpptPos: LPPOINT): LongBool; stdcall ; external Imm name 'ImmSetStatusWindowPos';
|
function ImmSetStatusWindowPos(imc: HIMC; lpptPos: LPPOINT): LongBool; stdcall ; external Imm name 'ImmSetStatusWindowPos';
|
||||||
function ImmGetCompositionWindow(imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall ; external Imm name 'ImmGetCompositionWindow';
|
function ImmGetCompositionWindow(imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall ; external Imm name 'ImmGetCompositionWindow';
|
||||||
function ImmSetCompositionWindow(imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall ; external Imm name 'ImmSetCompositionWindow';
|
function ImmSetCompositionWindow(imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall ; external Imm name 'ImmSetCompositionWindow';
|
||||||
function ImmGetCandidateWindow(imc: HIMC; par1: DWORD; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall ; external Imm name 'ImmGetCandidateWindow(';
|
function ImmGetCandidateWindow(imc: HIMC; par1: DWORD; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall ; external Imm name 'ImmGetCandidateWindow';
|
||||||
function ImmSetCandidateWindow(imc: HIMC; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall ; external Imm name 'ImmSetCandidateWindow';
|
function ImmSetCandidateWindow(imc: HIMC; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall ; external Imm name 'ImmSetCandidateWindow';
|
||||||
|
|
||||||
function ImmIsUIMessageA(wnd: HWND; msg: UINT; wPar: WPARAM; lPar: LPARAM): LongBool; stdcall ; external Imm name 'ImmIsUIMessageA';
|
function ImmIsUIMessageA(wnd: HWND; msg: UINT; wPar: WPARAM; lPar: LPARAM): LongBool; stdcall ; external Imm name 'ImmIsUIMessageA';
|
||||||
|
@ -598,11 +598,14 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ TStrings class }
|
{ TStrings class }
|
||||||
|
TMissingNameValueSeparatorAction = (mnvaValue,mnvaName,mnvaEmpty,mnvaError);
|
||||||
|
TMissingNameValueSeparatorActions = set of TMissingNameValueSeparatorAction;
|
||||||
|
|
||||||
TStrings = class(TPersistent)
|
TStrings = class(TPersistent)
|
||||||
private
|
private
|
||||||
FDefaultEncoding: TEncoding;
|
FDefaultEncoding: TEncoding;
|
||||||
FEncoding: TEncoding;
|
FEncoding: TEncoding;
|
||||||
|
FMissingNameValueSeparatorAction: TMissingNameValueSeparatorAction;
|
||||||
FSpecialCharsInited : boolean;
|
FSpecialCharsInited : boolean;
|
||||||
FAlwaysQuote: Boolean;
|
FAlwaysQuote: Boolean;
|
||||||
FQuoteChar : Char;
|
FQuoteChar : Char;
|
||||||
@ -616,6 +619,7 @@ type
|
|||||||
FLineBreak : String;
|
FLineBreak : String;
|
||||||
FWriteBOM: Boolean;
|
FWriteBOM: Boolean;
|
||||||
function GetCommaText: string;
|
function GetCommaText: string;
|
||||||
|
function GetMissingNameValueSeparatorAction: TMissingNameValueSeparatorAction;
|
||||||
function GetName(Index: Integer): string;
|
function GetName(Index: Integer): string;
|
||||||
function GetValue(const Name: string): string;
|
function GetValue(const Name: string): string;
|
||||||
Function GetLBS : TTextLineBreakStyle;
|
Function GetLBS : TTextLineBreakStyle;
|
||||||
@ -624,6 +628,7 @@ type
|
|||||||
Procedure SetLBS (AValue : TTextLineBreakStyle);
|
Procedure SetLBS (AValue : TTextLineBreakStyle);
|
||||||
procedure ReadData(Reader: TReader);
|
procedure ReadData(Reader: TReader);
|
||||||
procedure SetCommaText(const Value: string);
|
procedure SetCommaText(const Value: string);
|
||||||
|
procedure SetMissingNameValueSeparatorAction(AValue: TMissingNameValueSeparatorAction);
|
||||||
procedure SetStringsAdapter(const Value: IStringsAdapter);
|
procedure SetStringsAdapter(const Value: IStringsAdapter);
|
||||||
procedure SetValue(const Name, Value: string);
|
procedure SetValue(const Name, Value: string);
|
||||||
procedure SetDelimiter(c:Char);
|
procedure SetDelimiter(c:Char);
|
||||||
@ -674,12 +679,12 @@ type
|
|||||||
function AddObject(const Fmt: string; Args : Array of const; AObject: TObject): Integer; overload;
|
function AddObject(const Fmt: string; Args : Array of const; AObject: TObject): Integer; overload;
|
||||||
function AddPair(const AName, AValue: string): TStrings; overload; {$IFDEF CLASSESINLINE}inline;{$ENDIF}
|
function AddPair(const AName, AValue: string): TStrings; overload; {$IFDEF CLASSESINLINE}inline;{$ENDIF}
|
||||||
function AddPair(const AName, AValue: string; AObject: TObject): TStrings; overload;
|
function AddPair(const AName, AValue: string; AObject: TObject): TStrings; overload;
|
||||||
procedure Append(const S: string);
|
|
||||||
procedure AddStrings(TheStrings: TStrings); overload; virtual;
|
procedure AddStrings(TheStrings: TStrings); overload; virtual;
|
||||||
procedure AddStrings(TheStrings: TStrings; ClearFirst : Boolean); overload;
|
procedure AddStrings(TheStrings: TStrings; ClearFirst : Boolean); overload;
|
||||||
procedure AddStrings(const TheStrings: array of string); overload; virtual;
|
procedure AddStrings(const TheStrings: array of string); overload; virtual;
|
||||||
procedure AddStrings(const TheStrings: array of string; ClearFirst : Boolean); overload;
|
procedure AddStrings(const TheStrings: array of string; ClearFirst : Boolean); overload;
|
||||||
Procedure AddText(Const S : String); virtual;
|
Procedure AddText(Const S : String); virtual;
|
||||||
|
procedure Append(const S: string);
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
procedure BeginUpdate;
|
procedure BeginUpdate;
|
||||||
procedure Clear; virtual; abstract;
|
procedure Clear; virtual; abstract;
|
||||||
@ -688,14 +693,15 @@ type
|
|||||||
function Equals(Obj: TObject): Boolean; override; overload;
|
function Equals(Obj: TObject): Boolean; override; overload;
|
||||||
function Equals(TheStrings: TStrings): Boolean; overload;
|
function Equals(TheStrings: TStrings): Boolean; overload;
|
||||||
procedure Exchange(Index1, Index2: Integer); virtual;
|
procedure Exchange(Index1, Index2: Integer); virtual;
|
||||||
|
function ExtractName(Const S:String):String;
|
||||||
function GetEnumerator: TStringsEnumerator;
|
function GetEnumerator: TStringsEnumerator;
|
||||||
|
procedure GetNameValue(Index : Integer; Out AName,AValue : String);
|
||||||
function GetText: PChar; virtual;
|
function GetText: PChar; virtual;
|
||||||
function IndexOf(const S: string): Integer; virtual;
|
function IndexOf(const S: string): Integer; virtual;
|
||||||
function IndexOfName(const Name: string): Integer; virtual;
|
function IndexOfName(const Name: string): Integer; virtual;
|
||||||
function IndexOfObject(AObject: TObject): Integer; virtual;
|
function IndexOfObject(AObject: TObject): Integer; virtual;
|
||||||
procedure Insert(Index: Integer; const S: string); virtual; abstract;
|
procedure Insert(Index: Integer; const S: string); virtual; abstract;
|
||||||
procedure InsertObject(Index: Integer; const S: string;
|
procedure InsertObject(Index: Integer; const S: string; AObject: TObject);
|
||||||
AObject: TObject);
|
|
||||||
procedure LoadFromFile(const FileName: string); overload; virtual;
|
procedure LoadFromFile(const FileName: string); overload; virtual;
|
||||||
procedure LoadFromFile(const FileName: string; IgnoreEncoding : Boolean);
|
procedure LoadFromFile(const FileName: string; IgnoreEncoding : Boolean);
|
||||||
procedure LoadFromFile(const FileName: string; AEncoding: TEncoding); overload; virtual;
|
procedure LoadFromFile(const FileName: string; AEncoding: TEncoding); overload; virtual;
|
||||||
@ -708,29 +714,28 @@ type
|
|||||||
procedure SaveToStream(Stream: TStream); overload; virtual;
|
procedure SaveToStream(Stream: TStream); overload; virtual;
|
||||||
procedure SaveToStream(Stream: TStream; AEncoding: TEncoding); overload; virtual;
|
procedure SaveToStream(Stream: TStream; AEncoding: TEncoding); overload; virtual;
|
||||||
procedure SetText(TheText: PChar); virtual;
|
procedure SetText(TheText: PChar); virtual;
|
||||||
procedure GetNameValue(Index : Integer; Out AName,AValue : String);
|
|
||||||
function ExtractName(Const S:String):String;
|
|
||||||
Property TextLineBreakStyle : TTextLineBreakStyle Read GetLBS Write SetLBS;
|
|
||||||
property Delimiter: Char read GetDelimiter write SetDelimiter;
|
|
||||||
property DelimitedText: string read GetDelimitedText write SetDelimitedText;
|
|
||||||
property DefaultEncoding: TEncoding read FDefaultEncoding write SetDefaultEncoding;
|
|
||||||
property Encoding: TEncoding read FEncoding;
|
|
||||||
property LineBreak : string Read GetLineBreak write SetLineBreak;
|
|
||||||
Property StrictDelimiter : Boolean Read FStrictDelimiter Write FStrictDelimiter;
|
|
||||||
property AlwaysQuote: Boolean read FAlwaysQuote write FAlwaysQuote;
|
property AlwaysQuote: Boolean read FAlwaysQuote write FAlwaysQuote;
|
||||||
property QuoteChar: Char read GetQuoteChar write SetQuoteChar;
|
|
||||||
Property NameValueSeparator : Char Read GetNameValueSeparator Write SetNameValueSeparator;
|
|
||||||
property ValueFromIndex[Index: Integer]: string read GetValueFromIndex write SetValueFromIndex;
|
|
||||||
property Capacity: Integer read GetCapacity write SetCapacity;
|
property Capacity: Integer read GetCapacity write SetCapacity;
|
||||||
property CommaText: string read GetCommaText write SetCommaText;
|
property CommaText: string read GetCommaText write SetCommaText;
|
||||||
property Count: Integer read GetCount;
|
property Count: Integer read GetCount;
|
||||||
|
property DefaultEncoding: TEncoding read FDefaultEncoding write SetDefaultEncoding;
|
||||||
|
property DelimitedText: string read GetDelimitedText write SetDelimitedText;
|
||||||
|
property Delimiter: Char read GetDelimiter write SetDelimiter;
|
||||||
|
property Encoding: TEncoding read FEncoding;
|
||||||
|
property LineBreak : string Read GetLineBreak write SetLineBreak;
|
||||||
|
Property MissingNameValueSeparatorAction : TMissingNameValueSeparatorAction Read GetMissingNameValueSeparatorAction Write SetMissingNameValueSeparatorAction;
|
||||||
property Names[Index: Integer]: string read GetName;
|
property Names[Index: Integer]: string read GetName;
|
||||||
|
Property NameValueSeparator : Char Read GetNameValueSeparator Write SetNameValueSeparator;
|
||||||
property Objects[Index: Integer]: TObject read GetObject write PutObject;
|
property Objects[Index: Integer]: TObject read GetObject write PutObject;
|
||||||
property Values[const Name: string]: string read GetValue write SetValue;
|
property QuoteChar: Char read GetQuoteChar write SetQuoteChar;
|
||||||
property Strings[Index: Integer]: string read Get write Put; default;
|
|
||||||
property Text: string read GetTextStr write SetTextStr;
|
|
||||||
property StringsAdapter: IStringsAdapter read FAdapter write SetStringsAdapter;
|
|
||||||
Property SkipLastLineBreak : Boolean Read GetSkipLastLineBreak Write SetSkipLastLineBreak;
|
Property SkipLastLineBreak : Boolean Read GetSkipLastLineBreak Write SetSkipLastLineBreak;
|
||||||
|
Property StrictDelimiter : Boolean Read FStrictDelimiter Write FStrictDelimiter;
|
||||||
|
property Strings[Index: Integer]: string read Get write Put; default;
|
||||||
|
property StringsAdapter: IStringsAdapter read FAdapter write SetStringsAdapter;
|
||||||
|
property Text: string read GetTextStr write SetTextStr;
|
||||||
|
Property TextLineBreakStyle : TTextLineBreakStyle Read GetLBS Write SetLBS;
|
||||||
|
property ValueFromIndex[Index: Integer]: string read GetValueFromIndex write SetValueFromIndex;
|
||||||
|
property Values[const Name: string]: string read GetValue write SetValue;
|
||||||
property WriteBOM: Boolean read FWriteBOM write FWriteBOM;
|
property WriteBOM: Boolean read FWriteBOM write FWriteBOM;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -162,6 +162,7 @@ begin
|
|||||||
FNameValueSeparator:=c;
|
FNameValueSeparator:=c;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TStrings.GetNameValueSeparator :Char;
|
Function TStrings.GetNameValueSeparator :Char;
|
||||||
begin
|
begin
|
||||||
CheckSpecialChars;
|
CheckSpecialChars;
|
||||||
@ -192,6 +193,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TStrings.GetMissingNameValueSeparatorAction: TMissingNameValueSeparatorAction;
|
||||||
|
begin
|
||||||
|
CheckSpecialChars;
|
||||||
|
Result:=FMissingNameValueSeparatorAction;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TStrings.GetDelimitedText: string;
|
Function TStrings.GetDelimitedText: string;
|
||||||
|
|
||||||
@ -240,6 +247,7 @@ procedure TStrings.GetNameValue(Index : Integer; Out AName,AValue : String);
|
|||||||
Var L : longint;
|
Var L : longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
aName:='';
|
||||||
CheckSpecialChars;
|
CheckSpecialChars;
|
||||||
AValue:=Strings[Index];
|
AValue:=Strings[Index];
|
||||||
L:=Pos(FNameValueSeparator,AValue);
|
L:=Pos(FNameValueSeparator,AValue);
|
||||||
@ -249,7 +257,18 @@ begin
|
|||||||
System.Delete(AValue,1,L);
|
System.Delete(AValue,1,L);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
AName:='';
|
case FMissingNameValueSeparatorAction of
|
||||||
|
mnvaValue : ;
|
||||||
|
mnvaName :
|
||||||
|
begin
|
||||||
|
aName:=aValue;
|
||||||
|
aValue:='';
|
||||||
|
end;
|
||||||
|
mnvaEmpty :
|
||||||
|
aValue:='';
|
||||||
|
mnvaError :
|
||||||
|
Raise EStringListError.CreateFmt(SErrNoNameValuePairAt,[Index]);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TStrings.ExtractName(const s:String):String;
|
function TStrings.ExtractName(const s:String):String;
|
||||||
@ -445,6 +464,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TStrings.SetMissingNameValueSeparatorAction(AValue: TMissingNameValueSeparatorAction);
|
||||||
|
begin
|
||||||
|
CheckSpecialChars;
|
||||||
|
FMissingNameValueSeparatorAction:=aValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure TStrings.SetStringsAdapter(const Value: IStringsAdapter);
|
Procedure TStrings.SetStringsAdapter(const Value: IStringsAdapter);
|
||||||
|
|
||||||
|
@ -308,6 +308,7 @@ ResourceString
|
|||||||
SParamIsNegative = 'Parameter "%s" cannot be negative.';
|
SParamIsNegative = 'Parameter "%s" cannot be negative.';
|
||||||
SErrCannotWriteToProperty = 'Cannot write to property "%s".';
|
SErrCannotWriteToProperty = 'Cannot write to property "%s".';
|
||||||
SErrCannotReadProperty = 'Cannot read property "%s".';
|
SErrCannotReadProperty = 'Cannot read property "%s".';
|
||||||
|
SErrNoNameValuePairAt = 'No name=value pair at position %d.';
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
Keysim Names
|
Keysim Names
|
||||||
|
@ -1097,34 +1097,34 @@ end;
|
|||||||
|
|
||||||
function TStringHelper.Split(const Separators: array of Char): TStringArray;
|
function TStringHelper.Split(const Separators: array of Char): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=SPlit(Separators,#0,#0,Length,TStringSplitOptions.None);
|
Result:=Split(Separators,#0,#0,Length+1,TStringSplitOptions.None);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TStringHelper.Split(const Separators: array of Char; ACount: SizeInt
|
function TStringHelper.Split(const Separators: array of Char; ACount: SizeInt
|
||||||
): TStringArray;
|
): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=SPlit(Separators,#0,#0,ACount,TStringSplitOptions.None);
|
Result:=Split(Separators,#0,#0,ACount,TStringSplitOptions.None);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TStringHelper.Split(const Separators: array of Char;
|
function TStringHelper.Split(const Separators: array of Char;
|
||||||
Options: TStringSplitOptions): TStringArray;
|
Options: TStringSplitOptions): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=SPlit(Separators,Length,Options);
|
Result:=Split(Separators,Length+1,Options);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TStringHelper.Split(const Separators: array of Char; ACount: SizeInt;
|
function TStringHelper.Split(const Separators: array of Char; ACount: SizeInt;
|
||||||
Options: TStringSplitOptions): TStringArray;
|
Options: TStringSplitOptions): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=SPlit(Separators,#0,#0,ACount,Options);
|
Result:=Split(Separators,#0,#0,ACount,Options);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TStringHelper.Split(const Separators: array of string): TStringArray;
|
function TStringHelper.Split(const Separators: array of string): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=Split(Separators,Length);
|
Result:=Split(Separators,Length+1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1138,7 +1138,7 @@ end;
|
|||||||
function TStringHelper.Split(const Separators: array of string;
|
function TStringHelper.Split(const Separators: array of string;
|
||||||
Options: TStringSplitOptions): TStringArray;
|
Options: TStringSplitOptions): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=Split(Separators,Length,Options);
|
Result:=Split(Separators,Length+1,Options);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1166,7 +1166,7 @@ end;
|
|||||||
function TStringHelper.Split(const Separators: array of Char; AQuoteStart,
|
function TStringHelper.Split(const Separators: array of Char; AQuoteStart,
|
||||||
AQuoteEnd: Char; Options: TStringSplitOptions): TStringArray;
|
AQuoteEnd: Char; Options: TStringSplitOptions): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=Split(Separators,AQuoteStart,AQuoteEnd,Length,Options);
|
Result:=Split(Separators,AQuoteStart,AQuoteEnd,Length+1,Options);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1211,7 +1211,7 @@ begin
|
|||||||
While (Sep<>-1) and ((ACount=0) or (Len<ACount)) do
|
While (Sep<>-1) and ((ACount=0) or (Len<ACount)) do
|
||||||
begin
|
begin
|
||||||
T:=SubString(LastSep,Sep-LastSep);
|
T:=SubString(LastSep,Sep-LastSep);
|
||||||
// Writeln('Examining >',T,'< at pos,',LastSep,' till pos ',Sep);
|
// Writeln('Examining >',T,'< at pos ',LastSep,', till pos ',Sep);
|
||||||
If (T<>'') or (not (TStringSplitOptions.ExcludeEmpty=Options)) then
|
If (T<>'') or (not (TStringSplitOptions.ExcludeEmpty=Options)) then
|
||||||
begin
|
begin
|
||||||
MaybeGrow(Len);
|
MaybeGrow(Len);
|
||||||
@ -1221,7 +1221,7 @@ begin
|
|||||||
LastSep:=Sep+1;
|
LastSep:=Sep+1;
|
||||||
Sep:=NextSep(LastSep);
|
Sep:=NextSep(LastSep);
|
||||||
end;
|
end;
|
||||||
if (LastSep<Length) and ((ACount=0) or (Len<ACount)) then
|
if (LastSep<=Length) and ((ACount=0) or (Len<ACount)) then
|
||||||
begin
|
begin
|
||||||
T:=SubString(LastSep);
|
T:=SubString(LastSep);
|
||||||
// Writeln('Examining >',T,'< at pos,',LastSep,' till pos ',Sep);
|
// Writeln('Examining >',T,'< at pos,',LastSep,' till pos ',Sep);
|
||||||
@ -1243,14 +1243,14 @@ end;
|
|||||||
function TStringHelper.Split(const Separators: array of string; AQuoteStart,
|
function TStringHelper.Split(const Separators: array of string; AQuoteStart,
|
||||||
AQuoteEnd: Char): TStringArray;
|
AQuoteEnd: Char): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=SPlit(Separators,AQuoteStart,AQuoteEnd,Length,TStringSplitOptions.None);
|
Result:=SPlit(Separators,AQuoteStart,AQuoteEnd,Length+1,TStringSplitOptions.None);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TStringHelper.Split(const Separators: array of string; AQuoteStart,
|
function TStringHelper.Split(const Separators: array of string; AQuoteStart,
|
||||||
AQuoteEnd: Char; Options: TStringSplitOptions): TStringArray;
|
AQuoteEnd: Char; Options: TStringSplitOptions): TStringArray;
|
||||||
begin
|
begin
|
||||||
Result:=SPlit(Separators,AQuoteStart,AQuoteEnd,Length,Options);
|
Result:=SPlit(Separators,AQuoteStart,AQuoteEnd,Length+1,Options);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1304,7 +1304,7 @@ begin
|
|||||||
LastSep:=Sep+System.Length(Separators[Match]);
|
LastSep:=Sep+System.Length(Separators[Match]);
|
||||||
Sep:=NextSep(LastSep,Match);
|
Sep:=NextSep(LastSep,Match);
|
||||||
end;
|
end;
|
||||||
if (LastSep<Length) and ((ACount=0) or (Len<ACount)) then
|
if (LastSep<=Length) and ((ACount=0) or (Len<ACount)) then
|
||||||
begin
|
begin
|
||||||
T:=SubString(LastSep);
|
T:=SubString(LastSep);
|
||||||
// Writeln('Examining >',T,'< at pos,',LastSep,' till pos ',Sep);
|
// Writeln('Examining >',T,'< at pos,',LastSep,' till pos ',Sep);
|
||||||
|
Loading…
Reference in New Issue
Block a user