10 using std::istringstream;
14 #if defined(__GNUC__) && (__GNUC__ < 3)
15 #pragma implementation "cifstrem.h"
33 int current_state = rdstate();
34 setstate(current_state | ios::eofbit);
37 int current_state = rdstate();
38 clear(current_state | ios::eofbit);
51 while (c !=
'\n' && c !=
'\r' && c != EOF)
87 #if defined (_MSC_VER) || defined (__WAT32__)
88 : ifstream(fn, ios::in | open_m) , file_name(fn)
89 #elif defined(__BCPLUSPLUS__)
90 : ifstream(fn, ios::in | open_m) , file_name(fn)
91 #elif defined (__NDPX__)
92 : ifstream(fn, ios::in | open_m) , file_name(fn)
93 #elif defined (__INTEL_COMPILER)
94 : ifstream(fn) , file_name(fn)
95 #elif defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5140)
96 : ifstream(fn, ios::in | open_m) , file_name(fn)
97 #elif defined (__ZTC__)
98 : ios(&buffer), ifstream(fn, ios::in | open_m) , file_name(fn)
100 : ifstream(fn, ios::in | std::ios::openmode(open_m)) , file_name(fn)
132 while (c !=
'\r' && c !=
'\n' && c != EOF)
162 "function: void cifstream::filter(); premature end of file?");
175 int testc =
bp->sgetc();
182 s[n++] = (char)testc;
183 testc =
bp->snextc();
184 if (!good() || testc == EOF)
194 s[n++] = (char)testc;
195 testc =
bp->snextc();
196 if (!good() || testc == EOF)
205 " Buffer size exceeded?");
207 if (!good() || testc == EOF)
212 "function: void cifstream::prefilter(); premature end of file?");
264 return operator>>(const_cast<line_adstring&>(str));
298 if (is.eof()) is.clear();
302 this->clear(is.rdstate());
309 #if defined(__ADSGI__)
331 if (is.eof()) is.clear();
335 this->clear(is.rdstate());
353 if (is.eof()) is.clear();
357 this->clear(is.rdstate());
367 size_t n = strlen(s) - 1;
370 while ((i < n) && (s[i]==
'0') )
391 if (is.eof()) is.clear();
395 this->clear(is.rdstate());
408 double&
x = (
double&)(_x);
410 char* s = (
char*)malloc(8000*
sizeof(
char));
420 #if !defined(__BORLANDC__)
424 this->clear(is.rdstate());
430 if (is.eof()) is.clear();
434 this->clear(is.rdstate());
460 if (is.eof()) is.clear();
464 this->clear(is.rdstate());
479 int testc =
bp->sbumpc();
480 while ( (!eof()) && (n < k) && (testc != d) && (testc != EOF))
482 s[n++] = (char)testc;
483 testc =
bp->sbumpc();
virtual ~cifstream()
Destructor.
char comment_line[SIGNATURE_LENGTH+1]
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
cifstream(const char *, int=std::ios_base::in, char cc= '#')
void realloc(const char *t)
char * signature()
Get the signature line of inputfile.
void get_field(char *s, int space_flag=0)
Extract a single field into s from data file.
cifstream & operator>>(const dvariable &z)
Reads input into var from comment formatted input file.
cifstream & getline(char *, int, char= '\n')
void filter()
Move file pointer past comments and empty lines to next data field.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
adstring str(double x, int minwidth=17, int decplaces=-1)
Convert x to adstring with minimum width and total number of decimal places.
adstring get_file_name(void)
istream & operator>>(const istream &input, const d3_array &arr3)
Read values from input stream into arr3.
Definition of the cifstream class.
void report_error(const char *s=NULL)
void js_strip_leading_zeros(char *s)
char signature_line[SIGNATURE_LENGTH+1]