CSV Documentation

Jesse Phillips jessekphillips+d at gmail.com
Thu Aug 11 07:36:24 PDT 2011


On Wed, 10 Aug 2011 23:42:17 -0400, dsimcha wrote:

> Looks pretty good.  The examples are very simple and useful.  I'd be
> able to figure out how to use that module in a few minutes.
> 
> One point of clarification:  You can combine the struct example with the
> header example, right?  E.g.:
> 
>   string str = "Name,Value,Other\nHello,65,63.63\nWorld,123,3673.562";
>   struct Layout {
>       string name;
>       int value;
>   }
> 
>   auto records = csvText!Layout(str, ["Name", "Value"]);
> 
>   foreach(record; records) {
>       writeln(record.name);
>       writeln(record.value);
>   }

"If the Content type is a struct then the heading provided is expected to 
correspond to the fields in the struct. When Content is non-struct the 
heading must be provided in the same order as the file or an exception is 
thrown."

Does that mean I should have a an example of this?

> Also, I'd strongly recommend using CandyDoc or something when presenting
> ddoc documentation.  IMHO ddoc needs a more reasonable/readable default
> documentation style.  The default is very annoying to read.

True, I'll see about updating tonight.


More information about the Digitalmars-d mailing list