Index: trunk/SophyaExt/FitsIOServer/fitsblkrw.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsblkrw.h	(revision 2843)
+++ trunk/SophyaExt/FitsIOServer/fitsblkrw.h	(revision 2846)
@@ -9,5 +9,5 @@
   \ingroup FitsIOServer
   \brief Template class with static methods for handling bloc data 
-  read from / write to fits files
+  read from / write to fits filesz
 */
 
@@ -114,31 +114,43 @@
 };
 
+DECL_TEMP_SPEC  /* equivalent a template <> , pour SGI-CC en particulier */
+class FitsBlockRW<std::string> {
+public:
+//! Write image HDU with string data type not supported (throws exception) 
+static void WriteImageData(FitsInOutFile& fios, const std::string * d, size_t sz, 
+			   long * fpixel=NULL)
+{
+  throw FitsIOException(
+    "FitsBlockRW<string>::WriteImageData() string data type Unsupported for image HDU");
+}
+//! Read image HDU with string data type not supported (throws exception) 
+static void ReadImageData(FitsInOutFile& fios,  std::string * d, size_t sz, 
+			  long * fpixel=NULL)
+{
+  throw FitsIOException(
+    "FitsBlockRW<string>::ReadImageData() string data type Unsupported for image HDU");
+}
 
-/*! 
-  Write character string data to binary/ascii HDU data in a fits file. 
-  See cfitsio function fits_write_col() for more detail.
-  \param colnum : table column number (starting from 1)
-  \param firstrow : the write operation starting row (starting from 1)
-  \param firstelem : the firstelem (for vector type columns)
-  \param d : pointer to string type array to be written
-  \param sz : number of data elements to be written
-  \param width : column width
-*/
-void WriteStringColumnData(FitsInOutFile& fios, int colnum, long firstrow,
-			   long firstelem, const string * d, size_t sz, 
-			   long width=0)
+//! Write character string data to binary/ascii HDU data in a fits file. 
+static void WriteColumnData(FitsInOutFile& fios, int colnum, long firstrow,
+			    long firstelem, const std::string * d, size_t sz)
 {
   int status = 0;
-  if (width < 1) width = 16;
+  char sbuff[1024];
+  char * cp[4] = {sbuff, sbuff+256, sbuff+512, sbuff+768};
+  //cout << " --- Getting in WriteColumnData<string>() colnum=" << colnum << endl;
   for(size_t kk=0; kk<sz; kk++) {
-    char * cp = const_cast<char *>(d[kk].c_str());
+    strncpy(sbuff, d[kk].c_str(), 1023);
+    //    char * cp = const_cast<char *>(d[kk].c_str());
+    sbuff[1023] = '\0';
     status = 0;
-    fits_write_col(fios.FitsPtr(), FitsTypes::DataType(cp), colnum,
-		   firstrow+kk, firstelem, 1, &cp, &status);
+    //cout <<"DBG-Write2Fits : appel a fits_write_col() kk=" << kk << " / sz=" << sz << endl;
+    fits_write_col(fios.FitsPtr(), FitsTypes::DataType(sbuff), colnum,
+		   firstrow+kk, firstelem, 1, cp, &status);
     if ( status ) {
       fits_report_error(stderr, status);
       char buff[32];
       fits_get_errstatus(status, buff);
-      string msg = "WriteStringColumnData Error: " ;
+      string msg = "FitsBlockRW<std::string>::WriteColumnData() Error: " ;
       msg += buff;
       sprintf(buff," kk=%ld",kk);  msg += buff;
@@ -149,29 +161,24 @@
 }
 
-/*! 
-  Read character string data to binary/ascii HDU data in a fits file. 
-  See cfitsio function fits_read_col() for more detail.
-  \param colnum : table column number (starting from 1)
-  \param firstrow : the read operation starting point (row) (starting from 1)
-  \param firstelem : the firstelem (for vector type columns)
-  \param d : pointer to string type array to be read
-  \param sz : number of data elements to be read
-  \param width : column width
-*/
-void ReadStringColumnData(FitsInOutFile& fios, int colnum, long firstrow,
-			  long firstelem, string * d, size_t sz, long width)
+
+//! Read character string data to binary/ascii HDU data in a fits file. 
+static void ReadColumnData(FitsInOutFile& fios, int colnum, long firstrow,
+			   long firstelem, std::string * d, size_t sz)
 {
   int status = 0;
   int anynul = 0;
-  char buff[1024];
+  char sbuff[1024];
+  char * cp[4] = {sbuff, sbuff+256, sbuff+512, sbuff+768};
+  //  cout << " --- Getting in ReadColumnData<string>() colnum=" << colnum << endl;
   for(size_t kk=0; kk<sz; kk++) {
-    fits_read_col(fios.FitsPtr(), FitsTypes::DataType(buff), colnum,
-		 firstrow, firstelem+kk, 1, NULL, &buff, &anynul, &status);
-    d[kk] = buff;
+    //    cout <<"DBG-ReadFrFits : appel a fits_read_col() kk=" << kk << " / sz=" << sz << endl;
+    fits_read_col(fios.FitsPtr(), FitsTypes::DataType(sbuff), colnum,
+		 firstrow+kk, firstelem, 1, NULL, cp, &anynul, &status);
+    sbuff[1023] = '\0'; d[kk] = sbuff;
     if ( status ) {
       fits_report_error(stderr, status);
       char buff[32];
       fits_get_errstatus(status, buff);
-      string msg = "ReadStringColumnData Error: " ;
+      string msg = "FitsBlockRW<std::string>::ReadColumnData() Error: " ;
       msg += buff;
       sprintf(buff," kk=%ld",kk);  msg += buff;
@@ -182,4 +189,6 @@
 }
 
+};  // Fin classe   FitsBlockRW<std::string>
+
 } // Fin du namespace
 
