134 class ListValueIterator :
public ListIterator {
137 constructor(*
list l);
163 const FieldAttrs = (
"type",
"format",
"timezone",
"code");
171 checkType(
string key,
string value);
350 "ignore-empty":
True,
351 "ignore-whitespace":
True,
352 "header-lines":
True,
353 "header-names":
True,
355 "verify-columns":
True,
364 string separator =
",";
370 softint headerLines = 0;
373 bool headerNames =
False;
376 bool ignoreEmptyLines =
True;
379 bool ignoreWhitespace =
True;
394 bool checkElementCounts =
False;
550 private any handleType(
hash fh, *
string val);
720 "verify-columns":
True,
733 string separator =
",";
742 string dateFormat =
'DD/MM/YYYY hh:mm:SS';
754 bool checkElementCounts =
False;
802 write(AbstractIterator iterator);
817 private string dateFormat(
int ix);
private writeRawLine(list values)
real write implementation. Without any checking.
string getQuote()
returns the current quote string
string get_default_encoding()
list getRecordList()
returns the current record as a list
constructor(string data, *hash opts)
creates the CsvDataIterator with the input data and optionally an option hash
constructor(*hash opts)
creates the CsvStringWriter with content in the memory
private string prepareRawLine(list values)
Prepare a string (line with EOF) with formatting and escaping.
private list parseLine()
parses a line in the file and returns a processed list of the fields
the CsvAbstractIterator class is an abstract base class that allows abstract CSV data to be iterated ...
Definition: CsvUtil.qm.dox.h:340
*list getHeaders()
returns the current column headers or NOTHING if no headers have been detected or saved yet ...
write(AbstractIterator iterator)
stream iterator into the file.
private *string getDataName()
Returns the name of the input data.
*string eol
EOL marker.
Definition: CsvUtil.qm.dox.h:606
int lineNumber()
returns the current iterator line number in the file (the first line is line 1) or 0 if not pointing ...
hash getValue()
returns the current record as a hash
constructor(string errname, *hash opts)
creates the AbstractCsvWriter
hash getRecord()
returns the current record as a hash
bool next()
Moves the current line / record position to the next line / record; returns False if there are no mor...
private bool nextLineImpl()
Moves the current line / record position to the next line / record; returns False if there are no mor...
private writeRawLine(list values)
real write implementation. Without any checking.
const Options
valid options for the object (a hash for quick lookups of valid keys)
Definition: CsvUtil.qm.dox.h:345
int lineno
current line number
Definition: CsvUtil.qm.dox.h:612
int pos
current byte pos
Definition: CsvUtil.qm.dox.h:610
private int lineNumberImpl()
Returns the current line number.
constructor(string path, *hash opts)
creates the CsvFileIterator with the path of the file to read and optionally an option hash ...
private *string getDataName()
Returns the name of the input data.
const Options
valid options for the object (a hash for quick lookups of valid keys)
Definition: CsvUtil.qm.dox.h:715
abstract private string getLineValueImpl()
Returns the current line.
the CsvFileIterator class allows CSV files to be iterated on a record basis
Definition: CsvUtil.qm.dox.h:564
string getContent()
Get the current in-memory content as a string.
constructor(*hash opts)
creates the CsvAbstractIterator with an option hash
the CsvStringWriter class for in-memory string CSV creation
Definition: CsvUtil.qm.dox.h:851
the AbstractCsvWriter class provides a parent for all CSV writers
Definition: CsvUtil.qm.dox.h:710
const EOL_MACINTOSH
Old (pre-OSX) Macintosh end of line character sequence.
Definition: CsvUtil.qm.dox.h:182
any memberGate(string name)
returns the given column value for the current row
private bool nextLineImpl()
Moves the current line / record position to the next line / record; returns False if there are no mor...
const EOL_UNIX
Unix end of line character sequence (for new OS X too)
Definition: CsvUtil.qm.dox.h:178
*string line
current line
Definition: CsvUtil.qm.dox.h:608
private int lineNumberImpl()
Returns the current line number; returns 0 if not pointing at any data.
writeLine(list values)
write a line with list of values. Data are checked against column rules.
int index()
returns the row index being iterated, which does not necessarily correspond to the line number when t...
string getSeparator()
returns the current separator string
private string getLineValueImpl()
Returns the current line trimmed of the EOL character(s)
const EOL_WIN
MS DOS/Windows end of line character sequence.
Definition: CsvUtil.qm.dox.h:180
the CsvDataIterator class allows arbitrary CSV string data to be iterated on a record basis ...
Definition: CsvUtil.qm.dox.h:599
bool valid()
returns True if the iterator is currently pointing at a valid element, False if not ...
constructor(string path, *hash opts)
creates the CsvFileWriter with the path of the file to read with an options
abstract private bool nextLineImpl()
Moves the current line / record position to the next line / record; returns False if there are no mor...
abstract private int lineNumberImpl()
Returns the current line number.
string data
input data
Definition: CsvUtil.qm.dox.h:604
the CsvFileWriter class for easy and safe CSV file creation
Definition: CsvUtil.qm.dox.h:823
private string getLineValueImpl()
Returns the current line trimmed of the EOL character(s)
abstract private writeRawLine(list values)
real write implementation. Without any checking.