00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00020 
00022 
00033 #ifndef file_h
00034 #define file_h
00035 
00036 #include <fstream>
00037 #include "matpackI.h"
00038 #include "mystring.h"
00039 #include "absorption.h"
00040 
00042 
00044 
00045 void filename_ascii(
00046               String&  filename,
00047         const String&  varname );
00048 
00049 void filename_bin(
00050               String&  filename,
00051         const String&  varname );
00052 
00053 
00054 
00056 
00058 
00059 void open_output_file(ofstream& file, const String& name);
00060 
00061 void open_input_file(ifstream& file, const String& name);
00062 
00063 void read_text_from_stream(ArrayOfString& text, istream& is);
00064 
00065 void read_text_from_file(ArrayOfString& text, const String& name);
00066 
00067 void replace_all(String& s, const String& what, const String& with);
00068 
00069 
00070 
00072 
00074 
00075 void write_array_of_matrix_to_stream(ostream& os,
00076                                      const ArrayOfMatrix& am);
00077 
00078 void write_array_of_matrix_to_file(const String& filename,
00079                                    const ArrayOfMatrix& am);
00080 
00081 void read_array_of_matrix_from_stream(ArrayOfMatrix& am,
00082                                       istream& is);
00083 
00084 void read_array_of_matrix_from_file(ArrayOfMatrix& am,
00085                                     const String& filename);
00086 
00087 
00088 
00090 
00092 
00093 void write_array_of_String_to_stream(
00094               ostream&         os,
00095         const ArrayOfString&   as );
00096 
00097 void write_array_of_String_to_file(
00098         const String&          filename,
00099         const ArrayOfString&   as );
00100 
00101 void read_array_of_String_from_stream(
00102         ArrayOfString&   as,
00103         istream&         is );
00104 
00105 void read_array_of_String_from_file(
00106            ArrayOfString&   as,
00107      const String&          filename );
00108 
00109 void write_tag_groups_species_to_stream(
00110               ostream&     os,
00111               const TagGroups&   tgs );
00112 
00113 void write_tag_groups_species_to_file(
00114         const String&          filename,
00115         const TagGroups&   tgs );
00116 
00117 
00119 
00121 
00122 void binfile_open_out(
00123               int&      fid,
00124         const String&   filename );
00125 
00126 void binfile_open_in(
00127               int&      fid,
00128         const String&   filename );
00129 
00130 void binfile_close(
00131               int&      fid,
00132         const String&   filename );
00133 
00134 
00135 
00137 
00139 
00140 void binfile_write_index(
00141         const String&   filename,
00142         const int&      fid,
00143         const Index&   x,
00144         const String&   dataname );
00145 
00146 void binfile_read_index(
00147               Index&   x,
00148         const String&   filename,
00149         const int&      fid,
00150         const String&   dataname );
00151 
00152 void binfile_write_numeric(
00153         const String&   filename,
00154         const int&      fid,
00155         const Numeric&  x,
00156         const String&   dataname );
00157 
00158 void binfile_read_numeric(
00159               Numeric&  x,
00160         const String&   filename,
00161         const int&      fid,
00162         const String&   dataname );
00163 
00164 void binfile_write_vector(
00165         const String&   filename,
00166         const int&      fid,
00167         const Vector&   x,
00168         const String&   dataname );
00169 
00170 void binfile_read_vector(
00171               Vector&   x,
00172         const String&   filename,
00173         const int&      fid,
00174         const String&   dataname );
00175 
00176 void binfile_write_matrix(
00177         const String&   filename,
00178         const int&      fid,
00179         const Matrix&   x,
00180         const String&   dataname );
00181 
00182 void binfile_read_matrix(
00183               Matrix&   x,
00184         const String&   filename,
00185         const int&      fid,
00186         const String&   dataname );
00187 
00188 void binfile_write_indexarray(
00189         const String&         filename,
00190         const int&            fid,
00191         const ArrayOfIndex&   x,
00192         const String&         dataname );
00193 
00194 void binfile_read_indexarray(
00195               ArrayOfIndex&   x,
00196         const String&         filename,
00197         const int&            fid,
00198         const String&         dataname );
00199 
00200 void binfile_write_vectorarray(
00201         const String&          filename,
00202         const int&             fid,
00203         const ArrayOfVector&   x,
00204         const String&          dataname );
00205 
00206 void binfile_read_vectorarray(
00207               ArrayOfVector&   x,
00208         const String&          filename,
00209         const int&             fid,
00210         const String&          dataname );
00211 
00212 void binfile_write_matrixarray(
00213         const String&          filename,
00214         const int&             fid,
00215         const ArrayOfMatrix&   x,
00216         const String&          dataname );
00217 
00218 void binfile_read_matrixarray(
00219               ArrayOfMatrix&   x,
00220         const String&          filename,
00221         const int&             fid,
00222         const String&          dataname );
00223 
00224 void binfile_write_String(
00225         const String&   filename,
00226         const int&      fid,
00227         const String&   s,
00228         const String&   dataname );
00229 
00230 void binfile_read_String(
00231               String&   x,
00232         const String&   filename,
00233         const int&      fid,
00234         const String&   dataname );
00235 
00236 void binfile_write_Stringarray(
00237         const String&          filename,
00238         const int&             fid,
00239         const ArrayOfString&   x,
00240         const String&          dataname );
00241 
00242 void binfile_read_Stringarray(
00243               ArrayOfString&   x,
00244         const String&          filename,
00245         const int&             fid,
00246         const String&          dataname );
00247 
00248 
00249 #endif