mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 06:29:25 +01:00
+ get/putansistring
git-svn-id: branches/usersections@17153 -
This commit is contained in:
parent
f0d5c63728
commit
e4656050a7
@ -186,6 +186,8 @@ type
|
||||
nr : byte;
|
||||
end;
|
||||
|
||||
{ tppufile }
|
||||
|
||||
tppufile=class
|
||||
private
|
||||
f : file;
|
||||
@ -260,6 +262,7 @@ type
|
||||
function getaword:aword;
|
||||
function getreal:ppureal;
|
||||
function getstring:string;
|
||||
function getansistring:ansistring;
|
||||
procedure getnormalset(var b);
|
||||
procedure getsmallset(var b);
|
||||
function skipuntilentry(untilb:byte):boolean;
|
||||
@ -280,6 +283,7 @@ type
|
||||
procedure putaword(i:aword);
|
||||
procedure putreal(d:ppureal);
|
||||
procedure putstring(const s:string);
|
||||
procedure putansistring(const s:ansistring);
|
||||
procedure putnormalset(const b);
|
||||
procedure putsmallset(const b);
|
||||
procedure tempclose;
|
||||
@ -789,6 +793,22 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function tppufile.getansistring: ansistring;
|
||||
var
|
||||
l : longint;
|
||||
begin
|
||||
l:=getlongint;
|
||||
if entryidx+l>entry.size then
|
||||
begin
|
||||
error:=true;
|
||||
exit;
|
||||
end;
|
||||
SetLength(Result,l);
|
||||
ReadData(result[1],l);
|
||||
inc(entryidx,l);
|
||||
end;
|
||||
|
||||
|
||||
procedure tppufile.getsmallset(var b);
|
||||
var
|
||||
i : longint;
|
||||
@ -1131,6 +1151,16 @@ procedure tppufile.putstring(const s:string);
|
||||
end;
|
||||
|
||||
|
||||
procedure tppufile.putansistring(const s: ansistring);
|
||||
var
|
||||
l : longint;
|
||||
begin
|
||||
l:=length(s);
|
||||
putdata(l,4);
|
||||
putdata(s[1],l);
|
||||
end;
|
||||
|
||||
|
||||
procedure tppufile.putsmallset(const b);
|
||||
var
|
||||
l : longint;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user