316 const FieldAttrs = (
"type",
"format",
"timezone",
"code",
"header");
331 bool headerReorder =
True;
337 constructor (
string n_errname);
350 checkType(
string fld_errs,
string key,
string value);
357 hash getSpec(*
hash fields,
string fld_errs,
int C_OPTx);
647 "date_format": C_OPT1|C_OPT2,
648 "date-format": C_OPT1|C_OPT2,
649 "encoding": C_OPT1|C_OPT2,
650 "eol": C_OPT1|C_OPT2,
651 "extended_record": C_OPT2,
653 "header-lines": C_OPT1|C_OPT2,
654 "header_lines": C_OPT1|C_OPT2,
655 "header-names": C_OPT1|C_OPT2,
656 "header_names": C_OPT1|C_OPT2,
657 "header_reorder": C_OPT1|C_OPT2,
659 "ignore-empty": C_OPT1|C_OPT2,
660 "ignore_empty": C_OPT1|C_OPT2,
661 "ignore-whitespace": C_OPT1|C_OPT2,
662 "ignore_whitespace": C_OPT1|C_OPT2,
663 "quote": C_OPT1|C_OPT2,
664 "separator": C_OPT1|C_OPT2,
665 "timezone": C_OPT1|C_OPT2,
666 "tolwr": C_OPT1|C_OPT2,
667 "verify-columns": C_OPT1|C_OPT2,
668 "verify_columns": C_OPT1|C_OPT2,
672 string separator =
",";
678 softint headerLines = 0;
681 bool headerNames =
False;
684 bool ignoreEmptyLines =
True;
687 bool ignoreWhitespace =
True;
693 bool checkElementCounts =
False;
696 bool extendedRecord =
False;
705 hash m_resolve_by_rule;
708 hash m_resolve_by_count;
711 hash m_resolve_by_idx;
714 bool fakeHeaderNames;
717 AbstractLineIterator lineIterator;
728 constructor(AbstractLineIterator li, *
hash opts);
738 constructor(AbstractLineIterator li,
hash spec,
hash opts);
744 processCommonOptions(*
hash opts,
int C_OPTx);
751 processSpec(
hash spec);
758 prepareFieldsFromHeaders(*
list headers);
782 auto memberGate(
string name);
814 hash getRecord(
bool extended);
845 auto getRecordList();
856 string getSeparator();
924 auto handleType(
hash fh, *
string val);
931 list getLineAndSplit();
943 string identifyType(
list rec);
956 *
string identifyTypeImpl(
list rec);
1017 auto memberGate(
string name);
1044 constructor(
string path, *
hash opts) ;
1052 constructor(
string path,
hash spec,
hash opts) ;
1056 auto memberGate(
string name);
1060 string getEncoding();
1064 string getFileName();
1068 hash<Qore::StatInfo>
hstat();
1094 constructor(
string data, *
hash opts) ;
1102 constructor(
string data,
hash spec,
hash opts) ;
1105 auto memberGate(
string name);
1226 "block": C_OPT1|C_OPT2,
1228 "date_format": C_OPT1|C_OPT2,
1229 "date-format": C_OPT1|C_OPT2,
1230 "encoding": C_OPT1|C_OPT2,
1231 "eol": C_OPT1|C_OPT2,
1234 "header_reorder": C_OPT1,
1235 "info_log": C_OPT1|C_OPT2,
1236 "optimal_quotes": C_OPT1|C_OPT2,
1237 "optimal-quotes": C_OPT1|C_OPT2,
1238 "quote": C_OPT1|C_OPT2,
1239 "quote_escape": C_OPT1|C_OPT2,
1240 "separator": C_OPT1|C_OPT2,
1241 "verify_columns": C_OPT1|C_OPT2,
1242 "verify-columns": C_OPT1|C_OPT2,
1243 "write_headers": C_OPT1|C_OPT2,
1244 "write-headers": C_OPT1|C_OPT2,
1251 string separator =
",";
1254 string quote =
"\"";
1257 string m_quoteEscapeChar =
"\\";
1298 constructor(
string n_errname, *
hash n_opts);
1310 constructor(
string n_errname,
hash spec,
hash n_opts);
1316 processCommonOptions(*
hash n_opts,
int C_OPTx);
1340 writeLine(
list values);
1349 writeLine(
hash values);
1359 writeLine(
string type,
list values);
1369 writeLine(
string type,
hash values);
1408 abstract writeRawLine(
list values);
1419 string prepareRawLine(
list values);
1425 string prepareRawLineIntern(
list values);
1465 writeRawLine(
list values);
1493 constructor(
string path, *
hash opts) ;
1506 constructor(
string path,
hash spec,
hash opts) ;
1511 openFile(
string path);
1517 writeRawLine(
list values);
1542 constructor(*
hash opts) ;
1552 constructor(
hash spec,
hash opts) ;
1563 writeRawLine(
list values);
1590 string write(
list l);
1594 string getContent();
hash m_out_by_name
mapping output field by name
Definition: CsvUtil.qm.dox.h:1284
the AbstractCsvIterator class is an abstract base class that allows abstract CSV data to be iterated ...
Definition: CsvUtil.qm.dox.h:641
Qore::File file
the file to write
Definition: CsvUtil.qm.dox.h:1480
hash m_out_by_idx
mapping output field by index
Definition: CsvUtil.qm.dox.h:1287
*code info_log
a closure/call reference for informational logging when using write(SQLStatement) ...
Definition: CsvUtil.qm.dox.h:1281
*hash< StatInfo > hstat(string path)
The CsvFileIterator class allows CSV files to be iterated on a record basis.
Definition: CsvUtil.qm.dox.h:1029
int index(softstring str, softstring substr, softint pos=0)
The CsvStringWriter class for in-memory string CSV creation.
Definition: CsvUtil.qm.dox.h:1527
The AbstractCsvWriter class provides a parent for all CSV writers.
Definition: CsvUtil.qm.dox.h:1220
string baseTemplate
base template for value format
Definition: CsvUtil.qm.dox.h:1272
const EOL_MACINTOSH
Old (pre-OSX) Macintosh end of line character sequence.
Definition: CsvUtil.qm.dox.h:392
const CSV_TYPE_UNKNOWN
Record type when non matching any type.
Definition: CsvUtil.qm.dox.h:398
const EOL_UNIX
Unix end of line character sequence (for new OS X too)
Definition: CsvUtil.qm.dox.h:388
StreamWriter output
the output stream for the CSV data
Definition: CsvUtil.qm.dox.h:1437
The CsvWriter class for safe CSV data creation.
Definition: CsvUtil.qm.dox.h:1432
The CsvIterator class allows CSV sources to be iterated on a record basis. The source of the input da...
Definition: CsvUtil.qm.dox.h:974
const EOL_WIN
MS DOS/Windows end of line character sequence.
Definition: CsvUtil.qm.dox.h:390
The CsvDataIterator class allows arbitrary CSV string data to be iterated on a record basis...
Definition: CsvUtil.qm.dox.h:1084
string m_file_path
the path of the file being iterated
Definition: CsvUtil.qm.dox.h:1034
string encoding
output file character encoding
Definition: CsvUtil.qm.dox.h:1248
the CsvUtil namespace contains all the objects in the CsvUtil module
Definition: CsvUtil.qm.dox.h:386
The CsvFileWriter class for safe CSV file creation.
Definition: CsvUtil.qm.dox.h:1475
const CSV_TYPE_SINGLE
Record type when multi-type is disabled.
Definition: CsvUtil.qm.dox.h:400