⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qiodevice.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
📖 第 1 页 / 共 2 页
字号:
Reimplemented in QSocketDevice, QBuffer, QSocket and QFile..SH "int QIODevice::at () const \fC[virtual]\fR"Virtual function that returns the current I/O device index..PPThis index is the data read/write head of the I/O device..PPSee also size()..PPReimplemented in QFile, QBuffer, QSocket and QSocketDevice..SH "bool QIODevice::atEnd () const \fC[virtual]\fR"Virtual function that returns TRUE if the I/O device index is at the end of the input..PPReimplemented in QSocket, QFile and QSocketDevice..SH "void QIODevice::close () \fC[virtual]\fR"Closes the I/O device..PPThis virtual function must be reimplemented by all subclasses..PPSee also open()..PPReimplemented in QSocket, QBuffer, QFile and QSocketDevice..SH "int QIODevice::flags () const"Returns the current I/O device flags setting..PPFlags consists of mode flags and state flags..PPSee also mode() and state()..SH "void QIODevice::flush () \fC[virtual]\fR"Flushes an open I/O device..PPThis virtual function must be reimplemented by all subclasses..PPReimplemented in QBuffer, QFile, QSocket and QSocketDevice..SH "int QIODevice::getch () \fC[virtual]\fR"Reads a single byte/character from the I/O device..PPReturns the byte/character read, or -1 if the end of the I/O device has been reached..PPThis virtual function must be reimplemented by all subclasses..PPSee also putch() and ungetch()..PPReimplemented in QBuffer, QFile, QSocket and QSocketDevice..SH "bool QIODevice::isAsynchronous () const"Returns TRUE if the I/O device is a asynchronous device, otherwise FALSE..PPThis mode is currently not in use..PPSee also isSynchronous()..SH "bool QIODevice::isBuffered () const"Returns TRUE if the I/O device is a buffered (not raw) device, otherwise FALSE..PPSee also isRaw()..SH "bool QIODevice::isCombinedAccess () const"Returns TRUE if the I/O device is a combined access (both direct and sequential) device, otherwise FALSE..PPThis access method is currently not in use..SH "bool QIODevice::isDirectAccess () const"Returns TRUE if the I/O device is a direct access (not sequential) device, otherwise FALSE..PPSee also isSequentialAccess()..SH "bool QIODevice::isInactive () const"Returns TRUE if the I/O device state is 0, i.e. the device is not open..PPSee also isOpen()..SH "bool QIODevice::isOpen () const"Returns TRUE if the I/O device state has been opened, otherwise FALSE..PPSee also isInactive()..SH "bool QIODevice::isRaw () const"Returns TRUE if the I/O device is a raw (not buffered) device, otherwise FALSE..PPSee also isBuffered()..SH "bool QIODevice::isReadWrite () const"Returns TRUE if the I/O device was opened using \fCIO_ReadWrite\fR mode..PPSee also isReadable() and isWritable()..SH "bool QIODevice::isReadable () const"Returns TRUE if the I/O device was opened using \fCIO_ReadOnly\fR or \fCIO_ReadWrite\fR mode..PPSee also isWritable() and isReadWrite()..SH "bool QIODevice::isSequentialAccess () const"Returns TRUE if the I/O device is a sequential access (not direct) device, otherwise FALSE. Operations involving size() and at(int) are not valid on sequential devices..PPSee also isDirectAccess()..SH "bool QIODevice::isSynchronous () const"Returns TRUE if the I/O device is a synchronous device, otherwise FALSE..PPSee also isAsynchronous()..SH "bool QIODevice::isTranslated () const"Returns TRUE if the I/O device translates carriage-return and linefeed characters..PPA QFile is translated if it is opened with the \fCIO_Translate\fR mode flag..SH "bool QIODevice::isWritable () const"Returns TRUE if the I/O device was opened using \fCIO_WriteOnly\fR or \fCIO_ReadWrite\fR mode..PPSee also isReadable() and isReadWrite()..SH "int QIODevice::mode () const"Returns bits OR'ed together that specify the current operation mode..PPThese are the flags that were given to the open() function..PPThe flags are: \fCIO_ReadOnly, IO_WriteOnly, IO_ReadWrite, IO_Append, IO_Truncate\fR and \fCIO_Translate.\fR.SH "bool QIODevice::open ( int mode ) \fC[virtual]\fR"Opens the I/O device using the specified \fImode.\fR Returns TRUE if successful, or FALSE if the device could not be opened..PPThe mode parameter \fIm\fR must be a combination of the following flags..TP\fCIO_Raw\fR specified raw (unbuffered) file access..TP\fCIO_ReadOnly\fR opens a file in read-only mode..TP\fCIO_WriteOnly\fR opens a file in write-only mode..TP\fCIO_ReadWrite\fR opens a file in read/write mode..TP\fCIO_Append\fR sets the file index to the end of the file..TP\fCIO_Truncate\fR truncates the file..TP\fCIO_Translate\fR enables carriage returns and linefeed translation for text files under MS-DOS, Window, OS/2 and Macintosh. On Unix systems this flag has no effect. Use with caution as it will also transform every linefeed written to the file into a CRLF pair. This is likely to corrupt your file when writing binary data to it. Cannot be combined with \fCIO_Raw.\fR.PPThis virtual function must be reimplemented by all subclasses..PPSee also close()..PPReimplemented in QFile, QSocketDevice, QSocket and QBuffer..SH "int QIODevice::putch ( int ch ) \fC[virtual]\fR"Writes the character \fIch\fR to the I/O device..PPReturns \fIch,\fR or -1 if some error occurred..PPThis virtual function must be reimplemented by all subclasses..PPSee also getch() and ungetch()..PPReimplemented in QSocketDevice, QFile, QBuffer and QSocket..SH "QByteArray QIODevice::readAll ()"This convenience function returns all of the remaining data in the device. Note that this only works for direct access devices, such as QFile..PPSee also isDirectAccess()..SH "int QIODevice::readBlock ( char * data, uint maxlen ) \fC[virtual]\fR"Reads at most \fImaxlen\fR bytes from the I/O device into \fIdata\fR and returns the number of bytes actually read..PPThis virtual function must be reimplemented by all subclasses..PPSee also writeBlock()..PPReimplemented in QBuffer, QSocket, QSocketDevice and QFile..SH "int QIODevice::readLine ( char * data, uint maxlen ) \fC[virtual]\fR"Reads a line of text, up to \fImaxlen\fR bytes including a terminating \\0. If there is a newline at the end if the line, it is not stripped..PPReturns the number of bytes read including the terminating \\0, or -1 in case of error..PPThis virtual function can be reimplemented much more efficiently by the most subclasses..PPSee also readBlock() and QTextStream::readLine()..PPReimplemented in QBuffer, QFile and QSocket..SH "bool QIODevice::reset ()"Sets the device index to 0..PPSee also at()..SH "void QIODevice::resetStatus ()"Sets the I/O device status to \fCIO_Ok.\fR.PPSee also status()..SH "uint QIODevice::size () const \fC[virtual]\fR"Virtual function that returns the size of the I/O device..PPSee also at()..PPReimplemented in QFile, QBuffer, QSocket and QSocketDevice..SH "int QIODevice::state () const"Returns bits OR'ed together that specify the current state..PPThe flags are: \fCIO_Open.\fR.PPSubclasses may define more flags..SH "int QIODevice::status () const"Returns the I/O device status..PPThe I/O device status returns an error code. If open() returns FALSE or readBlock() or writeBlock() return -1, this function can be called to get the reason why the operation did not succeed..PPThe status codes are:.TP\fCIO_Ok\fR The operation was successful..TP\fCIO_ReadError\fR Could not read from the device..TP\fCIO_WriteError\fR Could not write to the device..TP\fCIO_FatalError\fR A fatal unrecoverable error occurred..TP\fCIO_OpenError\fR Could not open the device..TP\fCIO_ConnectError\fR Could not connect to the device..TP\fCIO_AbortError\fR The operation was unexpectedly aborted..TP\fCIO_TimeOutError\fR The operation timed out..TP\fCIO_UnspecifiedError\fR An unspecified error happened on close..PPSee also resetStatus()..SH "int QIODevice::ungetch ( int ch ) \fC[virtual]\fR"Puts the character \fIch\fR back into the I/O device and decrements the index if it is not zero..PPThis function is normally called to "undo" a getch() operation..PPReturns \fIch,\fR or -1 if some error occurred..PPThis virtual function must be reimplemented by all subclasses..PPSee also getch() and putch()..PPReimplemented in QSocket, QBuffer, QSocketDevice and QFile..SH "int QIODevice::writeBlock ( const QByteArray & data )"This convenience function is the same as calling writeBlock( data.data(), data.size() )..SH "int QIODevice::writeBlock ( const char * data, uint len ) \fC[virtual]\fR"Writes \fIlen\fR bytes from \fIp\fR to the I/O device and returns the number of bytes actually written..PPThis virtual function must be reimplemented by all subclasses..PPSee also readBlock()..PPReimplemented in QSocketDevice, QBuffer, QFile and QSocket..SH "void QIODevice::setFlags ( int f ) \fC[protected]\fR"For internal use only..SH "void QIODevice::setMode ( int m ) \fC[protected]\fR"For internal use only..SH "void QIODevice::setState ( int s ) \fC[protected]\fR"For internal use only..SH "void QIODevice::setStatus ( int s ) \fC[protected]\fR"For internal use only..SH "void QIODevice::setType ( int t ) \fC[protected]\fR"For internal use only..SH "SEE ALSO".BR http://doc.trolltech.com/qiodevice.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qiodevice.3qt) and the Qtversion (2.3.10).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -