FACT++  1.0
bool fits::ReadBlock ( std::vector< std::string > &  vec)
inlineprotected

Definition at line 519 of file fits.h.

References Checksum::add(), i, and str.

520  {
521  int endtag = 0;
522  for (int i=0; i<36; i++)
523  {
524  char c[81];
525  c[80] = 0;
526  read(c, 80);
527  if (!good())
528  break;
529 
530  fChkHeader.add(c, 80);
531 
532 // if (c[0]==0)
533 // return vector<string>();
534 
535  std::string str(c);
536 
537 // if (!str.empty())
538 // cout << setw(2) << i << "|" << str << "|" << (endtag?'-':'+') << endl;
539 
540  if (endtag==2 || str=="END ")
541  {
542  endtag = 2; // valid END tag found
543  continue;
544  }
545 
546  if (endtag==1 || str==" ")
547  {
548  endtag = 1; // end tag not found, but expected to be there
549  continue;
550  }
551 
552  vec.emplace_back(str);
553  }
554 
555  // Make sure that no empty vector is returned
556  if (endtag && vec.size()%36==0)
557  vec.emplace_back("END = '' / ");
558 
559  return endtag==2;
560  }
int i
Definition: db_dim_client.c:21
char str[80]
Definition: test_client.c:7
Checksum fChkHeader
Definition: fits.h:516
bool add(const char *buf, size_t len, bool big_endian=true)
Definition: checksum.h:49

+ Here is the call graph for this function: