Fl?vio Etrusco wrote 7 lines
Some (hopefully constructive) commentaries (and then I would suggest
to add to LCL or FCL):
1) It could be called really TStringBuffer;
2) The 'W' methods could be called 'Append';
3) The GetS method could truncate the string to avoid the copy, as I
think the common use will not be Append+Read+Append+Read, but
Append+Append+...+Read...
I agree in all points, even while having some more ideas on the naming. If it will be considered for FCL, then let the dev team pick identifiers of their choice and any other changes/improvements - I'll be happy to implement them if needed.
Could you explain what the advantages are of
that string buffer object compared to a standard string types like
AnsiString or TStringList?
I guess some memory and/or time could be saved in certain usage patterns compared to TSTringList and String. There is now a dumb benchmark on the blog, but nobody should trust other's benchmarks :)
http://freepascal-bits.blogspot.com/2010/02/string-buffer-performance.html
-bflm