Qore json Module 1.11.0
Loading...
Searching...
No Matches
NdjsonDataProvider::NdjsonReadDataProvider Class Reference

Data provider for reading NDJSON data. More...

#include <NdjsonReadDataProvider.qc.dox.h>

Inherits DataProvider::AbstractDataProvider.

Public Member Methods

void constructor (hash< NdjsonReadDataProviderOptions > options)
 Creates the provider.
 
void constructor (soft< hash< auto > > options)
 Creates the provider from a hash.
 
string getName ()
 Returns the data provider name.
 
soft< string > getDesc ()
 Returns the data provider description.
 
AbstractDataProviderRecordIterator searchRecordsImpl (soft< hash< auto > > where_cond, soft< hash< auto > > search_options)
 Returns an iterator for the records.
 
hash< NdjsonIteratorOptionsgetIteratorOptions ()
 Returns the iterator options.
 
AbstractIterator getIterator ()
 Creates and returns the appropriate iterator.
 
hash< DataProviderInfo > getStaticInfoImpl ()
 Returns static provider info.
 

Public Attributes

const auto ProviderInfo = ...
 Provider info.
 
const auto ConstructorOptions = ...
 Constructor options.
 

Private Attributes

hash< NdjsonReadDataProviderOptionsopts
 Provider options.
 

Detailed Description

Data provider for reading NDJSON data.

This data provider allows reading NDJSON data from files, streams, or strings using the DataProvider API.

Example
NdjsonReadDataProvider provider({"path": "data.ndjson"});
AbstractDataProviderRecordIterator i = provider.searchRecords();
map printf("Record: %y\n", $1), i;

Member Function Documentation

◆ constructor() [1/2]

void NdjsonDataProvider::NdjsonReadDataProvider::constructor ( hash< NdjsonReadDataProviderOptions options)

Creates the provider.

Parameters
optionsprovider options; one of path, stream, or data must be provided
Exceptions
NDJSON-ERRORif no input source is provided

◆ constructor() [2/2]

void NdjsonDataProvider::NdjsonReadDataProvider::constructor ( soft< hash< auto > >  options)

Creates the provider from a hash.

Parameters
optionsprovider options as a generic hash

◆ searchRecordsImpl()

AbstractDataProviderRecordIterator NdjsonDataProvider::NdjsonReadDataProvider::searchRecordsImpl ( soft< hash< auto > >  where_cond,
soft< hash< auto > >  search_options 
)

Returns an iterator for the records.

Parameters
where_condnot used
search_optionsnot used
Returns
an iterator for the NDJSON records

The documentation for this class was generated from the following file: