mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
* Quotes are normally not stripped. Introduced a StripQuotes property
git-svn-id: trunk@8782 -
This commit is contained in:
parent
5d1a952f2a
commit
fbe94969d0
@ -123,6 +123,7 @@ type
|
|||||||
FSectionList: TIniFileSectionList;
|
FSectionList: TIniFileSectionList;
|
||||||
FEscapeLineFeeds: boolean;
|
FEscapeLineFeeds: boolean;
|
||||||
FCaseSensitive : Boolean;
|
FCaseSensitive : Boolean;
|
||||||
|
FStripQuotes : Boolean;
|
||||||
public
|
public
|
||||||
constructor Create(const AFileName: string; AEscapeLineFeeds : Boolean = False); virtual;
|
constructor Create(const AFileName: string; AEscapeLineFeeds : Boolean = False); virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -153,6 +154,7 @@ type
|
|||||||
property FileName: string read FFileName;
|
property FileName: string read FFileName;
|
||||||
property EscapeLineFeeds: boolean read FEscapeLineFeeds;
|
property EscapeLineFeeds: boolean read FEscapeLineFeeds;
|
||||||
Property CaseSensitive : Boolean Read FCaseSensitive Write FCaseSensitive;
|
Property CaseSensitive : Boolean Read FCaseSensitive Write FCaseSensitive;
|
||||||
|
Property StripQuotes : Boolean Read FStripQuotes Write FStripQuotes;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TIniFile }
|
{ TIniFile }
|
||||||
@ -722,12 +724,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
sIdent:=Trim(Copy(sLine, 1, j - 1));
|
sIdent:=Trim(Copy(sLine, 1, j - 1));
|
||||||
sValue:=Trim(Copy(sLine, j + 1, Length(sLine) - j));
|
sValue:=Trim(Copy(sLine, j + 1, Length(sLine) - j));
|
||||||
J:=Length(sValue);
|
If StripQuotes then
|
||||||
// Joost, 2-jan-2007: The check (J>1) is there for the case that
|
begin
|
||||||
// the value consist of a single double-quote character. (see
|
J:=Length(sValue);
|
||||||
// mantis bug 6555)
|
// Joost, 2-jan-2007: The check (J>1) is there for the case that
|
||||||
If (J>1) and (sValue[1]='"') and (sValue[J]='"') then
|
// the value consist of a single double-quote character. (see
|
||||||
sValue:=Copy(sValue,2,J-2);
|
// mantis bug 6555)
|
||||||
|
If (J>1) and (sValue[1]='"') and (sValue[J]='"') then
|
||||||
|
sValue:=Copy(sValue,2,J-2);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
oSection.KeyList.Add(TIniFileKey.Create(sIdent, sValue));
|
oSection.KeyList.Add(TIniFileKey.Create(sIdent, sValue));
|
||||||
|
Loading…
Reference in New Issue
Block a user