27 #ifndef FITS_BLOCKIO_H
28 #define FITS_BLOCKIO_H
106 BlockIO(
const char *,
int,
int,
int = 1,
165 virtual char *
read();
166 virtual char *
skip(
int);
194 virtual int write(
char *);
int iosize() const
get the total bytes of data in m_buffer
BlockOutput(const char *, int, int=1, FITSErrorHandler errhandler=FITSError::defaultHandler)
Construction can be done either from a filename or from a file descriptor.
const char * fname() const
name of file associated with I/O stream, if applicable
int close_file(fitsfile *fptr, int *status)
fits_close_file() does not work for reasons that the file pointer does not have the knowledge of chdu...
void reset_iosize()
reset the m_iosize data member
void(* FITSErrorHandler)(const char *errMessage, FITSError::ErrorLevel severity)
Define a typedef for the handler function signature for convenience.
fixed-length blocked sequential output base class
fitsfile * m_fptr
using fitsfile structure from cfitsio of NASA
BlockIO(const char *, int, int, int=1, FITSErrorHandler errhandler=FITSError::defaultHandler)
Construction can be done either from a filename with open options or from a file descriptor.
char * buffer() const
get m_buffer
int fdes() const
file descriptor associated with I/O stream, if applicable
fitsfile * getfptr() const
get the fitsfile pointer
void setfptr(fitsfile *ffp)
int recno() const
number of logical records read/written
int m_iosize
size of record in buffer
int current() const
get the current read position within m_buffer
virtual int write(char *)
write the next logical record.
void errmsg(IOErrs, const char *)
set the error message and error number for later recovery
int blockno() const
number of physical blocks read/written
static void defaultHandler(const char *errMessage, ErrorLevel severity)
The default error handler.