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 readppheader(bifstream &is, PPHeader &pph)
int main(int argc, char *argv[])
Float readFloat(FType ft)
Int readInt(unsigned int size)
Binary output file stream class.
This file contains the class declaration of bifstream.
Implementation of Matrix, Vector, and such stuff.
void resize(Index n)
Resize function.
void setFlag(Flag f, bool set=true)
void readppdata(bifstream &is, PPHeader &pph, Vector &v)
Int peekInt(unsigned int size)