28 #ifndef CASA_FILEDESIO_H
29 #define CASA_FILEDESIO_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/IO/ByteIO.h>
34 #include <casacore/casa/BasicSL/String.h>
SeekOption
Define the possible seek options.
int fd() const
Get the file descriptor.
static int create(const Char *name, int mode=0666)
Some static convenience functions for file create/open/close.
virtual void pwrite(Int64 size, Int64 offset, const void *buf)
Write the number of bytes at offset from start of the file.
FiledesIO()
Default constructor.
virtual void write(Int64 size, const void *buf)
Write the number of bytes.
void attach(int fd, const String &fileName)
Attach to the given file descriptor.
virtual Bool isReadable() const
Is the IO stream readable?
void detach()
Detach from the file descriptor.
void fillRWFlags(int fd)
Determine if the file descriptor is readable and/or writable.
virtual ~FiledesIO()
The destructor detaches, but does not close the file.
static int open(const Char *name, Bool writable=False, Bool throwExcp=True)
FiledesIO & operator=(const FiledesIO &that)
Assignment, should not be used.
virtual Int64 pread(Int64 size, Int64 offset, void *buf, Bool throwException=True)
Like read except reads from offset of the start of the file.
FiledesIO(const FiledesIO &that)
Copy constructor, should not be used.
virtual Bool isSeekable() const
Is the IO stream seekable?
virtual String fileName() const
Get the file name of the file attached.
virtual void fsync()
Fsync the file (i.e.
FiledesIO(int fd, const String &fileName=String())
Construct from the given file descriptor.
virtual Int64 read(Int64 size, void *buf, Bool throwException=True)
Read size bytes from the descriptor.
virtual Int64 length()
Get the length of the byte stream.
void setWritable()
Set that the IO stream is writable.
static void close(int fd)
virtual Int64 doSeek(Int64 offset, ByteIO::SeekOption)
Reset the position pointer to the given value.
virtual Bool isWritable() const
Is the IO stream writable?
void fillSeekable()
Determine if the file is seekable.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.