Go to the documentation of this file.
31 for (
int j = 0; j < 65 && is.good(); j++) {
34 cout << j <<
" " << pph[j] <<
" " << is.
error() << endl;
40 const int EXTRA_DATA = 3;
41 v.
resize(pph[15] + EXTRA_DATA);
43 for (
int j = 0; j < pph[15] + EXTRA_DATA && is.good(); j++) {
48 cerr <<
"Error: " << is.
error() << endl;
52 int main(
int argc,
char* argv[]) {
54 cerr <<
"Usage: " << argv[0] <<
" PPFILE [MAXFIELDS]" << endl;
59 if (argc > 2) maxfields = strtol(argv[2], NULL, 10);
68 while (is.good() && field != maxfields) {
74 if (is.
error() & 32)
return (EXIT_FAILURE);
77 if ((e = is.
error())) {
78 cerr <<
"Reading " << field <<
". header failed with error " << e
82 cout <<
"Field # " << setw(5) << field <<
" -- STASH code " << setw(5)
83 << pph[42] <<
" -- PP code " << setw(4) << pph[23] <<
" -- PP VCT "
84 << setw(3) << pph[26] << endl;
88 if ((e = is.
error())) {
89 cerr <<
"Reading " << field <<
". data failed with error " << e << endl;
94 cerr <<
"Error reading from " << argv[1] << endl;
95 return (EXIT_FAILURE);
98 return (EXIT_SUCCESS);
void resize(Index n)
Resize function.
void readppheader(bifstream &is, PPHeader &pph)
Implementation of Matrix, Vector, and such stuff.
Int peekInt(unsigned int size)
int main(int argc, char *argv[])
Binary output file stream class.
This file contains the class declaration of bifstream.
void readppdata(bifstream &is, PPHeader &pph, Vector &v)
void setFlag(Flag f, bool set=true)
Int readInt(unsigned int size)
Float readFloat(FType ft)