FACT++  1.0
bool FitsFile::AddRow ( )

Definition at line 368 of file FitsFile.cc.

References Error(), and str.

Referenced by WriteKeyNT().

369 {
370  if (!fFile || !fTable)
371  {
372  Error("FitsFile::AddRow - No table open.");
373  return false;
374  }
375 
376  //insert a new row (1==number of rows to insert)
377  int status(0);
378  fits_insert_rows(fFile->fitsPointer(), fNumRows, 1, &status);
379 
380  // Status is also directly returned, but we need to give the
381  // pointer anyway
382  if (status)
383  {
384  char text[30];//max length of cfitsio error strings (from doc)
385  fits_get_errstatus(status, text);
386 
387  ostringstream str;
388  str << "Inserting row " << fNumRows << " failed in '"+fFile->name()+"': " << text << " (fits_insert_rows,rc=" << status << ")";
389  Error(str);
390 
391  return false;
392  }
393 
394  fNumRows++;
395  fCursor = 1;
396 
397  return true;
398 }
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
size_t fCursor
the number of rows that have been written already to the FITS file.
Definition: FitsFile.h:22

+ Here is the call graph for this function:

+ Here is the caller graph for this function: