📄 wybyteflow.3wy
字号:
(If *this is a standard i/o handler, the following errors may also occur) Wym_EINTR A signal had occurred Wym_EBUSY Device or resource busy Note: Error report from closing the previously handled object is ignored. Use reset() first if the close return status is desired.PP [\fBRefer\fP] ::dup(int), ::dup2(int,int).\"--------------------------------------------.PP.BI "virtual WyRet reset(const char* " "pathname" ",int " "f" ")" .PP.BI "virtual WyRet reset(const WyStr& " "pathname" ",int " "f" ")" .PP Reconstruct *this to the state as WyByteFlow(\fIpathname\fP,\fIf\fP) \fIf\fP= flags for ::open, except O_CREAT.PP [\fBRet\fP] Ok Succeed. Wym_EINVAL \fIf\fP invalid Wym_EBADF File is not valid for the operation Wym_EACCES Search permission is denied Wym_ENAMETOOLONG \fIpathname\fP too long Wym_ENOENT \fIpathname\fP does not exist Wym_ENOTDIR Entry in \fIpathname\fP is not a directory Wym_EMFILE Too many open fd Wym_ENFILE File table overflow Wym_ENOMEM Not enough memory Wym_EEXIST Pathname already exists Wym_EINTR Interrupted by a signal Wym_ENOSPC Device left no space for the operation Wym_ENXIO No such device (device not ready) Wym_EROFS Read-only file system Wym_ENODEV No such device Wym_ELOOP Too many symbolic links encountered ... reply converted from ::open (If *this is a standard i/o handler, the following errors may also occur) Wym_EBUSY Device or resource busy Note: Error report from closing the previously handled object is ignored. Use reset() first if the close return status is desired.PP [\fBRefer\fP] ::open(const char*,int), ::dup2(int,int).\"--------------------------------------------.PP.BI "virtual WyRet _swap(WySysFile& " "sysf" ") throw()".PP Interchange state of *this with \fIsysf\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADTYPE \fIsysf\fP is not the same type as *this.\"--------------------------------------------.PP.BI "virtual WyByteFlow* _alloc(WyRet& " "r" ") const".PP Allocate a default object of the most inherited type that *this refers. Note: Inhertied class must override this member \fIr\fP is reset with the return status: Wym_ENOMEM Not enough memory Wym_ENOSYS *Not overridden ... Same from constructing WyByteFlow() A typical _alloc reimplemet example: D* D::_alloc(WyRet& r) const try { if(typeid(*this)!=typeid(D)) { r=Wym_ENOSYS; WY_HERE(r); // Set r to Wym_ENOSYS if the return(NULL); // deriving class does not } // override this member D *p= new(std::nothrow) D(); if(p==NULL) { r=Wym_ENOMEM; WY_HERE(r); } else { r=Ok; } return(p); } catch(const Reply& e) { // Assume D uses Reply r=e; WY_HERE(r); return(NULL); } catch(const WyRet& e) { // Rethrow object of WyRet WY_THROW( WyRet(e) ); // family to the exact }; // WyRet class.PP [\fBRet\fP] Pointer of the allocated object, or NULL if failed. User is responsible to \fBdelete\fP the returned object..\"--------------------------------------------.PP.BI "virtual WyRet read(void* " "buf" ", size_t " "count" ", size_t& " "n_read" ")".PP Read at most \fIcount\fP bytes of data into memory pointed by \fIbuf\fP. \fIn_read\fP is always written with the bytes read and stored into \fIbuf\fP..PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EFBIG \fIcount\fP exceeds the maximum Wym_EINTR Interrupted by a signal before any data read Wym_EAGAIN Non-blocking I/O (no data read) Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for reading Wym_EFAULT \fIbuf\fP is inaccessible Wym_ENOMEM Not enough memory for \fIcount\fP.PP [\fBRefer\fP] ::read(int,void*,size_t).\"--------------------------------------------.PP.BI "virtual WyRet read(WyStr&" " buf" ", size_t " "count" ", size_t& " "n_read" ")".PP Read at most \fIcount\fP bytes of data and \fBappend\fP to \fIbuf\fP. \fIn_read\fP is always written with the bytes read and appended to \fIbuf\fP..PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EFBIG \fIcount\fP exceeds the maximum Wym_EINTR Interrupted by a signal before any data read Wym_EAGAIN Non-blocking I/O (no data read) Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for reading Wym_ENOMEM Not enough memory for \fIcount\fP.PP [\fBRefer\fP] ::read(int,void*,size_t).\"--------------------------------------------.PP.BI "virtual WyRet write(const void* " "buf" ", size_t " "count" ", size_t& " "n_written" ")".PP Write \fIcount\fP bytes of data in \fIbuf\fP to the device. The number of written bytes is always stored into \fIn_written\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EINVAL Object attatched device is not suitable Wym_EFAULT \fIbuf\fP is inaccessible Wym_EFBIG Attempt to write beyond the device limit Wym_EPIPE Write to a pipe or FIFO with no reader Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_ENOSPC Device left no space for the operation Wym_EIO Low level I/O error.PP [\fBRefer\fP] ::write(int,const void*,size_t).\"--------------------------------------------.PP.BI "virtual WyRet write(WyCSeg " "buf" ", size_t& " "n_written" ")".PP Write data indicated by \fIbuf\fP to the device The number of written bytes is always stored into \fIn_written\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EINVAL Object attatched device is not suitable Wym_EFBIG Attempt to write beyond the device limit Wym_EPIPE Write to a pipe or FIFO with no reader Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_ENOSPC Device left no space for the operation Wym_EIO Low level I/O error.PP [\fBRefer\fP] ::write(int,const void*,size_t).\"--------------------------------------------.PP.BI "virtual WyRet write(const WyStr& " "buf" ", size_t& " "n_written" ")".PP Write data in \fIbuf\fP to the device. The number of written bytes is always stored into \fIn_written\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EINVAL Object attatched device is not suitable Wym_EFBIG Attempt to write beyond the device limit Wym_EPIPE Write to a pipe or FIFO with no reader Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_ENOSPC Device left no space for the operation Wym_EIO Low level I/O error.PP [\fBRefer\fP] ::write(int, const void*,size_t).\"--------------------------------------------.PP.BI "WyRet _fsync(void)".PP Wait untill all the in-core parts of *this associated file has written to device.PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for writting Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for the operation Wym_EROFS Read-only file system.PP [\fBRefer\fP] ::fsync(int).\"--------------------------------------------.PP.BI "WyRet _fdatasync(void)".PP Wait untill the in-core written data has written to device.PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for writting Wym_EIO Low level I/O error Wym_EINVAL Device is not suitable for the operation Wym_EROFS Read-only file system.PP [\fBRefer\fP] ::fdatasync(int).\"--------------------------------------------.PP.BI "WyRet _tcdrain(void)" .PP Wait until all output written to *this associated terminal device has been transmitted..PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for the operation Wym_EINTR Interrupted by a signal Wym_ENOTTY Not a terminal device ... reply converted from the errno ::tcdrain returned.PP [\fBRefer\fP] ::tcdrain(int).\"--------------------------------------------.PP.BI "bool _isatty(void) const" .PP Is *this referring to a terminal device.PP [\fBRet\fP] true= *this refers to a terminal false= otherwise.PP [\fBRefer\fP] ::isatty(int).\"--------------------------------------------.SH "SEE ALSO".BR wy.BR wy_uty.BR wyret.BR wyfilestat.BR wysysfile.BR wychrfile.BR wyregfile.BR wytimespec.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 + -