322 const FieldAttrs = (
"type",
"format",
"timezone",
"code",
"header");
337 bool headerReorder =
True;
342 constructor (
string n_errname);
355 checkType(
string fld_errs,
string key,
string value);
362 hash getSpec(*
hash fields,
string fld_errs,
int C_OPTx);
659 "compat_force_empty_string": C_OPT1|C_OPT2,
660 "date_format": C_OPT1|C_OPT2,
661 "date-format": C_OPT1|C_OPT2,
662 "encoding": C_OPT1|C_OPT2,
663 "eol": C_OPT1|C_OPT2,
664 "extended_record": C_OPT2,
666 "header-lines": C_OPT1|C_OPT2,
667 "header_lines": C_OPT1|C_OPT2,
668 "header-names": C_OPT1|C_OPT2,
669 "header_names": C_OPT1|C_OPT2,
670 "header_reorder": C_OPT1|C_OPT2,
672 "ignore-empty": C_OPT1|C_OPT2,
673 "ignore_empty": C_OPT1|C_OPT2,
674 "ignore-whitespace": C_OPT1|C_OPT2,
675 "ignore_whitespace": C_OPT1|C_OPT2,
676 "quote": C_OPT1|C_OPT2,
677 "separator": C_OPT1|C_OPT2,
678 "timezone": C_OPT1|C_OPT2,
679 "tolwr": C_OPT1|C_OPT2,
680 "verify-columns": C_OPT1|C_OPT2,
681 "verify_columns": C_OPT1|C_OPT2,
685 string separator =
",";
691 softint headerLines = 0;
694 bool headerNames =
False;
697 bool ignoreEmptyLines =
True;
700 bool ignoreWhitespace =
True;
706 bool checkElementCounts =
False;
709 bool extendedRecord =
False;
712 bool compat_force_empty_string =
False;
721 hash m_resolve_by_rule;
724 hash m_resolve_by_count;
727 hash m_resolve_by_idx;
730 bool fakeHeaderNames;
733 AbstractLineIterator lineIterator;
744 constructor(AbstractLineIterator li, *
hash opts);
754 constructor(AbstractLineIterator li,
hash spec,
hash opts);
760 processCommonOptions(*
hash opts,
int C_OPTx);
767 processSpec(
hash spec);
774 prepareFieldsFromHeaders(*
list headers);
798 auto memberGate(
string name);
830 hash getRecord(
bool extended);
861 auto getRecordList();
872 string getSeparator();
940 auto handleType(
hash fh, *
string val);
947 list getLineAndSplit();
959 string identifyType(
list rec);
972 *
string identifyTypeImpl(
list rec);
1033 auto memberGate(
string name);
1060 constructor(
string path, *
hash opts) ;
1068 constructor(
string path,
hash spec,
hash opts) ;
1072 auto memberGate(
string name);
1076 string getEncoding();
1080 string getFileName();
1084 hash<Qore::StatInfo>
hstat();
1110 constructor(
string data, *
hash opts) ;
1118 constructor(
string data,
hash spec,
hash opts) ;
1121 auto memberGate(
string name);
1242 "block": C_OPT1|C_OPT2,
1244 "date_format": C_OPT1|C_OPT2,
1245 "date-format": C_OPT1|C_OPT2,
1246 "encoding": C_OPT1|C_OPT2,
1247 "eol": C_OPT1|C_OPT2,
1250 "header_reorder": C_OPT1,
1251 "info_log": C_OPT1|C_OPT2,
1252 "optimal_quotes": C_OPT1|C_OPT2,
1253 "optimal-quotes": C_OPT1|C_OPT2,
1254 "quote": C_OPT1|C_OPT2,
1255 "quote_escape": C_OPT1|C_OPT2,
1256 "separator": C_OPT1|C_OPT2,
1257 "verify_columns": C_OPT1|C_OPT2,
1258 "verify-columns": C_OPT1|C_OPT2,
1259 "write_headers": C_OPT1|C_OPT2,
1260 "write-headers": C_OPT1|C_OPT2,
1267 string separator =
",";
1270 string quote =
"\"";
1273 string m_quoteEscapeChar =
"\\";
1314 constructor(
string n_errname, *
hash n_opts);
1326 constructor(
string n_errname,
hash spec,
hash n_opts);
1332 processCommonOptions(*
hash n_opts,
int C_OPTx);
1356 writeLine(
list values);
1365 writeLine(
hash values);
1375 writeLine(
string type,
list values);
1385 writeLine(
string type,
hash values);
1424 abstract writeRawLine(
list values);
1435 string prepareRawLine(
list values);
1441 string prepareRawLineIntern(
list values);
1481 writeRawLine(
list values);
1509 constructor(
string path, *
hash opts) ;
1522 constructor(
string path,
hash spec,
hash opts) ;
1527 openFile(
string path);
1533 writeRawLine(
list values);
1558 constructor(*
hash opts) ;
1568 constructor(
hash spec,
hash opts) ;
1579 writeRawLine(
list values);
1606 string write(
list l);
1610 string getContent();
hash m_out_by_name
mapping output field by name
Definition: CsvUtil.qm.dox.h:1300
the AbstractCsvIterator class is an abstract base class that allows abstract CSV data to be iterated ...
Definition: CsvUtil.qm.dox.h:653
Qore::File file
the file to write
Definition: CsvUtil.qm.dox.h:1496
hash m_out_by_idx
mapping output field by index
Definition: CsvUtil.qm.dox.h:1303
*code info_log
a closure/call reference for informational logging when using write(SQLStatement) ...
Definition: CsvUtil.qm.dox.h:1297
*hash< StatInfo > hstat(string path)
The CsvFileIterator class allows CSV files to be iterated on a record basis.
Definition: CsvUtil.qm.dox.h:1045
int index(softstring str, softstring substr, softint pos=0)
The CsvStringWriter class for in-memory string CSV creation.
Definition: CsvUtil.qm.dox.h:1543
csvutil_set_global_compat_force_empty_string(softbool val)
sets the global_compat_force_empty_string variable to force "*string" fields with no value to ret...
The AbstractCsvWriter class provides a parent for all CSV writers.
Definition: CsvUtil.qm.dox.h:1236
string baseTemplate
base template for value format
Definition: CsvUtil.qm.dox.h:1288
const EOL_MACINTOSH
Old (pre-OSX) Macintosh end of line character sequence.
Definition: CsvUtil.qm.dox.h:397
const CSV_TYPE_UNKNOWN
Record type when non matching any type.
Definition: CsvUtil.qm.dox.h:403
const EOL_UNIX
Unix end of line character sequence (for new OS X too)
Definition: CsvUtil.qm.dox.h:393
StreamWriter output
the output stream for the CSV data
Definition: CsvUtil.qm.dox.h:1453
The CsvWriter class for safe CSV data creation.
Definition: CsvUtil.qm.dox.h:1448
The CsvIterator class allows CSV sources to be iterated on a record basis. The source of the input da...
Definition: CsvUtil.qm.dox.h:990
const EOL_WIN
MS DOS/Windows end of line character sequence.
Definition: CsvUtil.qm.dox.h:395
The CsvDataIterator class allows arbitrary CSV string data to be iterated on a record basis...
Definition: CsvUtil.qm.dox.h:1100
string m_file_path
the path of the file being iterated
Definition: CsvUtil.qm.dox.h:1050
string encoding
output file character encoding
Definition: CsvUtil.qm.dox.h:1264
the CsvUtil namespace contains all the objects in the CsvUtil module
Definition: CsvUtil.qm.dox.h:391
bool global_compat_force_empty_string
global option to force "*string" fields with no value to return an empty string when parsing rath...
The CsvFileWriter class for safe CSV file creation.
Definition: CsvUtil.qm.dox.h:1491
const CSV_TYPE_SINGLE
Record type when multi-type is disabled.
Definition: CsvUtil.qm.dox.h:405