Declaration¶
Source position: csvreadwrite.pp line 167
type
TCSVBuilder = class(TCSVHandler)
public
constructor Create;
destructor Destroy;
procedure SetOutput;
procedure ResetBuilder;
procedure AppendCell;
procedure AppendRow;
property DefaultOutput: TMemoryStream; {r}
property DefaultOutputAsString: string; {r}
end;
Inheritance¶
Description¶
TCSVBuilder can be used to correctly write a CSV file. To use it, optionally set a stream to which the CSV file will be written using SetOutput, call AppendCell for each cell you wish to write, and call AppendRow when you want to start a new line. If you didn't specify an output stream, the output is available in DefaultOutput or DefaultOutputAsString.
Properties¶
| Member | Visibility | Description |
|---|---|---|
| DefaultOutput read only | public | Default output as stream. |
| DefaultOutputAsString read only | public | Default output as string value. |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| AppendCell | public | Append a cell to the output. |
| AppendRow | public | Append a new row. |
| Create | public | Create a new instance of TCSVBuilder. |
| Destroy | public | Free a TCSVBuilder instance. |
| ResetBuilder | public | Reset values. |
| SetOutput | public | Set the output stream to write to. |
See also¶
| Name | Description |
|---|---|
| SetOutput | Set the output stream to write to. |
| AppendCell | Append a cell to the output. |
| AppendRow | Append a new row. |
| DefaultOutput | Default output as stream. |
| DefaultOutputAsString | Default output as string value. |