IO interface.
More...
#include <io.h>
List of all members.
Public Types |
| enum | Whence { kSet = SEEK_SET,
kCur = SEEK_CUR,
kEnd = SEEK_END
} |
Public Member Functions |
| virtual | ~IOHandler () |
| | Virtual destructor.
|
| virtual void | close (void) throw (DmException) |
| | Close.
|
| virtual struct stat | fstat (void) throw (DmException) |
| virtual size_t | read (char *buffer, size_t count) throw (DmException) |
| virtual size_t | write (const char *buffer, size_t count) throw (DmException) |
| virtual size_t | readv (const struct iovec *vector, size_t count) throw (DmException) |
| virtual size_t | writev (const struct iovec *vector, size_t count) throw (DmException) |
| virtual size_t | pread (void *buffer, size_t count, off_t offset) throw (DmException) |
| virtual size_t | pwrite (const void *buffer, size_t count, off_t offset) throw (DmException) |
| virtual void | seek (off_t offset, Whence whence) throw (DmException) |
| virtual off_t | tell (void) throw (DmException) |
| | Return the cursor position.
|
| virtual void | flush (void) throw (DmException) |
| | Flush the buffer.
|
| virtual bool | eof (void) throw (DmException) |
| | Return true if end of file.
|
Detailed Description
Member Enumeration Documentation
- Enumerator:
| kSet |
Beginning of the file.
|
| kCur |
Current position.
|
| kEnd |
End of file.
|
Constructor & Destructor Documentation
Member Function Documentation
Return true if end of file.
Gets information about a file descriptor.
- Note:
- Not all plug-ins will fill all the fields, but st_size is a reasonable expectation.
-
Default implementation combining seek/tell is provided.
Read from the given offset without changing the file offset.
- Parameters:
-
| buffer | Where to put the data. |
| count | Number of bytes to read. |
| offset | The operation offset. |
- Note:
- A default implementation using read/seek/tell is provided.
Write from the given offset without changing the file offset.
- Parameters:
-
| buffer | Data to write. |
| count | Number of bytes to read. |
| offset | The operation offset. |
- Note:
- A default implementation using read/seek/tell is provided.
Read.
- Parameters:
-
| buffer | Where to store the data. |
| count | Number of bytes to read. |
- Returns:
- Number of bytes actually read.
Read into multiple buffers.
- Parameters:
-
| vector | An array with 'count' iovec structs. |
| count | Number of elements in vector. |
- Returns:
- The total size read.
- Note:
- See man readv.
-
A default implementation using read is provided.
Move the cursor.
- Parameters:
-
| offset | The offset. |
| whence | Reference. |
Return the cursor position.
Write.
- Parameters:
-
| buffer | Data to write. |
| count | Number of bytes to write. |
- Returns:
- Number of bytes actually written.
Write from multiple buffers.
- Parameters:
-
| vector | An array with 'count' iovec structs. |
| count | Number of elements in vector. |
- Returns:
- The total size written.
- Note:
- See man writev.
-
A default implementation using write is provided.
The documentation for this class was generated from the following file: