Index: trunk/SophyaLib/BaseTools/dvlist.cc
===================================================================
--- trunk/SophyaLib/BaseTools/dvlist.cc	(revision 913)
+++ trunk/SophyaLib/BaseTools/dvlist.cc	(revision 1080)
@@ -38,15 +38,7 @@
 //--
 
-char MuTyV::myStrBuf[64];   // Declare static ds le .h 
 
 static MuTyV ddvdum(-9.e19);
 
-/*!
-   \class SOPHYA::MuTyV
-   \ingroup SysTools
-   Simple utility class which can be used to hold values of type
-   string, integer (\b int_8) or float (\b r_8) and providing
-   easy conversion methods between these types. 
-*/
 
 /*!
@@ -61,15 +53,5 @@
    used to represent FITS headers. The class \b SOPHYA::ObjFileIO<DVList>
    handles serialisation for DVList. (See SOPHYA::PPersist ).
-   An 
-   \code
-   //  ------- Using MuTyV objects ------- 
-   MuTyV mvu;         // MuTyV variable declaration 
-   mvu = 60;          // mvu contains the integer value 60
-   mvu = 66.6;        // and now the double value 66.6 
-   string ds = mvu;   // ds contains the string "66.6"
-   MuTyV mvi(14);     // New MuTyV variable containing integer value 14
-   r_4 x = mvi;       // x has the value 14.0
-   MuTyV mvs("Bonjour !");  // mvs contains the string "Bonjour !"
-   string s = mvs;          // s vaut "Bonjour, Ca va ?"  
+   
    //  ------- Using DVList objects ------ 
    DVList  dvl;
@@ -179,11 +161,14 @@
     {
     case 'I' :
-      SetI((*it).first, (*it).second.elval.mtv.iv);
+      SetI((*it).first, (*it).second.elval.iv);
       break;
     case 'D' : 
-      SetD((*it).first, (*it).second.elval.mtv.dv);
+      SetD((*it).first, (*it).second.elval.dv);
+      break;
+    case 'Z' : 
+      SetZ((*it).first, complex<r_8>((*it).second.elval.dv, (*it).second.elval.dv_im));
       break;
     case 'S' : 
-      SetS((*it).first, (*it).second.elval.mtv.strv);
+      SetS((*it).first, *((*it).second.elval.strv));
       break;
     default :
@@ -214,6 +199,5 @@
 ValList::iterator it = mvlist.find(key);
 if (it == mvlist.end())  return(def);
-if ( (*it).second.elval.typ != 'I') return(def);
-return((*it).second.elval.mtv.iv);
+return((*it).second.elval.iv);
 }
 
@@ -225,6 +209,15 @@
 ValList::iterator it = mvlist.find(key);
 if (it == mvlist.end())  return(def);
-if ( (*it).second.elval.typ != 'D') return(def);
-return((*it).second.elval.mtv.dv);
+return((*it).second.elval.dv);
+}
+
+/* --Methode-- */
+/*! Returns the value corresponding to name \b key, converted to complex
+    Default value \b def is returned if name \b key not found */
+complex<r_8>       DVList::GetZ(string const& key, complex<r_8> def)
+{
+ValList::iterator it = mvlist.find(key);
+if (it == mvlist.end())  return(def);
+return((*it).second.elval.dv);
 }
 
@@ -236,6 +229,5 @@
 ValList::iterator it = mvlist.find(key);
 if (it == mvlist.end())  return(def);
-if ( (*it).second.elval.typ != 'S') return(def);
-return((*it).second.elval.mtv.strv);
+return(*((*it).second.elval.strv));
 }
 
@@ -252,7 +244,8 @@
 // void  SetI(string const& key, int_8  val)
 // void  SetD(string const& key, r_8 val)
+// void  SetZ(string const& key, complex<r_8> val)
 // void  SetS(string const& key, char*  val)
 // void  SetS(string const& key, string val)
-//	Crée la variable de nom "key", de type entier, double, string et 
+//	Crée la variable de nom "key", de type entier, double, complexe, string et 
 //	lui attribue la valeur "val". Si une variable du même nom existe, 
 //	sa valeur et eventuellement son type sont modifiés.  Les noms de
@@ -280,4 +273,11 @@
 
 /* --Methode-- */
+void        DVList::SetZ(string const& key, complex<r_8> val)
+/*! Appends or sets the complex value \b val in the list with name \b key */
+{
+Get(key) = val;
+}
+
+/* --Methode-- */
 /*! Appends or sets the string value \b val in the list with name \b key */
 void        DVList::SetS(string const& key, char const* val)
@@ -289,5 +289,5 @@
 /* --Methode-- */
 /*! Appends or sets the string value \b val in the list with name \b key */
-void        DVList::SetS(string const& key, string val)
+void        DVList::SetS(string const& key, string const& val)
 {
 MuTyV div(val);
@@ -367,13 +367,17 @@
     case 'I' :
       sprintf(buff, "%s = %ld (int) %s\n", (*it).first.substr(0,64).c_str(), 
-	      (long)((*it).second.elval.mtv.iv), (*it).second.elcomm.substr(0,128).c_str());
+	      (long)((*it).second.elval.iv), (*it).second.elcomm.substr(0,128).c_str());
       break;
     case 'D' : 
       sprintf(buff, "%s = %.20g (double) %s\n", (*it).first.substr(0,64).c_str(), 
-	      (*it).second.elval.mtv.dv, (*it).second.elcomm.substr(0,128).c_str());
+	      (*it).second.elval.dv, (*it).second.elcomm.substr(0,128).c_str());
+      break;
+    case 'Z' : 
+      sprintf(buff, "%s = %.20g %.20g i (complex) %s\n", (*it).first.substr(0,64).c_str(), 
+	      (*it).second.elval.dv, (*it).second.elval.dv_im, (*it).second.elcomm.substr(0,128).c_str());
       break;
     case 'S' : 
       sprintf(buff, "%s = %s (string) %s\n", (*it).first.substr(0,64).c_str(), 
-	      (*it).second.elval.mtv.strv, (*it).second.elcomm.substr(0,128).c_str());
+	      (*it).second.elval.strv->c_str(), (*it).second.elcomm.substr(0,128).c_str());
       break;
     default :
@@ -441,13 +445,18 @@
   switch ((*it).second.elval.typ) {
     case 'I' :
-      sprintf(buf,"I %s %ld", (*it).first.substr(0,64).c_str(), (long)((*it).second.elval.mtv.iv) );
+      sprintf(buf,"I %s %ld", (*it).first.substr(0,64).c_str(), (long)((*it).second.elval.iv) );
       sfw = buf;  s.PutStr(sfw);
       break;
     case 'D' : 
-      sprintf(buf,"D %s %.20g", (*it).first.substr(0,64).c_str(), (*it).second.elval.mtv.dv );
+      sprintf(buf,"D %s %.20g", (*it).first.substr(0,64).c_str(), (*it).second.elval.dv );
       sfw = buf;  s.PutStr(sfw);
       break;
+    case 'Z' : 
+      sprintf(buf,"Z %s %.20g %.20g", (*it).first.substr(0,64).c_str(), (*it).second.elval.dv, 
+                                      (*it).second.elval.dv_im);
+      sfw = buf;  s.PutStr(sfw);
+      break;
     case 'S' : 
-      sprintf(buf,"S %s %s", (*it).first.substr(0,64).c_str(), (*it).second.elval.mtv.strv );
+      sprintf(buf,"S %s %s", (*it).first.substr(0,64).c_str(), (*it).second.elval.strv->c_str() );
       sfw = buf;  s.PutStr(sfw);
       break;
@@ -470,6 +479,7 @@
 char buf[512];
 string sfr;
-int_8 j,iv;
-r_8 dv;
+int_8 j,iv,k;
+r_8 dv, dvi;
+complex<r_8> z;
 bool ok=true;
 buf[0] = '\0';
@@ -505,4 +515,13 @@
       dobj->SetD(key, dv);
       break;
+    case 'Z' :
+      k = posc(buf+j+1, ' ')+j+1;
+      buf[k] = '\0';
+      dv = atof(buf+j+1);
+      dvi = atof(buf+k+1);
+      key = buf+2;
+      z = complex<r_8>(dv, dvi);      
+      dobj->SetZ(key, z);
+      break;
     case 'S' :
       key = buf+2;
