Statistics
| Revision:

root / trunk / src / tools99 / str_aio.cpp @ 1106

History | View | Annotate | Download (914 Bytes)

1
/*
2
 * $Id: str_aio.cpp 1106 2013-07-11 20:54:23Z johnoel $
3
 *
4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California
6
 */
7
#include <fvar.hpp>
8
#include <cifstrem.h>
9

    
10
 ifstream& operator >> (ifstream& ifs,adstring_array& sa)
11
 {
12
   if (sa.ptr)
13
   {
14
     int min=sa.indexmin();
15
     int max=sa.indexmax();
16
     for (int i=min;i<=max;i++)
17
     {
18
       ifs >> sa[i];
19
     }
20
   }
21
   return ifs;
22
 }
23

    
24
 ostream& operator<<(const ostream& _ofs, const adstring_array& sa)
25
 {
26
   ostream& ofs = (ostream&) _ofs;
27
   if (sa.ptr)
28
   {
29
     int min=sa.indexmin();
30
     int max=sa.indexmax();
31
     for (int i=min;i<=max;i++)
32
     {
33
       ofs << sa[i];
34
       if (i<max) ofs << endl;
35
     }
36
   }
37
   return ofs;
38
 }
39
 cifstream& operator >> (cifstream& ifs,adstring_array& sa)
40
 {
41
   if (sa.ptr)
42
   {
43
     int min=sa.indexmin();
44
     int max=sa.indexmax();
45
     for (int i=min;i<=max;i++)
46
     {
47
       ifs >> sa[i];
48
     }
49
   }
50
   return ifs;
51
 }