133 class ListValueIterator :
public ListIterator {
136 constructor(*
list l);
162 const FieldAttrs = (
"type",
"format",
"timezone",
"code");
170 checkType(
string key,
string value);
349 "ignore-empty":
True,
350 "ignore-whitespace":
True,
351 "header-lines":
True,
352 "header-names":
True,
354 "verify-columns":
True,
363 string separator =
",";
369 softint headerLines = 0;
372 bool headerNames =
False;
375 bool ignoreEmptyLines =
True;
378 bool ignoreWhitespace =
True;
393 bool checkElementCounts =
False;
549 private any handleType(
hash fh, *
string val);
728 "verify-columns":
True,
732 "write-headers":
True,
733 "optimal-quotes":
True,
743 string separator =
",";
752 string dateFormat =
'DD/MM/YYYY hh:mm:SS';
764 bool checkElementCounts =
False;
775 bool write_headers =
True;
778 bool optimal_quotes =
True;
818 write(AbstractIterator iterator);
833 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:339
*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:605
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:344
int lineno
current line number
Definition: CsvUtil.qm.dox.h:611
int pos
current byte pos
Definition: CsvUtil.qm.dox.h:609
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:723
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:563
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:867
the AbstractCsvWriter class provides a parent for all CSV writers
Definition: CsvUtil.qm.dox.h:718
const EOL_MACINTOSH
Old (pre-OSX) Macintosh end of line character sequence.
Definition: CsvUtil.qm.dox.h:181
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:177
*string line
current line
Definition: CsvUtil.qm.dox.h:607
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:179
the CsvDataIterator class allows arbitrary CSV string data to be iterated on a record basis ...
Definition: CsvUtil.qm.dox.h:598
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:603
the CsvFileWriter class for easy and safe CSV file creation
Definition: CsvUtil.qm.dox.h:839
private string getLineValueImpl()
Returns the current line trimmed of the EOL character(s)
abstract private writeRawLine(list values)
real write implementation. Without any checking.