Qore FixedLengthUtil Module Reference  1.2
FixedLengthUtil::FixedLengthReadDataProvider Class Reference

Provides a data provider for reading fixed-length files. More...

Inherits AbstractDataProvider.

Public Member Functions

 constructor (*hash< auto > options)
 Creates the object from constructor options.
 
 constructor (InputStream stream, *string encoding, hash< auto > spec, *hash< auto > opts)
 Creates the FixedLengthReadDataProvider from a binary input data stream, the record specifications, and optionally an option hash. More...
 
 constructor (string path, hash< auto > spec, *hash< auto > opts)
 Creates the FixedLengthReadDataProvider with the input data path, the record specifications, and optionally an option hash. More...
 
 constructor (StringInputStream stream, hash< auto > spec, *hash< auto > opts)
 Creates the FixedLengthReadDataProvider with the string input data stream, the record specifications, and optionally an option hash. More...
 
string getName ()
 Returns the object name.
 

Public Attributes

const ConstructorOptions
 Constructor options.
 
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

FixedLengthAbstractIterator i
 The iterator object.
 

Detailed Description

Provides a data provider for reading fixed-length files.

Member Function Documentation

◆ constructor() [1/3]

FixedLengthUtil::FixedLengthReadDataProvider::constructor ( InputStream  stream,
*string  encoding,
hash< auto >  spec,
*hash< auto >  opts 
)

Creates the FixedLengthReadDataProvider from a binary input data stream, the record specifications, and optionally an option hash.

Parameters
streamthe input stream to iterate
encodingthe encoding of the string data in the binary input stream
specFixed-length line specification; see Specification Hash for more information
optsa hash of options; see Global Options for more information
Exceptions
FIXED-LENGTH-UTIL-INVALID-SPECinvalid record specification; invalid type or missing field length

◆ constructor() [2/3]

FixedLengthUtil::FixedLengthReadDataProvider::constructor ( string  path,
hash< auto >  spec,
*hash< auto >  opts 
)

Creates the FixedLengthReadDataProvider with the input data path, the record specifications, and optionally an option hash.

Parameters
paththe input file to iterate
specFixed-length line specification; see Specification Hash for more information
optsa hash of options; see Global Options for more information
Exceptions
FIXED-LENGTH-UTIL-INVALID-SPECinvalid record specification; invalid type or missing field length

◆ constructor() [3/3]

FixedLengthUtil::FixedLengthReadDataProvider::constructor ( StringInputStream  stream,
hash< auto >  spec,
*hash< auto >  opts 
)

Creates the FixedLengthReadDataProvider with the string input data stream, the record specifications, and optionally an option hash.

Parameters
streamthe string input stream to iterate
specFixed-length line specification; see Specification Hash for more information
optsa hash of options; see Global Options for more information
Exceptions
FIXED-LENGTH-UTIL-INVALID-SPECinvalid record specification; invalid type or missing field length

◆ searchRecordsImpl()

AbstractDataProviderRecordIterator FixedLengthUtil::FixedLengthReadDataProvider::searchRecordsImpl ( *hash< auto >  where_cond,
*hash< auto >  search_options 
)
protected

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

Parameters
where_condthe search criteria
search_optionsthe search options after processing by validateSearchOptions()