- Recompilación en Delphi10 de todos los paquetes de RO para generar las DCU's en Lib\D10 - Recompilación en Delphi10 de todos los paquetes de DA para generar las DCU's en Lib\D10 git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@9 b6239004-a887-0f4b-9937-50029ccdca16
79 lines
1.9 KiB
ObjectPascal
79 lines
1.9 KiB
ObjectPascal
unit uRODLLineStream;
|
|
|
|
{----------------------------------------------------------------------------}
|
|
{ RemObjects SDK Library - CodeGen2 }
|
|
{ }
|
|
{ compiler: Delphi 5 and up, Kylix 2 and up }
|
|
{ platform: Win32, Linux }
|
|
{ }
|
|
{ (c)opyright RemObjects Software. all rights reserved. }
|
|
{ }
|
|
{ Using this code requires a valid license of the RemObjects SDK }
|
|
{ which can be obtained at http://www.remobjects.com. }
|
|
{----------------------------------------------------------------------------}
|
|
|
|
{$IFDEF LINUX}
|
|
{$I ../RemObjects.inc}
|
|
{$ELSE}
|
|
{$I ..\RemObjects.inc}
|
|
{$ENDIF LINUX}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes;
|
|
|
|
type
|
|
TLineStream = class(TStringStream)
|
|
private
|
|
function GetEof: Boolean;
|
|
public
|
|
function ReadLine: string;
|
|
procedure WriteLine(const line: string);
|
|
|
|
procedure Clear;
|
|
|
|
property Eof: Boolean read GetEof;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{ TLineStream }
|
|
|
|
procedure TLineStream.Clear;
|
|
begin
|
|
Size := 0;
|
|
end;
|
|
|
|
function TLineStream.GetEof: Boolean;
|
|
begin
|
|
Result := Position = Size;
|
|
end;
|
|
|
|
function TLineStream.ReadLine: string;
|
|
var
|
|
I: Integer;
|
|
begin
|
|
I := Position;
|
|
|
|
while (I < Size-1) and (DataString[I+1] <> #13) and (DataString[I+2] <> #10) do
|
|
Inc(I);
|
|
|
|
if I = Size-1 then
|
|
begin
|
|
Result := ReadString(I-Position+1);
|
|
end
|
|
else
|
|
begin
|
|
Result := ReadString(I-Position); // Do not eat the carriage return
|
|
Position := Position + 2;
|
|
end;
|
|
end;
|
|
|
|
procedure TLineStream.WriteLine(const line: string);
|
|
begin
|
|
WriteString(line + #13#10);
|
|
end;
|
|
|
|
end.
|