- OK
- NOSUCHFILE
- NOMEM
- OPENERR
- CLOSEERR
- READERR
- WRITEERR
----------------------------------------------------------------------------
number of physical blocks read/written
reset the m_iosize data member
get the total bytes of data in m_buffer
get the current read position within m_buffer
get m_buffer
number of logical records read/written
name of file associated with I/O stream, if applicable
fits_close_file() does not work for reasons that the file pointer does not have the
knowledge of chdu which were written with write_hdr() not write_***_hdr(). So create
our own close_file() method.
get the fitsfile pointer
The remaining arguments are the the logical record size and number
of records that make up a physical record followed by the
output stream that is used to write error messages to.
set the error message and error number for later recovery
The remaining arguments are the the logical record size and number
of records that make up a physical record followed by the
output stream that is used to write error messages to.
read the next logical record or first
skip N logical records and then read the next one.
(note it is not possible to skip a record without
reading a record).
read a physical block.
read the next logical record or first
skip N logical records and then read the next one.
(note it is not possible to skip a record without
reading a record).
The remaining arguments are the the logical record size and number
of records that make up a physical record followed by the
output stream that is used to write error messages to.
write the next logical record. The input must point
to a logical record
Synopsis
BlockIO is a low level base class that implements fixed-length
blocked sequential I/O. Its derived classes, BlockInput and BlockOutput
are used by the FitsInput and FitsOutput classes. Users will hardly ever
need to use this class directly.
To Do
Member Description
enum IOErrs
error return code
int err() const
int blockno() const
void reset_iosize()
int iosize() const
int current() const
char* buffer() const
int recno() const
const char *fname() const
int close_file( fitsfile *fptr, int *status)
int fdes() const
file descriptor associated with I/O stream, if applicable
fitsfile *getfptr() const
void setfptr( fitsfile* ffp )
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.
BlockIO(int, int, int = 1, FITSErrorHandler errhandler = FITSError::defaultHandler)
virtual ~BlockIO()
void errmsg(IOErrs, char *)
class BlockInput : public BlockIO
Interface
Description
Prerequisite
Member Description
BlockInput(const char *, int, int = 1, FITSErrorHandler errhandler = FITSError::defaultHandler)
Construction can be done either from a filename or from
a file descriptor.
BlockInput(int, int, int = 1, FITSErrorHandler errhandler = FITSError::defaultHandler)
virtual ~BlockInput()
virtual char *skip(int)
these functions return a pointer to an
internal record. The user must make sure that
after destruction of this class no dangling pointers
are left.
virtual char *read()
these functions return a pointer to an
internal record. The user must make sure that
after destruction of this class no dangling pointers
are left.
class BlockOutput : public BlockIO
Interface
Description
Prerequisite
Member Description
BlockOutput(const char *, int, int = 1, FITSErrorHandler errhandler = FITSError::defaultHandler)
Construction can be done either from a filename or from
a file descriptor.
BlockOutput(int, int, int = 1, FITSErrorHandler errhandler = FITSError::defaultHandler)
virtual ~BlockOutput()
void flush_buffer()
virtual int write(char *)