| Qore CsvUtil Module Reference 1.7.2

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

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

Inherits AbstractDataProvider.

## Public Member Functions
| constructor (string path, *hash< auto > opts)
| Creates the CsvReadDataProvider with the input data path and optionally an option hash. More...
| constructor (InputStream stream, *hash< auto > opts)
| Creates the CsvReadDataProvider with the input data stream and optionally 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 | CsvIterationOptionList = keys (ConstructorOptions - ("path", "stream"))
| CSV iteration option list.
const | ProviderInfo = ...
| Provider info.

## Protected Member Functions
*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.
AbstractDataProviderRecordIterator | searchRecordsImpl (*hash< auto > where_cond, *hash< auto > search_options)
| Returns an iterator for zero or more records matching the search options. More...

## Protected Attributes
AbstractCsvIterator | i
| the iterator object

## Detailed Description

Provides a data provider for reading CSV files.

## Member Function Documentation

## ◆ constructor() [1/2]

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

Creates the CsvReadDataProvider with the input data path and optionally an option hash.

Parameters

  path | the input file to iterate
  opts | a hash of optional options; see AbstractCsvIterator Constructor Option Hash Overview for more information

Exceptions

  ABSTRACTCSVITERATOR-ERROR | invalid or unknown option; invalid data type for option; `"header_names"` is True and `"headers"` is also present; unknown field type

## ◆ constructor() [2/2]

CsvUtil::CsvReadDataProvider::constructor | ( | InputStream | stream,
|  | *hash< auto > | opts
| ) |  |

Creates the CsvReadDataProvider with the input data stream and optionally an option hash.

Parameters

  stream | the input stream to iterate
  opts | a hash of optional options; see AbstractCsvIterator Constructor Option Hash Overview for more information

Exceptions

  ABSTRACTCSVITERATOR-ERROR | invalid or unknown option; invalid data type for option; `"header_names"` is True and `"headers"` is also present; unknown field type

## ◆ searchRecordsImpl()

AbstractDataProviderRecordIterator CsvUtil::CsvReadDataProvider::searchRecordsImpl | ( | *hash< auto > | where_cond,
|  | *hash< auto > | search_options
| ) |  |
| protected

Returns an iterator for zero or more records matching the search options.

Parameters

  where_cond | the search criteria
  search_options | the search options after processing by validateSearchOptions()