FACT++  1.0
bool FitsFile::WriteData ( size_t &  start,
const void *  ptr,
size_t  size 
)

Definition at line 400 of file FitsFile.cc.

References Error(), size, start(), and str.

Referenced by WriteData(), and WriteKeyNT().

401 {
402  if (!fFile || !fTable)
403  {
404  Error("FitsFile::AddRow - No table open.");
405  return false;
406  }
407 
408  int status = 0;
409  fits_write_tblbytes(fFile->fitsPointer(), fNumRows, start, size,
410  (unsigned char*)ptr, &status);
411 
412  // Status is also directly returned, but we need to give the
413  // pointer anyway
414  if (status)
415  {
416  char text[30];//max length of cfitsio error strings (from doc)
417  fits_get_errstatus(status, text);
418 
419  ostringstream str;
420  str << "Writing row " << fNumRows << " failed in '"+fFile->name()+"': " << text << " (file_write_tblbytes,rc=" << status << ")";
421  Error(str);
422  }
423 
424  start += size;
425  return status==0;
426 }
int start(int initState)
Definition: feeserver.c:1740
size_t fNumRows
The pointer to the CCfits binary table.
Definition: FitsFile.h:21
CCfits::Table * fTable
The pointer to the CCfits FITS file.
Definition: FitsFile.h:19
char str[80]
Definition: test_client.c:7
CCfits::FITS * fFile
Definition: FitsFile.h:18
int Error(const std::string &str)
Definition: MessageImp.h:49
int size
Definition: db_dim_server.c:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function: