mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 20:09:27 +02:00
--- Merging r33041 into '.':
U packages/fcl-base/src/streamex.pp --- Recording mergeinfo for merge of r33041 into '.': U . # revisions: 33041 git-svn-id: branches/fixes_3_0@33351 -
This commit is contained in:
parent
6a42afd135
commit
d4e7a67bb3
@ -179,6 +179,7 @@ type
|
|||||||
|
|
||||||
|
|
||||||
TStreamHelper = class helper for TStream
|
TStreamHelper = class helper for TStream
|
||||||
|
|
||||||
function ReadWordLE :word;
|
function ReadWordLE :word;
|
||||||
function ReadDWordLE:dword;
|
function ReadDWordLE:dword;
|
||||||
function ReadQWordLE:qword;
|
function ReadQWordLE:qword;
|
||||||
@ -191,6 +192,11 @@ type
|
|||||||
procedure WriteWordBE (w:word);
|
procedure WriteWordBE (w:word);
|
||||||
procedure WriteDWordBE(dw:dword);
|
procedure WriteDWordBE(dw:dword);
|
||||||
procedure WriteQWordBE(dq:qword);
|
procedure WriteQWordBE(dq:qword);
|
||||||
|
function ReadSingle:Single;
|
||||||
|
function ReadDouble:Double;
|
||||||
|
procedure WriteSingle(s:Single);
|
||||||
|
procedure WriteDouble(d:double);
|
||||||
|
|
||||||
{$ifndef FPC}
|
{$ifndef FPC}
|
||||||
function ReadByte : Byte;
|
function ReadByte : Byte;
|
||||||
function ReadWord : Word;
|
function ReadWord : Word;
|
||||||
@ -603,6 +609,24 @@ begin
|
|||||||
WriteQWord(NtoLE(dq));
|
WriteQWord(NtoLE(dq));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TStreamHelper.ReadSingle:Single;
|
||||||
|
begin
|
||||||
|
self.Read(result,sizeof(result));
|
||||||
|
end;
|
||||||
|
function TStreamHelper.ReadDouble:Double;
|
||||||
|
begin
|
||||||
|
self.Read(result,sizeof(result));
|
||||||
|
end;
|
||||||
|
procedure TStreamHelper.WriteSingle(s:Single);
|
||||||
|
begin
|
||||||
|
self.Write(s,sizeof(s));
|
||||||
|
end;
|
||||||
|
procedure TStreamHelper.WriteDouble(d:double);
|
||||||
|
begin
|
||||||
|
self.Write(d,sizeof(d));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ifndef FPC}
|
{$ifndef FPC}
|
||||||
// there can only be one helper per class, and I use these in Delphi for FPC compatibility.
|
// there can only be one helper per class, and I use these in Delphi for FPC compatibility.
|
||||||
function TStreamHelper.ReadByte: Byte;
|
function TStreamHelper.ReadByte: Byte;
|
||||||
|
Loading…
Reference in New Issue
Block a user