Index: trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.cc	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.cc	(revision 1231)
@@ -100,5 +100,5 @@
 
 
-FITS_BntblLineWriter::FITS_BntblLineWriter(char inputfile[],int dc, int fc,int ic, int cc, vector<string> names,DVList* ptr_dvl,  WriteMode wrm)
+FITS_BntblLineWriter::FITS_BntblLineWriter(char inputfile[],int dc, int fc,int ic, int cc, vector<string> names,DVList* ptr_dvl,  FitsFile::WriteMode wrm)
 {
   int k;
Index: trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.h	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.h	(revision 1231)
@@ -61,5 +61,5 @@
 
 public:
- FITS_BntblLineWriter(char inputfile[],int dc, int fc, int ic, int cc, vector<string> names, DVList* dvl=NULL, WriteMode wrm = clear);
+ FITS_BntblLineWriter(char inputfile[],int dc, int fc, int ic, int cc, vector<string> names, DVList* dvl=NULL, FitsFile::WriteMode wrm = FitsFile::clear);
 ~FITS_BntblLineWriter();
  void WriteNextLine( BnTblLine& WorkLine);
Index: trunk/SophyaExt/FitsIOServer/fitsfile.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 1231)
@@ -129,5 +129,5 @@
 
 {
-  FitsOutFile of(flnm, unknown);
+  FitsOutFile of(flnm, FitsFile::unknown);
   Write(of);
 }
@@ -208,5 +208,13 @@
 }
 
-FitsInFile::FitsInFile(char flnm[])
+FitsInFile::FitsInFile(string const & flnm)
+{
+    InitNull();
+   int status = 0;
+   fits_open_file(&fptr_,flnm.c_str(),READONLY,&status);
+   if( status ) printerror( status );
+}
+
+FitsInFile::FitsInFile(const char * flnm)
 {
     InitNull();
@@ -250,5 +258,5 @@
 }
 
-void FitsInFile::GetBlockType(char flnm[], int hdunum, string& typeOfExtension, int& naxis, vector<int>& naxisn, string& dataType, DVList& dvl )
+void FitsInFile::GetBlockType(char flnm[], int hdunum, FitsExtensionType& typeOfExtension, int& naxis, vector<int>& naxisn, FitsDataType& dataType, DVList& dvl )
 {
   int status = 0;
@@ -262,12 +270,12 @@
   if(hdutype == IMAGE_HDU) 
     {
-      typeOfExtension = "IMAGE";
+      typeOfExtension = FitsExtensionType_IMAGE;
       int bitpix;
       GetImageParameters (fileptr, bitpix, naxis, naxisn);
-      if(bitpix == DOUBLE_IMG) dataType = "double";
+      if(bitpix == DOUBLE_IMG) dataType = FitsDataType_double;
       else
-	if(bitpix == FLOAT_IMG) dataType = "float";
+	if(bitpix == FLOAT_IMG) dataType = FitsDataType_float;
 	else
-	  if(bitpix == LONG_IMG || bitpix == SHORT_IMG ) dataType = "int";
+	  if(bitpix == LONG_IMG || bitpix == SHORT_IMG ) dataType = FitsDataType_int;
 	  else 
 	    {
@@ -289,17 +297,17 @@
 	if(hdutype == ASCII_TBL)
 	  {
-	    typeOfExtension = "ASCII_TBL"; 
-	    dataType = "ASCII";
+	    typeOfExtension = FitsExtensionType_ASCII_TBL; 
+	    dataType = FitsDataType_ASCII;
 	  }
 	else
 	  {
-	    typeOfExtension = "BINARY_TBL";
-	    if(types[0] == 'D') dataType = "double";
+	    typeOfExtension = FitsExtensionType_BINARY_TBL;
+	    if(types[0] == 'D') dataType = FitsDataType_double;
 	    else
-	      if(types[0] == 'E') dataType = "float";
+	      if(types[0] == 'E') dataType = FitsDataType_float;
 	      else
-		if(types[0] == 'I' ) dataType = "int";
+		if(types[0] == 'I' ) dataType = FitsDataType_int;
 		else
-		  if(types[0] == 'S' ) dataType = "char*";
+		  if(types[0] == 'S' ) dataType = FitsDataType_char;
 		  else 
 		    {
@@ -1093,8 +1101,19 @@
 
    */
-FitsOutFile::FitsOutFile(char flnm[], WriteMode wrm)
-{
-
+
+FitsOutFile::FitsOutFile(string const & flnm, WriteMode wrm)
+{
   InitNull();
+  openoutputfitsfile(flnm.c_str(), wrm);
+}
+
+FitsOutFile::FitsOutFile(const char * flnm, WriteMode wrm)
+{
+  InitNull();
+  openoutputfitsfile(flnm, wrm);
+}
+
+void FitsOutFile::openoutputfitsfile(const char * flnm, WriteMode wrm)
+{
   int status = 0; 
 
Index: trunk/SophyaExt/FitsIOServer/fitsfile.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 1231)
@@ -20,5 +20,4 @@
   class FitsInFile;
   class FitsOutFile;
-  enum WriteMode {append, clear, unknown};
   
 
@@ -53,4 +52,19 @@
  public:
 
+   enum WriteMode {append, clear, unknown};
+
+   enum FitsExtensionType {
+     FitsExtensionType_IMAGE,
+     FitsExtensionType_ASCII_TBL,
+     FitsExtensionType_BINARY_TBL
+   };
+   enum FitsDataType {
+     FitsDataType_double,
+     FitsDataType_float,
+     FitsDataType_int,
+     FitsDataType_char,
+     FitsDataType_ASCII
+   };
+
    FitsFile() { InitNull(); };
    virtual ~FitsFile();
@@ -80,9 +94,10 @@
  public:
    FitsInFile();
-   FitsInFile(char flnm[]);
+   FitsInFile(string const & flnm);
+   FitsInFile(const char * flnm);
    ~FitsInFile() { ; };
 
    static int  NbBlocks(char flnm[]);
-   static void GetBlockType(char flnm[], int hdunum, string& typeOfExtension, int& naxis, vector<int>& naxisn, string& dataType, DVList& dvl  );
+   static void GetBlockType(char flnm[], int hdunum, FitsExtensionType& typeOfExtension, int& naxis, vector<int>& naxisn, FitsDataType& dataType, DVList& dvl  );
    void        ReadFInit(int hdunum);
  
@@ -192,7 +207,7 @@
  public:
 
-
    FitsOutFile();
-   FitsOutFile(char flnm[], WriteMode wrm = unknown );
+   FitsOutFile(string const & flnm, WriteMode wrm = unknown );
+   FitsOutFile(const char * flnm, WriteMode wrm = unknown );
    ~FitsOutFile() { ;};
    inline void InitNull() {imageOnPrimary_=false;}
@@ -242,4 +257,5 @@
   private :
 
+  void openoutputfitsfile(const char * flnm, WriteMode wrm);
   void writeSignatureOnFits() const; 
   void addKeywordsOfDVList(DVList& dvl) const;
Index: trunk/SophyaExt/FitsIOServer/fitsntuple.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsntuple.h	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitsntuple.h	(revision 1231)
@@ -66,4 +66,10 @@
 //////////////////////////////////////////////////////////////////
 
+inline FitsOutFile& operator << (FitsOutFile& fios, NTuple & nt)
+  { FITS_NTuple fih(&nt); fih.Write(fios); return (fios); }
+
+inline FitsInFile& operator >> (FitsInFile& fiis, NTuple & nt)
+  { FITS_NTuple fih(&nt); fih.Read(fiis); return (fiis); }
+
 
 } // Fin du namespace
Index: trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h	(revision 1231)
@@ -47,4 +47,12 @@
 //////////////////////////////////////////////////////////////////
 
+template <class T>
+inline FitsOutFile& operator << (FitsOutFile& fios, SphereHEALPix<T> & sph)
+  { FITS_SphereHEALPix<T> fih(&sph); fih.Write(fios); return (fios); }
+
+template <class T>
+inline FitsInFile& operator >> (FitsInFile& fiis, SphereHEALPix<T> & arr)
+  { FITS_SphereHEALPix<T> fih(&sph); fih.Read(fiis); return (fiis); }
+
 
 } // Fin du namespace
Index: trunk/SophyaExt/FitsIOServer/fitstarray.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitstarray.h	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitstarray.h	(revision 1231)
@@ -43,4 +43,11 @@
 //////////////////////////////////////////////////////////////////
 
+template <class T>
+inline FitsOutFile& operator << (FitsOutFile& fios, TArray<T> & arr)
+  { FITS_TArray<T> fih(&arr); fih.Write(fios); return (fios); }
+
+template <class T>
+inline FitsInFile& operator >> (FitsInFile& fiis, TArray<T> & arr)
+  { FITS_TArray<T> fih(&arr); fih.Read(fiis); return (fiis); }
 
 } // Fin du namespace
Index: trunk/SophyaExt/FitsIOServer/fitsxntuple.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsxntuple.h	(revision 1230)
+++ trunk/SophyaExt/FitsIOServer/fitsxntuple.h	(revision 1231)
@@ -69,4 +69,9 @@
 //////////////////////////////////////////////////////////////////
 
+inline FitsOutFile& operator << (FitsOutFile& fios, XNTuple & nt)
+  { FITS_XNTuple fih(&nt); fih.Write(fios); return (fios); }
+
+inline FitsInFile& operator >> (FitsInFile& fiis, XNTuple & nt)
+  { FITS_XNTuple fih(&nt); fih.Read(fiis); return (fiis); }
 
 } // Fin du namespace
