| Qore CsvUtil Module Reference 1.7.2

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CsvUtil::CsvWriteDataProvider Class Reference

Provides a data provider for reading CSV files. More...

Inherits AbstractDataProvider.

## Public Member Functions
| constructor (string path, *hash< auto > opts)
| Creates the CsvWriteDataProvider with the output path and optionally an option hash. More...
| constructor (OutputStream stream, *hash< auto > opts)
| Creates the CsvWriteDataProvider with the output data stream where data will be writeen and an option hash. More...
| constructor (*hash< auto > options)
| Creates the object from constructor options.
string | getName ()
| Returns the object name.

## Public Attributes
const | ConstructorOptions = ...
| Constructor options.
const | CsvGenerationOptionList = keys (ConstructorOptions - ("path", "stream"))
| CSV generation option list.
const | ProviderInfo = ...
| Provider info.

## Protected Member Functions
*hash< auto > | createRecordImpl (hash< auto > rec, *hash< auto > create_options)
| Creates the given record to the data provider. More...
*hash< string, AbstractDataField > | getRecordTypeImpl (*hash< auto > search_options)
| Returns the description of the record type, if any.
hash< DataProviderInfo > | getStaticInfoImpl ()
| Returns data provider static info.

## Protected Attributes
AbstractCsvWriter | writer
| the writer object

## Detailed Description

Provides a data provider for reading CSV files.

## Member Function Documentation

## ◆ constructor() [1/2]

CsvUtil::CsvWriteDataProvider::constructor | ( | string | path,
|  | *hash< auto > | opts
| ) |  |

Creates the CsvWriteDataProvider with the output path and optionally an option hash.

Parameters

  path | the output file to write
  opts | a hash of options; see AbstractCsvWriter Constructor Option Hash Overview for more information

Exceptions

  CSVFILEWRITER-ERROR | option error

## ◆ constructor() [2/2]

CsvUtil::CsvWriteDataProvider::constructor | ( | OutputStream | stream,
|  | *hash< auto > | opts
| ) |  |

Creates the CsvWriteDataProvider with the output data stream where data will be writeen and an option hash.

Parameters

  stream | the output stream for writing the data
  opts | a hash of optional options; see AbstractCsvWriter Constructor Option Hash Overview for more information

Exceptions

  CSVSTREAMWRITER-ERROR | option error

## ◆ createRecordImpl()

*hash<auto> CsvUtil::CsvWriteDataProvider::createRecordImpl | ( | hash< auto > | rec,
|  | *hash< auto > | create_options
| ) |  |
| protected

Creates the given record to the data provider.

Parameters

  rec | a hash representing a single input record
  create_options | the create options after processing by validateCreateOptions()

Returns
  the data written to the data provider