eda/Row: add Row::PrintLnCSV method.
authorRejean Loyer <redj@ecere.com>
Thu, 19 Jun 2014 15:27:37 +0000 (11:27 -0400)
committerRejean Loyer <redj@ecere.com>
Mon, 16 Mar 2015 05:31:43 +0000 (01:31 -0400)
eda/libeda/src/EDA.ec

index 591afe8..aa626bd 100644 (file)
@@ -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