📄 wy__rdbuf.3wy
字号:
.\".\" Edited by I.J.Wang, 2005.\".TH Wy__RdBuf 3wy "libwy v0.31".SH NAMEWy__RdBuf \- Proxy class for reading data from WyByteFlow objects.SH SYNOPSIS.B #include <wy__rdbuf.h>.PP\fBWarning: This class is for internal testing use.\fPWy__RdBuf is a proxy class facilitating data reading from WyByteFlow objectby reading data through a queue buffer..SH "PUBLIC MEMBERS" class \fBReply\fP : public WyRet \fBWy__RdBuf\fP(WyByteFlow*) \fB~Wy__RdBuf\fP() throw() WyByteFlow* \fBrf_ptr\fP(void) const throw() WyCSeg \fBdata\fP(void) const throw() WyRet \fBreset\fP(WyByteFlow*) WyRet \fBgetch\fP(char&) WyRet \fBunget\fP(void) WyRet \fBgetdata\fP(WyCSeg&, size_t) WyRet \fBgetdata\fP(WyCSeg&, size_t, char) void \fBflush\fP(size_t) size_t \fB_rdsize\fP(void) const throw() void \fB_rdsize\fP(size_t) throw() WyRet \fB_feed\fP(void) WyRet \fB_feed\fP(size_t).SH "DESCRIPTION".\"--------------------------------------------.PP.BI "class Reply : public WyRet".PP Class specific throw type.\"--------------------------------------------.PP.BI "Wy__RdBuf(WyByteFlow* " "bfp" ")".PP Construct object to read data from \fIbf\fP rf_ptr()= \fIbfp\fP (the pointer exactly the same as \fIbfp\fP) data()= Empty WyCSeg (zero size).PP [\fBThrow\fP] Reply Wym_EBADF Object is not valid for the operation Wym_ENOMEM Not enough memory.\"--------------------------------------------.PP.BI "~Wy__RdBuf() throw()".PP Destruct *this.\"--------------------------------------------.PP.BI "WyByteFlow* rf_ptr(void) const throw()".PP Get the WyByteFlow object reference *this reads data from The returned referece is exactly the same as given to the constructor Wy__RdBuf(WyByteFlow&).PP [\fBRet\fP] The WyByteFlow object reference *this reads data from.\"--------------------------------------------.PP.BI "WyCSeg data(void) const throw()".PP Get the data segment in the queue buffer. The data are those that have been read from the WyByteFlow object and not output by any getdata(..) members. Note: Dereference of the returned WyCSeg is valid before the next non-const member call..PP [\fBRet\fP] WyCSeg indicating the read data in the queue buffer.\"--------------------------------------------.PP.BI "WyRet reset(WyByteFlow* " "bfp" ")".PP Reset *this to the state as Wy__RdBuf(\fIbfp\fP) Note: Previously output queue data segment is invalidated.PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for the operation Wym_ENOMEM Not enough memory.\"--------------------------------------------.PP.BI "WyRet getch(char& " "chr" ")".PP Get the next character from the queue buffer and store into \fIchr\fP If there is no data is in the buffer, a read request is send to feed the buffer Note: Previously output queue data segment is invalidated.PP [\fBRet\fP] Ok Succeed Wym_EFAULT No device attached Wym_ENOENT End-of-file encountered Wym_EBADF Object is not valid for the operation Wym_EFBIG _rdsize() exceeds the maximum Wym_EINTR Interrupted by a signal Wym_EAGAIN Non-blocking I/O Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for reading Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] WyByteFlow::read(WyStr&,size_t,size_t&).\"--------------------------------------------.PP.BI "WyRet unget(void)".PP Put back the last character getch(&char) returned into the buffer Note: Previously output queue data segment is invalidated.PP [\fBRet\fP] Ok Succeed Wym_EFAULT No device attached Wym_ENOENT No char to put back into the buffer Wym_EFBIG buffer size would exceed the maximum Wym_ENOMEM Not enough memory.\"--------------------------------------------.PP.BI "WyRet getdata(WyCSeg& " "dseg" ", size_t " "count" ")".PP Get data by resetting \fIdseg\fP with at most \fIcount\fP bytes of characters of the data buffer. The output data segment is valid until next non-const member calls. If not enough data is in the buffer, read request of \fIcount\fP or _dtsize, which is larger, is send to feed the buffer. If getdata returned \fIdseg\fP with size less than \fIcount\fP, End-Of file or a failure encountered. Note: Dereference of the returned \fIdseg\fP is valid before the next non-const member call..PP [\fBRet\fP] Ok Succeed Wym_EFAULT No device attached Wym_EBADF Object is not valid for the operation Wym_EFBIG _rdsize() exceeds the maximum Wym_EINTR Interrupted by a signal Wym_EAGAIN Non-blocking I/O Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for reading Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] WyByteFlow::read(WyStr&,size_t,size_t&).\"--------------------------------------------.PP.BI "WyRet getdata(WyCSeg& " "dseg" ", size_t " "count" ", char " "term" ")".PP Get data by resetting \fIdseg\fP with at most \fIcount\fP bytes of characters of the data buffer unless the character \fIterm\fP is encountered. The output data segment is valid until next non-const member calls. If not enough data is in the buffer, read request of \fIcount\fP or _dtsize, which is larger, is send to feed the buffer. If getdata returned \fIdseg\fP with size less than \fIcount\fP, End-Of file or a failure encountered. Note: Dereference of the returned \fIdseg\fP is valid before the next non-const member call..PP [\fBRet\fP] Ok Succeed Wym_EFAULT No device attached Wym_EBADF Object is not valid for the operation Wym_EFBIG _rdsize() exceeds the maximum Wym_EINTR Interrupted by a signal Wym_EAGAIN Non-blocking I/O Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for reading Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] WyByteFlow::read(WyStr&,size_t,size_t&).\"--------------------------------------------.PP.BI "void flush(size_t " "n" ") throw()".PP Discard \fIn\fP bytes of the buffer..\"--------------------------------------------.PP.BI "size_t _rdsize(void) const throw()".PP Get the amount of bytes that *this reads with each request from the WyByteFlow object..PP [\fBRet\fP] The amount of bytes *this reads from the WyByteFlow object.\"--------------------------------------------.PP.BI "void _rdsize(size_t " "count" ") throw()".PP Set the amount of bytes to \fIcount\fP that *this reads with each request from the WyByteFlow object. This member has no effect if \fIcount\fP is zero..\"--------------------------------------------.PP.BI "WyRet _feed(void)".PP Read at most _rdsize() bytes of data and append to the end of the queue buffer. Note: Previously output queue data segment is invalidated.PP [\fBRet\fP] Ok Succeed Wym_EFAULT No device attached Wym_EBADF Object is not valid for the operation Wym_EFBIG _rdsize() exceeds the maximum Wym_EINTR Interrupted by a signal Wym_EAGAIN Non-blocking I/O Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for reading Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] WyByteFlow::read(WyStr&,size_t,size_t&).\"--------------------------------------------.PP.BI "WyRet _feed(size_t& " "nbytes" ")".PP Read at most \fInbytes\fP bytes of data and append to the end of the queue buffer. Note: Previously output queue data segment is invalidated.PP [\fBRet\fP] Ok Succeed Wym_EFAULT No device attached Wym_EBADF Object is not valid for the operation Wym_EFBIG _rdsize() exceeds the maximum Wym_EINTR Interrupted by a signal Wym_EAGAIN Non-blocking I/O Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for reading Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] WyByteFlow::read(WyStr&,size_t,size_t&).\"--------------------------------------------.SH "SEE ALSO".BR wybyteflow.BR wystr.BR wy_uty.BR wytimespec.BR wy_thread.SH NOTEExcept added by this library, replys are converted from the errno an underlying C library function returned. Report of such replysare brief from Linux Programmer's Manual. See the associated man pagefor details.Project is in development, http://sourceforge.net/projects/libwx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -