📄 wybyteflow.3wy
字号:
.\".\" Edited by I.J.Wang, 2004.\".TH WyByteFlow 3wy "libwy v0.31".SH NAMEWyByteFlow \- base handle class of I/O device.SH SYNOPSIS.B #include <wybyteflow.h>.PP[\fBInherit\fP] WySysFile.PPWyByteFlow is a handle class for the system file that a standard i/o handler can be..SH "PUBLIC MEMBERS" class \fBReply\fP : public WyRet \fBWyByteFlow\fP() \fBWyByteFlow\fP(WyFileHandle) \fBWyByteFlow\fP(const WySysFile&) \fBWyByteFlow\fP(const char*,int) \fBWyByteFlow\fP(const WyStr&,int) \fBWyByteFlow\fP(const WyByteFlow&) \fBWyByteFlow\fP(WyByteFlow&, Wy::ByMove_t) throw() virtual \fB~WyByteFlow\fP() bool \fBis_default\fP(void) const throw() WyFileHandle \fBfh\fP(void) const throw() mode_t \fBftype\fP(void) const throw().\ bool \fBis_std_handler\fP(void) const throw() WyRet \fBstat\fP(WyFileStat&) const virtual WyRet \fBreset\fP(void) virtual WyRet \fBreset\fP(WyFileHandle) virtual WyRet \fBreset\fP(const WySysFile&) virtual WyRet \fBreset\fP(const char*,int) virtual WyRet \fBreset\fP(const WyStr&,int) virtual WyRet \fB_swap\fP(WySysFile&) throw() virtual WyByteFlow* \fB_alloc\fP(WyRet&) const virtual WyRet \fBread\fP(void*,size_t,size_t&) virtual WyRet \fBread\fP(WyStr&,size_t,size_t&) virtual WyRet \fBwrite\fP(const void*,size_t,size_t&) virtual WyRet \fBwrite\fP(WyCSeg,size_t&) virtual WyRet \fBwrite\fP(const WyStr&,size_t&) WyRet \fB_fsync\fP(void) WyRet \fB_fdatasync\fP(void) WyRet \fB_tcdrain\fP(void) bool \fB_isatty\fP(void) const.SH "DESCRIPTION".\"--------------------------------------------.PP.BI "class Reply : public WyRet.PP Class specific throw type..\"--------------------------------------------.PP.BI "WyByteFlow()".PP Construct default object (refers to nothing) fh() = WyFileHandle() ftype()= 0.PP [\fBThrow\fP] Reply (reserved).\"--------------------------------------------.PP.BI "WyByteFlow(WyFileHandle " "h" ")" .PP Construct object to handle the system file handled by \fIh\fP fh() = contains file descriptor ::dup from \fIh\fP ftype()= file type of \fIh\fP.PP [\fBThrow\fP] Reply Wym_EBADF \fIh\fP is not valid for the operation Wym_EMFILE Too many open fd Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] ::dup(int).\"--------------------------------------------.PP.BI "WyByteFlow(const WySysFile& " "sysf" ")".PP Construct object to handle the device handled by \fIsysf\fP fh() = contains file descriptor ::dup from \fIsysf\fP ftype()= \fIsysf\fP.ftype().PP [\fBThrow\fP] Reply Wym_EBADF \fIsysf\fP not valid for the operation Wym_EMFILE too many open devices Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] ::dup(int).\"--------------------------------------------.PP.BI "WyByteFlow(const char* " "pathname" ",int " "f" ")" .PP.BI "WyByteFlow(const WyStr& " "pathname" ",int " "f" ")" .PP Construct object to handle the system file pointed by \fIpathname\fP with flags \fIf\fP. \fIf\fP= flags for ::open, except O_CREAT fh() = contains file descriptor from ::open(\fIpathname\fP,\fIf\fP) ftype()= file type of \fIpathname\fP.PP [\fBThrow\fP] Reply Wym_EACCES Search permission is denied Wym_EBADF File is not valid for the operation Wym_EINVAL \fIf\fP invalid 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.PP [\fBRefer\fP] ::open(const char*,int).\"--------------------------------------------.PP.BI "WyByteFlow(const WyByteFlow& " "bf" ")".PP Construct object to handle the device handled by \fIbf\fP fh() = contains file descriptor ::dup from \fIbf\fP ftype()= \fIbf\fP.ftype().PP [\fBThrow\fP] Reply Wym_EMFILE too many open devices Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] ::dup(int).\"--------------------------------------------.PP.BI "WyByteFlow(WyByteFlow& " "src" ", Wy::ByMove_t) throw()".PP Make the object \fIsrc\fP accessible at \fIthis\fP pointed address. After function completed, \fIsrc\fP is just regarded non-existant without destructor being called and can not be, and the space occupied can be recycled. The dummy argument type ByMove_t is for function signature, use instance should always be Wy::ByMove. This member is supposed to be invoked only via placement new an in member initialization list, not to be explicitly called. This member is not entirely a real constructor (no new object is ever created) but a function in constructor form to support object movement in a dynamic array. Note: Except in member initialization list, \fIsrc\fP must be a whole type, not reference to a base. Otherwise, effect is undefined. At final, object \fIsrc\fP does not exist.\"--------------------------------------------.PP.BI "virtual ~WyByteFlow()".PP Destruct *this.PP Note: errno from ::close(int) is ignored. Note: This member is non-cancellable..PP [\fBRefer\fP] ::close(int).\"--------------------------------------------.PP.BI "bool is_default(void) const throw()".PP Is *this equivalent to the default object.PP [\fBRet\fP] true= object is equivalent to WyByteFlow(). false= otherwise.\"--------------------------------------------.PP.BI "WyFileHandle fh(void) const throw()".PP Get the file handle of *this.PP [\fBRet\fP] file handle which contains the exact file descriptor of *this.\"--------------------------------------------.PP.BI "mode_t ftype(void) const throw()".PP Get file type of the system file *this is associated .PP [\fBRet\fP] File type of *this associated system file 0 Default object S_IFREG Regular file S_IFCHR Character device S_IFSOCK Socket S_IFIFO Fifo.\"--------------------------------------------.\.PP.\.BI "bool is_std_handler(void) const throw()".\.PP.\ Is *this a standard i/o handler.\.PP.\ [\fBRet\fP] true= *this is a standard i/o handler (i.e. Wy::cin, .\ Wy::cout or Wy::cerr).\ false= otherwise.\"--------------------------------------------.PP.BI "WyRet stat(WyFileStat& " "filestat" ") const" .PP Reset \fIfilestat\fP with the file information *this associates.PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for the operation Wym_ENOMEM Not enough memory ....PP [\fBRefer\fP] ::fstat(int,struct stat*).\"--------------------------------------------.PP.BI "virtual WyRet reset(void)" .PP Reconstruct *this to the state as WyByteFlow().PP [\fBRet\fP] Ok Succeed. Wym_EIO low level I/O error Wym_EINTR a signal had occurred ... reply converted from the errno ::close returned Note: Object is always default while returned..PP [\fBRefer\fP] ::close(int).\"--------------------------------------------.PP.BI "virtual WyRet reset(WyFileHandle " "h" ")" .PP Reconstruct *this to the state as WyByteFlow(\fIh\fP).PP [\fBRet\fP] Ok Succeed. Wym_EBADF \fIh\fP is not valid for the operation Wym_EMFILE Too many open fd (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 WySysFile& " "sysf" ")" .PP Reconstruct *this to the state as WyByteFlow(sysf).PP [\fBRet\fP] Ok Succeed. Wym_EBADF \fIsysf\fP not valid for the operation Wym_EMFILE too many open devices
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -