284 const FieldAttrs = (
"type",
"format",
"timezone",
"code",
"header");
299 bool headerReorder =
True;
305 constructor (
string n_errname);
309 private bool isMultiType();
313 private checkType(
string fld_errs,
string key,
string value);
317 private hash getSpec(*
hash fields,
string fld_errs,
int C_OPTx);
320 private hash getSpec1(*
hash fields);
330 private list adjustFieldsFromHeaders(
string type, *
list headers);
598 "date_format": C_OPT1|C_OPT2,
599 "date-format": C_OPT1|C_OPT2,
600 "encoding": C_OPT1|C_OPT2,
601 "eol": C_OPT1|C_OPT2,
602 "extended_record": C_OPT2,
604 "header-lines": C_OPT1|C_OPT2,
605 "header_lines": C_OPT1|C_OPT2,
606 "header-names": C_OPT1|C_OPT2,
607 "header_names": C_OPT1|C_OPT2,
608 "header_reorder": C_OPT1|C_OPT2,
610 "ignore-empty": C_OPT1|C_OPT2,
611 "ignore_empty": C_OPT1|C_OPT2,
612 "ignore-whitespace": C_OPT1|C_OPT2,
613 "ignore_whitespace": C_OPT1|C_OPT2,
614 "quote": C_OPT1|C_OPT2,
615 "separator": C_OPT1|C_OPT2,
616 "timezone": C_OPT1|C_OPT2,
617 "tolwr": C_OPT1|C_OPT2,
618 "verify-columns": C_OPT1|C_OPT2,
619 "verify_columns": C_OPT1|C_OPT2,
623 string separator =
",";
629 softint headerLines = 0;
632 bool headerNames =
False;
635 bool ignoreEmptyLines =
True;
638 bool ignoreWhitespace =
True;
644 bool checkElementCounts =
False;
647 bool extendedRecord =
False;
656 hash m_resolve_by_rule;
659 hash m_resolve_by_count;
662 hash m_resolve_by_idx;
665 bool fakeHeaderNames;
675 constructor(*
hash opts);
688 private processCommonOptions(*
hash opts,
int C_OPTx);
692 private processSpec(
hash spec);
696 private prepareFieldsFromHeaders(*
list headers);
700 private *
string getDataName();
704 private abstract int lineNumberImpl();
707 private abstract string getLineValueImpl();
710 private abstract bool nextLineImpl();
729 any memberGate(
string name);
761 hash getRecord(
bool extended);
803 string getSeparator();
871 private any handleType(
hash fh, *
string val);
875 private list getLineAndSplit();
886 string identifyType(
list rec);
897 private *
string identifyTypeImpl(
list rec);
901 private hash parseLine();
920 constructor(
string path, *
hash opts) ;
927 constructor(
string path,
hash spec,
hash opts) ;
930 any memberGate(
string name);
934 private *
string getDataName();
938 private int lineNumberImpl();
942 private string getLineValueImpl();
946 private bool nextLineImpl();
966 constructor(
string data, *
hash opts) ;
974 constructor(
string data,
hash spec,
hash opts) ;
977 any memberGate(
string name);
981 private int lineNumberImpl();
985 private string getLineValueImpl();
989 private bool nextLineImpl();
1109 "block": C_OPT1|C_OPT2,
1111 "date_format": C_OPT1|C_OPT2,
1112 "date-format": C_OPT1|C_OPT2,
1113 "encoding": C_OPT1|C_OPT2,
1114 "eol": C_OPT1|C_OPT2,
1117 "header_reorder": C_OPT1,
1118 "info_log": C_OPT1|C_OPT2,
1119 "optimal_quotes": C_OPT1|C_OPT2,
1120 "optimal-quotes": C_OPT1|C_OPT2,
1121 "quote": C_OPT1|C_OPT2,
1122 "quote_escape": C_OPT1|C_OPT2,
1123 "separator": C_OPT1|C_OPT2,
1124 "verify_columns": C_OPT1|C_OPT2,
1125 "verify-columns": C_OPT1|C_OPT2,
1126 "write_headers": C_OPT1|C_OPT2,
1127 "write-headers": C_OPT1|C_OPT2,
1134 string separator =
",";
1137 string quote =
"\"";
1140 string m_quoteEscapeChar =
"\\";
1181 constructor(
string n_errname, *
hash n_opts);
1193 constructor(
string n_errname,
hash spec,
hash n_opts);
1197 private processCommonOptions(*
hash n_opts,
int C_OPTx);
1201 private processSpec();
1205 private writeHeaders();
1214 writeLine(
list values);
1223 writeLine(
hash values);
1233 writeLine(
string type,
list values);
1243 writeLine(
string type,
hash values);
1280 abstract private writeRawLine(
list values);
1287 private string prepareRawLine(
list values);
1312 constructor(
string path, *
hash opts) ;
1325 constructor(
string path,
hash spec,
hash opts) ;
1328 private openFile(
string path);
1331 private writeRawLine(
list values);
1353 constructor(*
hash opts) ;
1363 constructor(
hash spec,
hash opts) ;
1366 private initContent();
1369 private writeRawLine(
list values);
1395 string write(
list l);
1399 string getContent();
hash m_out_by_name
mapping output field by name
Definition: CsvUtil.qm.dox.h:1167
the AbstractCsvIterator class is an abstract base class that allows abstract CSV data to be iterated ...
Definition: CsvUtil.qm.dox.h:592
hash m_out_by_idx
mapping output field by index
Definition: CsvUtil.qm.dox.h:1170
*code info_log
a closure/call reference for informational logging when using write(SQLStatement) ...
Definition: CsvUtil.qm.dox.h:1164
The CsvFileIterator class allows CSV files to be iterated on a record basis.
Definition: CsvUtil.qm.dox.h:911
int index(softstring str, softstring substr, softint pos=0)
The CsvStringWriter class for in-memory string CSV creation.
Definition: CsvUtil.qm.dox.h:1337
The AbstractCsvWriter class provides a parent for all CSV writers.
Definition: CsvUtil.qm.dox.h:1103
string baseTemplate
base template for value format
Definition: CsvUtil.qm.dox.h:1155
const EOL_MACINTOSH
Old (pre-OSX) Macintosh end of line character sequence.
Definition: CsvUtil.qm.dox.h:342
const CSV_TYPE_UNKNOWN
Record type when non matching any type.
Definition: CsvUtil.qm.dox.h:348
const EOL_UNIX
Unix end of line character sequence (for new OS X too)
Definition: CsvUtil.qm.dox.h:338
const EOL_WIN
MS DOS/Windows end of line character sequence.
Definition: CsvUtil.qm.dox.h:340
The CsvDataIterator class allows arbitrary CSV string data to be iterated on a record basis...
Definition: CsvUtil.qm.dox.h:956
string encoding
output file character encoding
Definition: CsvUtil.qm.dox.h:1131
the CsvUtil namespace contains all the objects in the CsvUtil module
Definition: CsvUtil.qm.dox.h:336
The CsvFileWriter class for safe CSV file creation.
Definition: CsvUtil.qm.dox.h:1293
const CSV_TYPE_SINGLE
Record type when multi-type is disabled.
Definition: CsvUtil.qm.dox.h:350