mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-05 07:31:07 +01:00
* Fixed TStringStream.ReadString
This commit is contained in:
parent
6ad0fac76b
commit
ed9d634231
@ -19,13 +19,13 @@
|
||||
function TStream.GetPosition: Int64;
|
||||
|
||||
begin
|
||||
Result:=Seek(0,soFromCurrent);
|
||||
Result:=Seek(0,soCurrent);
|
||||
end;
|
||||
|
||||
procedure TStream.SetPosition(Pos: Int64);
|
||||
|
||||
begin
|
||||
Seek(pos,soFromBeginning);
|
||||
Seek(pos,soBeginning);
|
||||
end;
|
||||
|
||||
procedure TStream.SetSize64(NewSize: Int64);
|
||||
@ -42,8 +42,8 @@
|
||||
|
||||
begin
|
||||
p:=GetPosition;
|
||||
GetSize:=Seek(0,soFromEnd);
|
||||
Seek(p,soFromBeginning);
|
||||
GetSize:=Seek(0,soEnd);
|
||||
Seek(p,soBeginning);
|
||||
end;
|
||||
|
||||
procedure TStream.SetSize(NewSize: Longint);
|
||||
@ -82,7 +82,7 @@
|
||||
if CurrClass<>nil then
|
||||
begin
|
||||
CurrSeek:=@Self.Seek;
|
||||
TStreamSeek:=@TStream(CurrClass).Seek;
|
||||
TStreamSeek:=@TStream(@CurrClass).Seek;
|
||||
if TMethod(TStreamSeek).Code=TMethod(CurrSeek).Code then
|
||||
CurrSeek:=nil;
|
||||
end;
|
||||
@ -99,7 +99,7 @@
|
||||
if (Offset<Low(longint)) or
|
||||
(Offset>High(longint)) then
|
||||
raise ERangeError.Create(SRangeError);
|
||||
Seek(longint(Offset),ord(Origin));
|
||||
Result:=Seek(longint(Offset),ord(Origin));
|
||||
end;
|
||||
|
||||
{$else seek64bit}
|
||||
@ -631,8 +631,8 @@ procedure TMemoryStream.LoadFromFile(const FileName: string);
|
||||
Var S : TFileStream;
|
||||
|
||||
begin
|
||||
S:=TFileStream.Create (FileName,fmOpenRead);
|
||||
Try
|
||||
S:=TFileStream.Create (FileName,fmOpenRead);
|
||||
LoadFromStream(S);
|
||||
finally
|
||||
S.free;
|
||||
@ -696,8 +696,8 @@ begin
|
||||
Result:=Length(FDataString)-FPosition;
|
||||
If Result>Count then Result:=Count;
|
||||
// This supposes FDataString to be of type AnsiString !
|
||||
Move (Pchar(FDataString)[FPosition],Buffer,Count);
|
||||
FPosition:=FPosition+Count;
|
||||
Move (Pchar(FDataString)[FPosition],Buffer,Result);
|
||||
FPosition:=FPosition+Result;
|
||||
end;
|
||||
|
||||
|
||||
@ -784,19 +784,22 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.6 2001-12-03 21:39:58 peter
|
||||
* seek(int64) overload only for 1.1 compiler
|
||||
Revision 1.12 2002-04-25 19:14:13 sg
|
||||
* Fixed TStringStream.ReadString
|
||||
|
||||
Revision 1.5 2001/11/24 20:41:40 carl
|
||||
* fix compilation under FPC version 1.0.x
|
||||
Revision 1.11 2002/12/18 16:45:33 peter
|
||||
* set function result in TStream.Seek(int64) found by Mattias Gaertner
|
||||
|
||||
Revision 1.4 2001/10/28 17:16:44 peter
|
||||
* int64 file functions added
|
||||
Revision 1.10 2002/12/18 16:35:59 peter
|
||||
* fix crash in Seek()
|
||||
|
||||
Revision 1.3 2001/03/08 19:38:32 michael
|
||||
+ Merged changes, fixed stringstream
|
||||
Revision 1.9 2002/12/18 15:51:52 michael
|
||||
+ Hopefully fixed some issues with int64 seek
|
||||
|
||||
Revision 1.8 2002/10/22 09:38:39 michael
|
||||
+ Fixed TmemoryStream.LoadFromStream, reported by Mattias Gaertner
|
||||
|
||||
Revision 1.7 2002/09/07 15:15:25 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
Revision 1.2 2000/07/13 11:33:00 michael
|
||||
+ removed logs
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user