[Lazarus] CSV parser class

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sun Jan 24 15:28:25 CET 2010


Juha Manninen schrieb:

> Splitting can be slow. It creates and copies strings and allocates small 
> chunks of memory.

No way around that, unless you use PChars and zero terminated strings, 
which are slow in any further processing.

> There should be variations for those functions. Sometimes you want to support 
> quoted stings, sometimes not.

See StrictDelimiter.

> Sometimes you want TStrings, sometimes an array of string (which allows more 
> optimization).

TStrings allows for the same optimization, when you use [Set]Capacity 
instead of SetLength. Once configured for the expected field count, the 
TStrings object can be reused like an array.

DoDi





More information about the Lazarus mailing list