ADMB Documentation  11.6rc.3352
 All Classes Files Functions Variables Typedefs Friends Defines
str_aio.cpp
Go to the documentation of this file.
00001 
00006 #include <fvar.hpp>
00007 #include <cifstrem.h>
00008 
00012 ifstream& operator>>(ifstream& ifs, adstring_array& sa)
00013 {
00014   if (sa.ptr)
00015   {
00016     int min = sa.indexmin();
00017     int max = sa.indexmax();
00018     for (int i = min; i <= max; ++i)
00019     {
00020       ifs >> sa[i];
00021     }
00022   }
00023   return ifs;
00024 }
00028 ostream& operator<<(const ostream& _ofs, const adstring_array& sa)
00029 {
00030   ostream& ofs = (ostream&)_ofs;
00031   if (sa.ptr)
00032   {
00033     int min = sa.indexmin();
00034     int max = sa.indexmax();
00035     for (int i = min; i <= max; ++i)
00036     {
00037       ofs << sa[i];
00038       if (i < max) ofs << endl;
00039     }
00040   }
00041   return ofs;
00042 }
00046 cifstream& operator>>(cifstream& ifs, adstring_array& sa)
00047 {
00048   if (sa.ptr)
00049   {
00050     int min = sa.indexmin();
00051     int max = sa.indexmax();
00052     for (int i = min; i <= max; ++i)
00053     {
00054       ifs >> sa[i];
00055     }
00056   }
00057   return ifs;
00058 }