You are not logged in.
@ab,
I noticed the `TTextWriter.AddLine` method is defined as:
TTextWriter.AddLine(const Text: shortstring)
Why `shortstring` which is limited to 255 characters but not `RawUtf8`?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
It has a benefit of using a single method for shortstring, which can be written directly into the memory buffer, whereas it is not possible with a RawUTF8.
Just call AddCR or AddCRAndIndent after appending the RawUTF8.
Offline
Sorry, but it's still not clear to me if I can pass a RawUTF8 string to the AddLine method? It compiles, and is it really OK? Thanks!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
OK, had to add a 'class helper' for TTextWriter, like the following:
procedure TTextWriterHelper.AddUtf8Line(const aLine: RawUtf8);
begin
self.AddString(aLine);
Self.AddCR;
end;
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline