⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ufilestreamtx.pas

📁 多数代码可以直接在Delphi6和Delphi7环境下运行。部分涉及.NET技术内容的代码
💻 PAS
字号:
unit uFileStreamTx;

interface

uses Classes, SysUtils;

type
  TFileStreamTx = class(TFileStream)
  private
    asStream : TStringStream;
  public
    Constructor Create(const FileName: string; Mode: Word);
    Destructor Destroy; override;
    function ReadLine(): string;
    procedure WriteLine(const sLine : String);
  end;

implementation

{ TFileStreamTx }

const
  iDelta = 4096;

constructor TFileStreamTx.Create(const FileName: string; Mode: Word);
begin
  inherited Create(FileName, Mode);
end;

destructor TFileStreamTx.Destroy;
begin
  FreeAndNil(asStream);
  inherited;
end;

function TFileStreamTx.ReadLine: string;
var
  iIndex : Integer;
  astr : String;
begin
  Read(astr, iDelta);
  asStream := TStringStream.Create(astr);
  iIndex := 1;
  while (asStream.DataString[iIndex] <> #13) do
    Inc(iIndex);
  Inc(iIndex);
  Result := asStream.ReadString(iIndex);
end;

procedure TFileStreamTx.WriteLine(const sLine: String);
begin

end;

end.
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -