From: Rejean Loyer Date: Thu, 19 Jun 2014 15:27:37 +0000 (-0400) Subject: eda/Row: add Row::PrintLnCSV method. X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=b8a25d14a055ebaad72394f88a1647ab1c0bf293 eda/Row: add Row::PrintLnCSV method. --- diff --git a/eda/libeda/src/EDA.ec b/eda/libeda/src/EDA.ec index 591afe8..aa626bd 100644 --- a/eda/libeda/src/EDA.ec +++ b/eda/libeda/src/EDA.ec @@ -14,6 +14,15 @@ public import "ecere" #define _DEBUG_LINE #endif +default: +__attribute__((unused)) static void UnusedFunction() +{ + int a; + a.OnGetString(0,0,0); +} +extern int __ecereVMethodID_class_OnGetString; +private: + public enum OpenType { queryRows, tableRows, viewRows, processesList, databasesList, tablesList, fieldsList }; public enum CreateOptions { no, create, readOnly }; public enum AccessOptions { integral, random }; @@ -587,6 +596,23 @@ public: } property uint sysID { get { return row ? row.GetSysID() : 0; } set { if(row) row.GoToSysID(value); } } + + void PrintLnCSV() + { + if(!nil) + { + char buffer[4096]; + for(e : tbl.fields) + { + int64 data = 0; + char * result = null; + GetData(e, &data); + result = ((char *(*)(void *, void *, char *, void *, bool *))(void *)e._class._vTbl[__ecereVMethodID_class_OnGetString])(e._class, &data, buffer, null, null); + printf("%s%s", (e == tbl.fields.firstIterator.data) ? "" : ",", result ? buffer : ""); + } + printf("\n"); + } + } }; public class DriverRow