Wheefun I/O Library
0.0.5
Useful I/O Primitives.
|
Public Types | |
enum | Type { UNKNOWN = ::WFIO_PEER_UNKNOWN, DEVICE = ::WFIO_PEER_DEVICE, BINSTREAM = ::WFIO_PEER_BINSTREAM } |
A type specification for a peer. More... | |
typedef ::wfio_peer_t | CType |
The C type from which a Peer is derived. | |
Public Member Functions | |
Peer () | |
Construct the default Peer. More... | |
Peer (CType &ctype, int *error=0) | |
Construct a peer from a CType. More... | |
Peer (CType &ctype, IOShare share, int *error=0) | |
Construct a peer from a CType using the specified IO sharing mode. More... | |
Peer (CType *ctype, int *error=0) | |
Construct a peer from a CType pointer. More... | |
Peer (CType *ctype, IOShare share, int *error=0) | |
Construct a peer from a CType pointer using the specified IO sharing mode. More... | |
Peer (Device &device, int *error=0) | |
Construct a peer from a Device. More... | |
Peer (Device &device, IOShare share, int *error=0) | |
Construct a Peer from a Device using the specified IO sharing mode. More... | |
Peer (BinStream &bin, int *error=0) | |
Construct a Peer from a BinsStream. More... | |
Peer (BinStream &bin, IOShare share, int *error=0) | |
Construct a Peer from a BinsStream using the specified IO sharing mode. More... | |
~Peer () | |
Type | type () const throw () |
Obtain the type of this Peer. | |
size_t | read (void *buf, size_t sz, size_t elem, int *error=0) throw () |
Read elements from this Peer. More... | |
size_t | read (void *buf, size_t len, int *error) throw () |
Read bytes from this Peer. More... | |
int | read (int *error=0) |
Read a single byte from this peer. More... | |
size_t | write (const void *buf, size_t sz, size_t elem, int *error=0) |
Write elements to this Peer. More... | |
size_t | write (const void *buf, size_t len, int *error=0) |
Write bytes to this peer. More... | |
int | write (char c, int *error=0) |
Write a single byte to this peer. More... | |
bool | seek (off_t offset, wfio_whence_t whence, int *error=0) |
Seek to a position in the stream. More... | |
bool | canSeek () const throw () |
Determine whether or not this Peer can seek. More... | |
off_t | tell (int *error=0) throw () |
Determine the current stream position of this peer. More... | |
bool | flush (int *error=0) |
Attempt to flush this Peer. More... | |
size_t | bufsz (int *error=0) const throw () |
Obtain the buffer size for this Peer. More... | |
size_t | bufsz (size_t sz, int *error=0) throw () |
Set the buffer size for this Peer. More... | |
int | vdcntl (DCntl cmd, va_list va) |
Perform device-independent I/O on this peer using a va_list. More... | |
int | vdcntlEx (int *error, DCntl cmd, va_list va) |
Perform device-independent I/O on this peer using a va_list, capturing any errors in error . More... | |
int | dcntl (DCntl cmd,...) |
Perform device-independent I/O on this Peer. More... | |
int | dcntl (int *error, DCntl cmd,...) |
Perform device-independent I/O on this Peer, capturing any errors in error . More... | |
int | vioctl (int cmd, va_list va) |
Perform device-dependent I/O on this peer using a va_list. More... | |
int | vioctlEx (int *error, int cmd, va_list va) |
Perform device-dependent I/O on this peer using a va_list, capturing any errors in error . More... | |
int | ioctl (int cmd,...) |
Perform device-dependent I/O on this Peer. More... | |
int | ioctlExt (int *error, int cmd,...) |
Perform device-dependent I/O on this Peer, capturing any errors in error . More... | |
operator::wfio_peer_t * () | |
Implicitly convert this Peer. | |
WFIO_DLL_FASTCALL Device | toDevice (int *error=0) |
Convert this Peer to a Device. More... | |
operator Device () | |
Implicitly convert this Peer to a Device. More... | |
WFIO_DLL_FASTCALL BinStream | toBinStream (int *error=0) |
Convert this Peer to a BinStream. More... | |
operator BinStream () | |
Implicitly convert this Peer to a BinStream. More... | |
enum wfio::Peer::Type |
|
inline |
Construct the default Peer.
This constructor creates an invalid peer.
|
inline |
Construct a peer from a CType.
ctype | The ctype to wrap. |
error | An optional error indicator. |
Construct a peer from a CType using the specified IO sharing mode.
ctype | The ctype to wrap. |
share | The IO sharing mode. |
error | An optional error indicator. |
|
inline |
Construct a peer from a CType pointer.
ctype | The ctype to wrap. |
error | An optional error indicator. |
Construct a peer from a CType pointer using the specified IO sharing mode.
ctype | The ctype to wrap. |
share | The IO sharing mode. |
error | An optional error indicator. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the buffer size for this Peer.
sz | The requested size to set. |
error | An optional error indicator. |
|
inline |
|
inline |
Perform device-independent I/O on this Peer.
cmd | The command to send to the peer. |
... | Additional arguments to the dcntl. |
|
inline |
Perform device-independent I/O on this Peer, capturing any errors in error
.
error | An error indicator. |
cmd | The command to send to the peer. |
... | Additional arguments to the dcntl. |
|
inline |
Attempt to flush this Peer.
error | An optional error indicator. |
|
inline |
|
inline |
|
inline |
Implicitly convert this Peer to a BinStream.
|
inline |
Implicitly convert this Peer to a Device.
|
inline |
Read elements from this Peer.
buf | The buffer to read into. |
sz | The size of each element. |
elem | The number of elements to read. |
error | An optional error indicator. |
|
inline |
Read bytes from this Peer.
buf | The buffer to read into. |
len | The number of bytes to read. |
error | An optional error indicator. |
|
inline |
Read a single byte from this peer.
error | An optional error indicator. |
|
inline |
Seek to a position in the stream.
This method attempts to seek the peer to the specified position. This is only successful if the peer is open and seekable.
offset | The offset relative to whence to seek to. |
whence | The origin added to whence to seek to. |
error | An optional error indicator. |
|
inline |
Determine the current stream position of this peer.
peer | The peer to interrogate. |
error | An optional error indicator. |
WFIO_DLL_FASTCALL BinStream wfio::Peer::toBinStream | ( | int * | error = 0 | ) |
Convert this Peer to a BinStream.
This method creates a BinStream from this peer. The BinStream shall be valid if this peer represents a valid binstream; otherwise, it shall return an invalid device and error
shall be set if it is not NULL.
error | An optional error indicator. |
WFIO_DLL_FASTCALL Device wfio::Peer::toDevice | ( | int * | error = 0 | ) |
|
inline |
Perform device-independent I/O on this peer using a va_list.
cmd | The command to send to the peer. |
va | Additional arguments to the dcntl. |
|
inline |
Perform device-independent I/O on this peer using a va_list, capturing any errors in error
.
error | An error indicator. |
cmd | The command to send to the peer. |
va | Additional arguments to the dcntl. |
|
inline |
Perform device-dependent I/O on this peer using a va_list.
cmd | The command to send to the peer. |
va | Additional arguments to the dcntl. |
|
inline |
Perform device-dependent I/O on this peer using a va_list, capturing any errors in error
.
error | An error indicator. |
cmd | The command to send to the peer. |
va | Additional arguments to the ioctl. |
|
inline |
Write elements to this Peer.
buf | The buffer to write from. |
sz | The size of each element. |
elem | The number of elements to write. |
error | An optional error indicator. |
|
inline |
Write bytes to this peer.
buf | The buffer to write from. |
len | The number of bytes to write. |
error | An optional error indicator. |
|
inline |
Write a single byte to this peer.
c | The byte to write. |
error | An optional error indicator. |