Index: trunk/SophyaProg/Tests/tnt.cc
===================================================================
--- trunk/SophyaProg/Tests/tnt.cc	(revision 2831)
+++ trunk/SophyaProg/Tests/tnt.cc	(revision 2832)
@@ -3,4 +3,5 @@
 #include <math.h>
 #include <iostream>
+#include <fstream>
 
 #include "sopnamsp.h"
@@ -31,5 +32,5 @@
     exit(0);
   }
-
+  int rc = 0;
   try {
     if (*arg[1] == 'd')  test_dvl();
@@ -42,11 +43,15 @@
   catch(PThrowable exc ) {
     cerr << "tnt-main() , Catched exception: \n" << exc.Msg() << endl;
+    rc = 97;
   }
   catch(std::exception ex) {
     cerr << "tnt-main() , Catched exception ! " << (string)(ex.what()) << endl;
+    rc = 98;
   }
   catch(...) {
     cerr << "tnt-main() , Catched ... ! " << endl;
-  }
+    rc = 99;
+  }
+  return rc;
 }
 
@@ -119,5 +124,8 @@
      << " ->double= " << (double)tv << " ->TimeStamp:" 
      << TimeStamp((double)tv).ToString() << endl;
-
+tv = "1995-09-23T15:20:32";
+string tts = (string)tv;
+cout << "MuTyV=TimeStamp tv=" << tv << " ->TimeStamp(tv)=" 
+     << TimeStamp(tts) << endl;
 
 cout << "\n\n ======= test_dvl:  Testing DVList ======= " << endl;
@@ -192,5 +200,9 @@
   dt.AddComplexColumn("cmplx_cos_sin");
   dt.AddDoubleComplexColumn("dcmplx_cos_sin");
+  dt.AddDateTimeColumn("datime");
   MuTyV rec[10];
+  TimeStamp ts("01/3/2005","0:0:0"); 
+  TimeStamp ts2(0.);
+  
   cout << " 1/ First 1000 lines .... " << endl;
   for(int k = 0; k<1000; k++) {
@@ -210,4 +222,6 @@
     rec[7] = complex<r_4>(cx, sx);
     rec[8] = complex<r_8>(cx, sx);
+    ts2.Set(ts.ToDays()+(double)k/24.);
+    rec[9] = ts2;
     dt.AddLine(rec);
   }
@@ -234,4 +248,6 @@
     rec[7] = complex<r_4>(cx, sx);
     rec[8] = complex<r_8>(cx, sx);
+    ts2.Set(ts.ToDays()+(double)k/24.);
+    rec[9] = ts2;
     dt.AddLine(rec);
   }
@@ -241,5 +257,5 @@
   dtc1.Show();  
   cout << "2.d/  dt.LineHeaderToString() dt.LineToString(k)   : " << endl;
-  cout << dt.LineHeaderToString() ;
+  cout << dt.LineHeaderToString() << endl;
   for(int k = 0; k<1500; k+=75) 
     cout << "Line[" << k << "] " << dt.LineToString(k) << endl ; 
@@ -257,6 +273,27 @@
     cout << dtr;
     cout << "4.c/  dtr.LineHeaderToString() dtr.LineToString(k)   : " << endl;
-    cout << dtr.LineHeaderToString() ;
+    cout << dtr.LineHeaderToString() << endl;
     for(int k = 0; k<1500; k+=75) 
+      cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ; 
+    
+  }
+  {
+    cout << "5/ Reading DataTable dtr from text file dtable.txt " << endl;
+    {
+      cout << "5.a Writing lines to file dtable.txt " << endl; 
+      ofstream os("dtable.txt");
+      dt.Print(os,0,450);
+    }
+    cout << "5.b CopyStructure + FillFromASCIIFile from dtable.txt " << endl; 
+    ifstream is("dtable.txt");
+    DataTable dtr;
+    dtr.CopyStructure(dt);
+    dtr.FillFromASCIIFile(is);
+    cout << dtr;
+    cout << "5.c/  dtr.LineHeaderToString() dtr.LineToString(k)   : " << endl;
+    cout << dtr.LineHeaderToString() << endl;
+    for(int k = 0; k<10; k++) 
+      cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ; 
+    for(int k = 50; k<300; k+=25) 
       cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ; 
     
@@ -273,4 +310,5 @@
     SwPPFDataTable dt(po, 64);
     dt.AddIntegerColumn("line");
+    dt.AddStringColumn("sline");
     dt.AddDoubleColumn("x");
     dt.AddFloatColumn("f_sin");
@@ -280,19 +318,27 @@
     dt.AddComplexColumn("cmplx_cos_sin");
     dt.AddDoubleComplexColumn("dcmplx_cos_sin");
+    dt.AddDateTimeColumn("datime");
     MuTyV rec[10];
+    TimeStamp ts("01/3/2005","0:0:0"); 
+    TimeStamp ts2(0.);
     cout << " 1/ First 1000 lines .... " << endl;
     for(int k = 0; k<1000; k++) {
       rec[0] = k;
+      string sline = "L-";
+      sline += (string)rec[0];
+      rec[1] = sline;
       double x = M_PI*k/100.;
       double fx = sin(x)*cos(x);
       double sx = sin(x);
       double cx = cos(x);
-      rec[1] = x;
-      rec[2] = sx;
-      rec[3] = cx;
-      rec[4] = fx;
-      rec[5] = x*x;
-      rec[6] = complex<r_4>(cx, sx);
-      rec[7] = complex<r_8>(cx, sx);
+      rec[2] = x;
+      rec[3] = sx;
+      rec[4] = cx;
+      rec[5] = fx;
+      rec[6] = x*x;
+      rec[7] = complex<r_4>(cx, sx);
+      rec[8] = complex<r_8>(cx, sx);
+      ts2.Set(ts.ToDays()+(double)k/24.);
+      rec[9] = ts2;
       dt.AddLine(rec);
     }
@@ -304,11 +350,20 @@
     for(int k = 1000; k<2000; k++) {
       rec[0] = k;
+      string sline = "L-";
+      sline += (string)rec[0];
+      rec[1] = sline;
       double x = M_PI*k/100.;
       double fx = sin(x)*cos(x);
-      rec[1] = x;
-      rec[2] = sin(x);
-      rec[3] = cos(x);
-      rec[4] = fx;
-      rec[5] = x*x;
+      double sx = sin(x);
+      double cx = cos(x);
+      rec[2] = x;
+      rec[3] = sx;
+      rec[4] = cx;
+      rec[5] = fx;
+      rec[6] = x*x;
+      rec[7] = complex<r_4>(cx, sx);
+      rec[8] = complex<r_8>(cx, sx);
+      ts2.Set(ts.ToDays()+(double)k/24.);
+      rec[9] = ts2;
       dt.AddLine(rec);
     }
@@ -328,5 +383,5 @@
     cout << dtr;
     cout << "4.c/  dtr.LineHeaderToString() dtr.LineToString(k)   : " << endl;
-    cout << dtr.LineHeaderToString() ;
+    cout << dtr.LineHeaderToString() << endl;
     for(int k = 0; k<1500; k+=75) 
       cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ;     
Index: trunk/SophyaProg/Tests/ttimestamp.cc
===================================================================
--- trunk/SophyaProg/Tests/ttimestamp.cc	(revision 2831)
+++ trunk/SophyaProg/Tests/ttimestamp.cc	(revision 2832)
@@ -6,4 +6,5 @@
 #include <iostream>
 #include <string>
+#include <vector>
 
 #include <typeinfo>
@@ -12,4 +13,5 @@
 #include "histinit.h"
 #include "pexceptions.h"
+#include "ppfwrapstlv.h" 
 
 /*  Programme test de la classe TimeStamp             */
@@ -32,6 +34,6 @@
     cout << "ts2: 26/8/1974 14:22:35.65 : " << ts2  
 	 << " double->TimeStamp: " << TimeStamp(ts2.ToDays()) << endl; 
-    TimeStamp ts3("01/01/1905","00:00:00"); 
-    cout << "ts3: 01/01/1905 , 00:00:00 : " << ts3 << " (double): " 
+    TimeStamp ts3("08/05/1905","00:00:00"); 
+    cout << "ts3: 8/05/1905 , 00:00:00 : " << ts3 << " (double): " 
 	 << (double)ts3 << " double->TimeStamp: " << TimeStamp(ts3.ToDays()) << endl; 
     TimeStamp ts4("01/01/1901","03:00:20"); 
@@ -45,9 +47,79 @@
     cout << "ts6: 01/12/1899 , 15:30:00 : " << ts6 << " (double): " 
 	 << (double)ts6 << " double->TimeStamp: " << TimeStamp(ts6.ToDays()) << endl; 
+
     cout << " ts.ToString(bool, bool) test : " << endl;
     cout << " ts.ToString()= " << ts.ToString() << endl;
-    cout << " ts.ToString(fgd=true, fgh=false)= " << ts.ToString(true, false) << endl;
-    cout << " ts.ToString(fgd=false, fgh=true)= " << ts.ToString(false, true) << endl;
+    cout << " ts.ToString(FmtDateOnly)= " << ts.ToString(TimeStamp::FmtDateOnly) << endl;
+    cout << " ts.ToString(FmtTimeOnly)= " << ts.ToString(TimeStamp::FmtTimeOnly) << endl;
+    cout << " ts.ToString(FmtDateTime)= " << ts.ToString(TimeStamp::FmtDateTime) << endl;
 
+    TimeStamp ts12("1974-08-26T14:22:35.65"); 
+    cout << "ts12: 1974-08-26T14:22:35.65 : " << ts12  
+	 << " double->TimeStamp: " << TimeStamp(ts12.ToDays()) << endl; 
+    TimeStamp ts13("1905-05-08T00:00:00"); 
+    cout << "ts13: 1905-05-08T00:00:00  " << ts13 << " (double): " 
+	 << (double)ts13 << " double->TimeStamp: " << TimeStamp(ts13.ToDays()) << endl; 
+
+    double diff;
+    diff = ts12.ToDays()-ts2.ToDays();
+    if (fabs(diff) > 1.e-6) {
+      cout << "ttimestamp/Erreur Diff t12-t2 : Rc+=1 " << endl;
+      rc += 1;
+    }
+    diff = ts13.ToDays()-ts3.ToDays();
+    if (fabs(diff) > 1.e-6) {
+      cout << "ttimestamp/Erreur Diff t13-t3 : Rc+=2 " << endl;
+      rc += 2;
+    }
+    TimeStamp tsa("1901-1-1T14:0:0"); 
+    diff = tsa.ToDays()-38./24.;
+    if (fabs(diff) > 1.e-6) {
+      cout << "ttimestamp/Erreur Diff tsa-38/24. : Rc+=4 " << endl;
+      rc += 4;
+    }
+    tsa.Set("1901-02-07T18:00:00");
+    diff = tsa.ToDays()-38.75;
+    if (fabs(diff) > 1.e-6) {
+      cout << "ttimestamp/Erreur Diff tsa-38.75 : Rc+=8 " << endl;
+      rc += 8;
+    }
+    tsa.Set("2004-08-24T18:00:00");
+    TimeStamp tsb("2004-09-03T21:00:00");
+    diff = tsb.ToDays()-tsa.ToDays();
+    if (fabs(diff-10.125) > 1.e-6) {
+      cout << "ttimestamp/Erreur Diff tsb-tsa : Rc+=16 " << endl;
+      rc += 16;
+    }
+    if (rc == 0)
+      cout << "ttimestamp/Info CheckDiffs OK (Rc=" << rc << ")" << endl;
+    else 
+      cout << "ttimestamp/Erreur Pb Diffs  (Rc=" << rc << ")" << endl;
+
+    cout << "ttimestamp/Info: Test PPF , vector<TimeStamp> " << endl;
+    vector<TimeStamp> vts, vtsr;
+    vts.push_back(ts);
+    vts.push_back(ts2);
+    vts.push_back(ts3);
+    {
+      POutPersist so("tts.ppf");
+      so << vts;
+    }
+    cout << "ttimestamp/Info: Reading from tts.ppf " << endl;
+    PInPersist si("tts.ppf");
+    
+    si >> vtsr;
+    for(int kk=0; kk<vtsr.size(); kk++) {
+      cout << " vtsr[" << kk << "] : " << vtsr[kk] << endl;
+      diff = vtsr[kk].ToDays()-vts[kk].ToDays();
+      if (fabs(diff) > 1.e-6) {
+	cout << "ttimestamp/Erreur Diff   vtsr[kk]-vts[kk] : Rc+=32 " << endl;
+	rc += 32;
+      }
+    }
+    if (rc >= 32) 
+      cout << "ttimestamp/Info Pb Diffs vector<TimeStamp>/PPF (Rc=" 
+	   << rc << ")" << endl;
+    else 
+      cout << "ttimestamp/Erreur  Diffs vector<TimeStamp>/PPF OK" << endl; 
   }
   catch (PThrowable & exc) {
