FixedLengthReadDataProvider.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* FixedLengthReadDataProvider Copyright 2015 - 2020 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
namespace FixedLengthUtil {
class FixedLengthReadDataProvider : public DataProvider::AbstractDataProvider {
public:
const ProviderInfo = <DataProviderInfo>{
"type": "FixedLengthReadDataProvider",
"supports_read": True,
"has_record": True,
"constructor_options": ConstructorOptions,
};
const ConstructorOptions = {
"path": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType),
"desc": "the path to the fixed-length data; mutually exclusive with \"stream\"",
},
"stream": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(new Type("InputStream")),
"desc": "the input stream for fixed-length data; mutually exclusive with \"path\"",
},
"spec": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(AutoHashType),
"desc": "the fixed-length record specification hash",
"required": True,
},
"opts": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(AutoHashType),
"desc": "fixed-length parsing options",
},
};
protected:
FixedLengthAbstractIterator i;
public:
constructor(string path, hash<auto> spec, *hash<auto> opts);
constructor(StringInputStream stream, hash<auto> spec, *hash<auto> opts);
constructor(InputStream stream, *string encoding, hash<auto> spec, *hash<auto> opts);
constructor(*hash<auto> options);
string getName();
protected:
AbstractDataProviderRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
public:
protected:
*hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
public:
protected:
hash<DataProviderInfo> getStaticInfoImpl();
public:
};
};
FixedLengthUtil::FixedLengthReadDataProvider::getName
string getName()
Returns the object name.
FixedLengthUtil::FixedLengthReadDataProvider::getRecordTypeImpl
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
FixedLengthUtil::FixedLengthReadDataProvider::getStaticInfoImpl
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
True
const True
FixedLengthUtil::FixedLengthAbstractIterator
Structured line iterator for abstract data allowing efficient "pipelined" processing.
Definition: FixedLengthAbstractIterator.qc.dox.h:29
FixedLengthUtil::FixedLengthReadDataProvider::constructor
constructor(string path, hash< auto > spec, *hash< auto > opts)
Creates the FixedLengthReadDataProvider with the input data path, the record specifications,...
FixedLengthUtil
The FixedLengthUtil namespace contains all the definitions in the FixedLengthUtil module.
Definition: FixedLengthAbstractIterator.qc.dox.h:27
FixedLengthUtil::FixedLengthReadDataProvider::searchRecordsImpl
AbstractDataProviderRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
FixedLengthUtil::FixedLengthReadDataProvider
Provides a data provider for reading fixed-length files.
Definition: FixedLengthReadDataProvider.qc.dox.h:29
FixedLengthUtil::FixedLengthReadDataProvider::ConstructorOptions
const ConstructorOptions
Constructor options.
Definition: FixedLengthReadDataProvider.qc.dox.h:41
FixedLengthUtil::FixedLengthReadDataProvider::ProviderInfo
const ProviderInfo
Provider info.
Definition: FixedLengthReadDataProvider.qc.dox.h:33
FixedLengthUtil::FixedLengthReadDataProvider::i
FixedLengthAbstractIterator i
The iterator object.
Definition: FixedLengthReadDataProvider.qc.dox.h:63