[fpc-devel] Method for write string into TStream

LacaK lacak at zoznam.sk
Mon Jul 21 10:27:28 CEST 2014

When I work with f.e. TFileStream I need often write string into stream.
Now I use:
  Stream1.WriteBuffer(s[1], length(s));

I think, that for convenience it will be useful having something like:
procedure TStream.WriteString(const s: string);
    WriteBuffer(s[1], length(s)*sizeof(char);

In FPC we now have for user convenience also WriteByte, WriteWord, 
WriteQWord (which all calls WriteBuffer)
and Delphi has lot of overloaded WriteData (but none of them takes as 
parameter string):

Do you think, that something similar can be added also in FPC ?

More information about the fpc-devel mailing list