FACT++  1.0
size_t FitsFile::GetDataSize ( ) const

Definition at line 463 of file FitsFile.cc.

References size.

Referenced by IsOwner().

464 {
465  size_t size = 0;
466 
467  for (vector<string>::const_iterator it=fColTypes.begin();
468  it!=fColTypes.end(); it++)
469  {
470  size_t id=0;
471 
472  int n=1;
473  try { n = stoi(*it, &id); }
474  catch (const exception&) { }
475 
476  if (n==0)
477  continue;
478 
479  switch ((*it)[id])
480  {
481  case 'L':
482  case 'A': size += n*1; break; // ascii
483  case 'B': size += n*1; break; // logical/byte
484  case 'I': size += n*2; break; // short
485  case 'J': size += n*4; break; // int
486  case 'K': size += n*8; break; // long long
487  case 'E': size += n*4; break; // float
488  case 'D': size += n*8; break; // double
489  default:
490  throw runtime_error("FitsFile::GetDataSize - id not known.");
491  }
492  }
493 
494  return size;
495 }
std::vector< std::string > fColTypes
Definition: FitsFile.h:15
int size
Definition: db_dim_server.c:17

+ Here is the caller graph for this function: