FixedLengthAbstractWriter.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* FixedLengthAbstractWriter Copyright 2015 - 2022 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 FixedLengthAbstractWriter : public FixedLengthBase {
public:
protected:
string m_state;
int m_linescount = 0;
public:
constructor(hash<auto> specs, *hash<auto> opts)
;
protected:
static *hash<auto> checkOptions(*hash<auto> opts);
public:
int linesCount();
string formatLine(hash<auto> line);
bool checkTransition(*string from, *string to);
abstract write(hash<auto> line);
abstract write(list<auto> lines);
abstract write(Qore::AbstractIterator lines);
};
};
FixedLengthUtil::FixedLengthAbstractWriter
Structured abstract writer for fixed-length lines.
Definition: FixedLengthAbstractWriter.qc.dox.h:29
FixedLengthUtil::FixedLengthAbstractWriter::write
abstract write(Qore::AbstractIterator lines)
iterates the input records and writes rendered versions of all input records to the output
FixedLengthUtil::FixedLengthAbstractWriter::checkTransition
bool checkTransition(*string from, *string to)
A verification function to be called for each line. This method can be overridden to achieve a begin-...
FixedLengthUtil::FixedLengthAbstractWriter::formatLine
string formatLine(hash< auto > line)
Formats a single line from a hash describing the record type and its contents.
FixedLengthUtil::FixedLengthAbstractWriter::write
abstract write(list< auto > lines)
iterates the input records and writes rendered versions of all input records to the output
FixedLengthUtil::FixedLengthAbstractWriter::write
abstract write(hash< auto > line)
Renders a single line for a single input record hash to the output.
FixedLengthUtil::FixedLengthAbstractWriter::linesCount
int linesCount()
get processed lines count
FixedLengthUtil::FixedLengthAbstractWriter::constructor
constructor(hash< auto > specs, *hash< auto > opts)
creates the FixedLengthAbstractWriter object
FixedLengthUtil::FixedLengthBase
Base class for fixed-length readers and writers.
Definition: FixedLengthBase.qc.dox.h:29
Qore::AbstractIterator
FixedLengthUtil
The FixedLengthUtil namespace contains all the definitions in the FixedLengthUtil module.
Definition: FixedLengthAbstractIterator.qc.dox.h:27