mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 07:26:24 +02:00
+ Added EscapeLinefeeds boolean property.
This commit is contained in:
parent
8e3de2ef1c
commit
d76972b365
@ -26,6 +26,7 @@ type
|
|||||||
|
|
||||||
TIniFile = class(TObject)
|
TIniFile = class(TObject)
|
||||||
private
|
private
|
||||||
|
FEscapeLineFeeds : Boolean;
|
||||||
FFileName : string;
|
FFileName : string;
|
||||||
FStream : TStream;
|
FStream : TStream;
|
||||||
FFileBuffer : TStringList;
|
FFileBuffer : TStringList;
|
||||||
@ -58,6 +59,7 @@ type
|
|||||||
procedure WriteInteger(const section, ident : string; value : longint);
|
procedure WriteInteger(const section, ident : string; value : longint);
|
||||||
procedure WriteString(const section, ident, value : string);
|
procedure WriteString(const section, ident, value : string);
|
||||||
property FileName : String read FFileName;
|
property FileName : String read FFileName;
|
||||||
|
property EscapeLineFeeds : Boolean Read FEscapeLineFeeds Write FEscapeLineFeeds default false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -76,6 +78,7 @@ constructor TIniFile.Create(const theFileName : string);
|
|||||||
begin
|
begin
|
||||||
FFileName := theFileName;
|
FFileName := theFileName;
|
||||||
FStream:=nil;
|
FStream:=nil;
|
||||||
|
FEscapeLineFeeds:=False;
|
||||||
FFileBuffer := TStringList.Create;
|
FFileBuffer := TStringList.Create;
|
||||||
|
|
||||||
if FileExists(fileName) then
|
if FileExists(fileName) then
|
||||||
@ -86,8 +89,8 @@ constructor TIniFile.Create(s:TStream);
|
|||||||
begin
|
begin
|
||||||
FFileName := '';
|
FFileName := '';
|
||||||
FStream:=s;
|
FStream:=s;
|
||||||
|
FEscapeLineFeeds:=False;
|
||||||
FFileBuffer := TStringList.Create;
|
FFileBuffer := TStringList.Create;
|
||||||
|
|
||||||
LoadFromStream;
|
LoadFromStream;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -279,7 +282,7 @@ begin
|
|||||||
if value <> '' then
|
if value <> '' then
|
||||||
begin
|
begin
|
||||||
result := value;
|
result := value;
|
||||||
if (result[length(result)]='\') then
|
if EscapeLineFeeds and (result[length(result)]='\') then
|
||||||
begin
|
begin
|
||||||
inc(index);
|
inc(index);
|
||||||
while (index < FFileBuffer.Count) and (result[length(result)]='\') do
|
while (index < FFileBuffer.Count) and (result[length(result)]='\') do
|
||||||
@ -481,7 +484,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.8 2000-01-07 01:24:33 peter
|
Revision 1.9 2000-03-11 15:56:17 michael
|
||||||
|
+ Added EscapeLinefeeds boolean property.
|
||||||
|
|
||||||
|
Revision 1.8 2000/01/07 01:24:33 peter
|
||||||
* updated copyright to 2000
|
* updated copyright to 2000
|
||||||
|
|
||||||
Revision 1.7 2000/01/06 01:20:33 peter
|
Revision 1.7 2000/01/06 01:20:33 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user