TQDataStream stream( &file ); // read the data serialized from the file
<ahref="ntqstring.html">TQString</a> str;
Q_INT32 a;
TQ_INT32 a;
stream >> str >> a; // extract "the answer is" and 42
</pre>
@ -161,8 +161,8 @@ number to give yourself room for future expansion. For example:
TQDataStream stream( &file );
// Write a header with a "magic number" and a version
stream << (Q_UINT32)0xA0B0C0D0;
stream << (Q_INT32)123;
stream << (TQ_UINT32)0xA0B0C0D0;
stream << (TQ_INT32)123;
// Write the data
stream << [lots of interesting data]
@ -175,13 +175,13 @@ number to give yourself room for future expansion. For example:
TQDataStream stream( &file );
// Read and check the header
Q_UINT32 magic;
TQ_UINT32 magic;
stream >> magic;
if ( magic != 0xA0B0C0D0 )
return XXX_BAD_FILE_FORMAT;
// Read the version
Q_INT32 version;
TQ_INT32 version;
stream >> version;
if ( version < 100 )
return XXX_BAD_FILE_TOO_OLD;
@ -212,11 +212,11 @@ written to the stream using <a href="#writeRawBytes">writeRawBytes</a>(). Notice
encoding/decoding of the data must be done by you.
<p> A similar pair of functions is <ahref="#readBytes">readBytes</a>() and <ahref="#writeBytes">writeBytes</a>(). These
differ from their <em>raw</em> counterparts as follows: readBytes()
reads a Q_UINT32 which is taken to be the length of the data to be
reads a TQ_UINT32 which is taken to be the length of the data to be
read, then that number of bytes is read into the preallocated
char*; writeBytes() writes a Q_UINT32 containing the length of the
char*; writeBytes() writes a TQ_UINT32 containing the length of the
data, followed by the data. Notice that any encoding/decoding of
the data (apart from the length Q_UINT32) must be done by you.
the data (apart from the length TQ_UINT32) must be done by you.
<p><p>See also <ahref="ntqtextstream.html">TQTextStream</a>, <ahref="ntqvariant.html">TQVariant</a>, and <ahref="io.html">Input/Output and Networking</a>.
<hr><h2>Member Type Documentation</h2>
@ -304,60 +304,60 @@ device is somewhere before the end position.
returns FALSE.
<p><p>See also <ahref="#setPrintableData">setPrintableData</a>().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Reads an unsigned integer of the system's word length from the
@ -470,7 +470,7 @@ the stream.
<p> The buffer <em>s</em> is allocated using <tt>new</tt>. Destroy it with the <tt>delete[]</tt> operator. If the length is zero or <em>s</em> cannot be
allocated, <em>s</em> is set to 0.
<p> The <em>l</em> parameter will be set to the length of the buffer.
<p> The serialization format is a Q_UINT32 length specifier first,
<p> The serialization format is a TQ_UINT32 length specifier first,
then <em>l</em> bytes of data. Note that the data is <em>not</em> encoded.
<p><p>See also <ahref="#readRawBytes">readRawBytes</a>() and <ahref="#writeBytes">writeBytes</a>().
@ -547,7 +547,7 @@ Unsets the IO device. This is the same as calling <a href="#setDevice">setDevice
</h3>
Writes the length specifier <em>len</em> and the buffer <em>s</em> to the
stream and returns a reference to the stream.
<p> The <em>len</em> is serialized as a Q_UINT32, followed by <em>len</em> bytes
<p> The <em>len</em> is serialized as a TQ_UINT32, followed by <em>len</em> bytes
from <em>s</em>. Note that the data is <em>not</em> encoded.
<p><p>See also <ahref="#writeRawBytes">writeRawBytes</a>() and <ahref="#readBytes">readBytes</a>().
Connects to the FTP server <em>host</em> using port <em>port</em>.
<p> The <ahref="#stateChanged">stateChanged</a>() signal is emitted when the state of the
@ -603,7 +603,7 @@ Reads all the bytes available from the data socket and returns
them.
<p><p>See also <ahref="#get">get</a>(), <ahref="#readyRead">readyRead</a>(), <ahref="#bytesAvailable">bytesAvailable</a>(), and <ahref="#readBlock">readBlock</a>().
Returns the number of bytes that can be read from the response
content at the moment.
@ -480,7 +480,7 @@ This is an overloaded member function, provided for convenience. It behaves esse
Reads all the bytes from the response content and returns them.
<p><p>See also <ahref="#get">get</a>(), <ahref="#post">post</a>(), <ahref="#request">request</a>(), <ahref="#readyRead">readyRead</a>(), <ahref="#bytesAvailable">bytesAvailable</a>(), and <ahref="#readBlock">readBlock</a>().
Reads <em>maxlen</em> bytes from the response content into <em>data</em> and
returns the number of bytes read. Returns -1 if an error occurred.
@ -550,7 +550,7 @@ the processing; otherwise <em>error</em> is FALSE.
is available. The header is passed in <em>resp</em>.
<p><p>See also <ahref="#get">get</a>(), <ahref="#post">post</a>(), <ahref="#head">head</a>(), <ahref="#request">request</a>(), and <ahref="#readyRead">readyRead</a>().
<p>Reimplemented in <ahref="ntqbuffer.html#writeBlock">TQBuffer</a>, <ahref="ntqsocket.html#writeBlock">TQSocket</a>, and <ahref="ntqsocketdevice.html#writeBlock">TQSocketDevice</a>.
<p><p>See also <ahref="ntqsocket.html">TQSocket</a>, <ahref="ntqsocketdevice.html">TQSocketDevice</a>, <ahref="ntqhostaddress.html">TQHostAddress</a>, <ahref="ntqsocketnotifier.html">TQSocketNotifier</a>, and <ahref="io.html">Input/Output and Networking</a>.
Returns the number of bytes that are waiting to be written, i.e.
the size of the output buffer.
@ -258,7 +258,7 @@ At this point, the <a href="#delayedCloseFinished">delayedCloseFinished</a>() si
<p>Examples: <ahref="clientserver-example.html#x796">network/clientserver/client/client.cpp</a>, <ahref="httpd-example.html#x728">network/httpd/httpd.cpp</a>, and <ahref="networkprotocol-example.html#x679">network/networkprotocol/nntp.cpp</a>.
<p>Reimplemented from <ahref="ntqiodevice.html#close">TQIODevice</a>.
Connects to the IP address and port specified by <em>addr</em> and <em>port</em>. Returns TRUE if it establishes a connection; otherwise returns FALSE.
If it returns FALSE, <ahref="#error">error</a>() explains why.
@ -262,7 +262,7 @@ sensible as soon as a sensible value is available.
<p> Note that for Datagram sockets, this is the source port of the
@ -156,7 +156,7 @@ QAxBase transparently converts between COM data types and the equivalent Qt data
.PP
Supported COM datatypes are listed in the first column of following table. The second column is the Qt type that can be used with the QObject property functions. The third column is the Qt type that is used in the prototype of generated signals and slots for in-parameters, and the last column is the Qt type that is used in the prototype of signals and slots for out-parameters. <center>.nf
.BI "Q_LONG \fBwriteBlock\fR ( const QByteArray & data )"
.BI "TQ_LONG \fBwriteBlock\fR ( const QByteArray & data )"
.br
.in -1c
.SH DESCRIPTION
@ -98,7 +98,7 @@ Does nothing (and returns FALSE) if isOpen() is TRUE.
Note that if you open the buffer in write mode (<a href="ntqfile.html#open">IO_WriteOnly</a> or IO_ReadWrite) and write something into the buffer, \fIbuf\fR is also modified because QByteArray is an explicitly shared class.
Writes \fIlen\fR bytes from \fIp\fR into the buffer at the current index position, overwriting any characters there and extending the buffer if necessary. Returns the number of bytes actually written.
.PP
Returns -1 if an error occurred.
@ -106,7 +106,7 @@ Returns -1 if an error occurred.
See also readBlock().
.PP
Reimplemented from QIODevice.
.SH "Q_LONG QBuffer::writeBlock ( const QByteArray & data )"
.SH "TQ_LONG QBuffer::writeBlock ( const QByteArray & data )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
@ -64,34 +64,34 @@ All the functions in this class are reentrant when Qt is built with thread suppo
.BI "void \fBsetVersion\fR ( int v )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_INT8 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_INT8 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_UINT8 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_UINT8 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_INT16 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_INT16 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_UINT16 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_UINT16 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_INT32 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_INT32 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_UINT32 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_UINT32 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_INT64 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_INT64 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_UINT64 & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_UINT64 & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_LONG & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_LONG & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( Q_ULONG & i )"
.BI "QDataStream & \fBoperator>>\fR ( TQ_ULONG & i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( float & f )"
@ -103,34 +103,34 @@ All the functions in this class are reentrant when Qt is built with thread suppo
.BI "QDataStream & \fBoperator>>\fR ( char *& s )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_INT8 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_INT8 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_UINT8 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_UINT8 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_INT16 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_INT16 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_UINT16 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_UINT16 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_INT32 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_INT32 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_UINT32 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_UINT32 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_INT64 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_INT64 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_UINT64 i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_UINT64 i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_LONG i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_LONG i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( Q_ULONG i )"
.BI "QDataStream & \fBoperator<<\fR ( TQ_ULONG i )"
.br
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( float f )"
@ -177,7 +177,7 @@ Example (write binary data to a stream):
.br
stream << "the answer is"; // serialize a string
.br
stream << (Q_INT32)42; // serialize an integer
stream << (TQ_INT32)42; // serialize an integer
.br
.fi
.PP
@ -193,7 +193,7 @@ Example (read binary data from a stream):
.br
QString str;
.br
Q_INT32 a;
TQ_INT32 a;
.br
stream >> str >> a; // extract "the answer is" and 42
.br
@ -224,9 +224,9 @@ If you are producing a new binary data format, such as a file format for documen
.br
// Write a header with a "magic number" and a version
.br
stream << (Q_UINT32)0xA0B0C0D0;
stream << (TQ_UINT32)0xA0B0C0D0;
.br
stream << (Q_INT32)123;
stream << (TQ_INT32)123;
.br
.br
// Write the data
@ -248,7 +248,7 @@ Then read it in with:
.br
// Read and check the header
.br
Q_UINT32 magic;
TQ_UINT32 magic;
.br
stream >> magic;
.br
@ -259,7 +259,7 @@ Then read it in with:
.br
// Read the version
.br
Q_INT32 version;
TQ_INT32 version;
.br
stream >> version;
.br
@ -292,7 +292,7 @@ You can select which byte order to use when serializing data. The default settin
.SH "Reading and writing raw binary data"
You may wish to read/write your own raw binary data to/from the data stream directly. Data may be read from the stream into a preallocated char* using readRawBytes(). Similarly data can be written to the stream using writeRawBytes(). Notice that any encoding/decoding of the data must be done by you.
.PP
A similar pair of functions is readBytes() and writeBytes(). These differ from their \fIraw\fR counterparts as follows: readBytes() reads a Q_UINT32 which is taken to be the length of the data to be read, then that number of bytes is read into the preallocated char*; writeBytes() writes a Q_UINT32 containing the length of the data, followed by the data. Notice that any encoding/decoding of the data (apart from the length Q_UINT32) must be done by you.
A similar pair of functions is readBytes() and writeBytes(). These differ from their \fIraw\fR counterparts as follows: readBytes() reads a TQ_UINT32 which is taken to be the length of the data to be read, then that number of bytes is read into the preallocated char*; writeBytes() writes a TQ_UINT32 containing the length of the data, followed by the data. Notice that any encoding/decoding of the data (apart from the length TQ_UINT32) must be done by you.
.PP
See also QTextStream, QVariant, and Input/Output and Networking.
.SS "Member Type Documentation"
@ -363,41 +363,41 @@ See also QIODevice::atEnd().
Returns TRUE if the printable data flag has been set; otherwise returns FALSE.
.PP
See also setPrintableData().
.SH "QDataStream & QDataStream::operator<< ( Q_INT8 i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_INT8 i )"
Writes a signed byte, \fIi\fR, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_UINT8 i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_UINT8 i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes an unsigned byte, \fIi\fR, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_INT16 i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_INT16 i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes a signed 16-bit integer, \fIi\fR, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_UINT16 i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_UINT16 i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes an unsigned 16-bit integer, \fIi\fR, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_INT32 i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_INT32 i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes a signed 32-bit integer, \fIi\fR, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_UINT32 i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_UINT32 i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes an unsigned integer, \fIi\fR, to the stream as a 32-bit unsigned integer (Q_UINT32). Returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_INT64 i )"
Writes an unsigned integer, \fIi\fR, to the stream as a 32-bit unsigned integer (TQ_UINT32). Returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( TQ_INT64 i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes a signed 64-bit integer, \fIi\fR, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_UINT64 i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_UINT64 i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes an unsigned 64-bit integer, \fIi\fR, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_LONG i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_LONG i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes a signed integer \fIi\fR, of the system's word length, to the stream and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator<< ( Q_ULONG i )"
.SH "QDataStream & QDataStream::operator<< ( TQ_ULONG i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Writes an unsigned integer \fIi\fR, of the system's word length, to the stream and returns a reference to the stream.
@ -415,41 +415,41 @@ This is an overloaded member function, provided for convenience. It behaves esse
Writes the '\0'-terminated string \fIs\fR to the stream and returns a reference to the stream.
.PP
The string is serialized using writeBytes().
.SH "QDataStream & QDataStream::operator>> ( Q_INT8 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_INT8 & i )"
Reads a signed byte from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_UINT8 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_UINT8 & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads an unsigned byte from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_INT16 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_INT16 & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads a signed 16-bit integer from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_UINT16 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_UINT16 & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads an unsigned 16-bit integer from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_INT32 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_INT32 & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads a signed 32-bit integer from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_UINT32 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_UINT32 & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads an unsigned 32-bit integer from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_INT64 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_INT64 & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads a signed 64-bit integer from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_UINT64 & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_UINT64 & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads an unsigned 64-bit integer from the stream, into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_LONG & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_LONG & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads a signed integer of the system's word length from the stream into \fIi\fR, and returns a reference to the stream.
.SH "QDataStream & QDataStream::operator>> ( Q_ULONG & i )"
.SH "QDataStream & QDataStream::operator>> ( TQ_ULONG & i )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Reads an unsigned integer of the system's word length from the stream, into \fIi\fR, and returns a reference to the stream.
@ -474,7 +474,7 @@ The buffer \fIs\fR is allocated using \fCnew\fR. Destroy it with the \fCdelete[]
.PP
The \fIl\fR parameter will be set to the length of the buffer.
.PP
The serialization format is a Q_UINT32 length specifier first, then \fIl\fR bytes of data. Note that the data is \fInot\fR encoded.
The serialization format is a TQ_UINT32 length specifier first, then \fIl\fR bytes of data. Note that the data is \fInot\fR encoded.
Reads bytes from the file into the char* \fIp\fR, until end-of-line or \fImaxlen\fR bytes have been read, whichever occurs first. Returns the number of bytes read, or -1 if there was an error. Any terminating newline is not stripped.
@ -417,7 +417,7 @@ This function is only efficient for buffered files. Avoid readLine() for files t
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Set the IPv6 address specified by \fIip6Addr\fR.
@ -126,7 +126,7 @@ Set the IPv6 address specified by \fIip6Addr\fR.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the IPv4 or IPv6 address specified by the string representation \fIaddress\fR (e.g. "127.0.0.1"). Returns TRUE and sets the address if the address was successfully parsed; otherwise returns FALSE and leaves the address unchanged.
Constructs a QHttp object. Subsequent requests are done by connecting to the server \fIhostname\fR on port \fIport\fR. The parameters \fIparent\fR and \fIname\fR are passed on to the QObject constructor.
.PP
See also setHost().
@ -331,7 +331,7 @@ For the current request, the requestFinished() signal with the \fCerror\fR argum
Since this slot also deletes the scheduled requests, there are no requests left and the done() signal is emitted (with the \fCerror\fR argument \fCTRUE\fR).
.PP
See also clearPendingRequests().
.SH "Q_ULONG QHttp::bytesAvailable () const"
.SH "TQ_ULONG QHttp::bytesAvailable () const"
Returns the number of bytes that can be read from the response content at the moment.
.PP
See also get(), post(), request(), readyRead(), readBlock(), and readAll().
@ -451,7 +451,7 @@ This is an overloaded member function, provided for convenience. It behaves esse
Reads all the bytes from the response content and returns them.
.PP
See also get(), post(), request(), readyRead(), bytesAvailable(), and readBlock().
Sets the HTTP server that is used for requests to \fIhostname\fR on port \fIport\fR.
.PP
The function does not block and returns immediately. The request is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by requestStarted() and requestFinished().
Reads a line of text, (or up to \fImaxlen\fR bytes if a newline isn't encountered) plus a terminating '\0' into \fIdata\fR. If there is a newline at the end if the line, it is not stripped.
.PP
Returns the number of bytes read including the terminating '\0', or -1 if an error occurred.
@ -507,7 +507,7 @@ This virtual function must be reimplemented by all subclasses.
Creates a server socket object, that will serve the given \fIport\fR on all the addresses of this host. If \fIport\fR is 0, QServerSocket will pick a suitable port in a system-dependent manner. Use \fIbacklog\fR to specify how many pending connections the server can have.
.PP
The \fIparent\fR and \fIname\fR arguments are passed on to the QObject constructor.
.PP
\fBWarning:\fR On Tru64 Unix systems a value of 0 for \fIbacklog\fR means that you don't accept any connections at all; you should specify a value larger than 0.
Creates a server socket object, that will serve the given \fIport\fR only on the given \fIaddress\fR. Use \fIbacklog\fR to specify how many pending connections the server can have.
.PP
The \fIparent\fR and \fIname\fR arguments are passed on to the QObject constructor.
@ -97,7 +97,7 @@ See also port() and QSocketDevice::address().
This pure virtual function is responsible for setting up a new incoming connection. \fIsocket\fR is the fd (file descriptor) for the newly accepted connection.
.SH "bool QServerSocket::ok () const"
Returns TRUE if the construction succeeded; otherwise returns FALSE.
.SH "Q_UINT16 QServerSocket::port () const"
.SH "TQ_UINT16 QServerSocket::port () const"
Returns the port number on which this server socket listens. This is always non-zero; if you specify 0 in the constructor, QServerSocket will pick a non-zero port itself. ok() must be TRUE before calling this function.
Attempts to make a connection to \fIhost\fR on the specified \fIport\fR and return immediately.
.PP
Any connection or pending connection is closed immediately, and QSocket goes into the HostLookup state. When the lookup succeeds, it emits hostFound(), starts a TCP connection and goes into the Connecting state. Finally, when the connection succeeds, it emits connected() and goes into the Connected state. If there is an error at any point, it emits error().
@ -341,11 +341,11 @@ Returns the address of the connected peer if the socket is in Connected state; o
Returns the host name as specified to the connectToHost() function. An empty string is returned if none has been set.
.PP
Example: network/mail/smtp.cpp.
.SH "Q_UINT16 QSocket::peerPort () const"
.SH "TQ_UINT16 QSocket::peerPort () const"
Returns the peer's host port number, normally as specified to the connectToHost() function. If none has been set, this function returns 0.
.PP
Note that Qt always uses native byte order, i.e. 67 is 67 in Qt; there is no need to call htons().
.SH "Q_UINT16 QSocket::port () const"
.SH "TQ_UINT16 QSocket::port () const"
Returns the host port number of this socket, in native byte order.
.SH "int QSocket::putch ( int ch )\fC [virtual]\fR"
Writes the character \fIch\fR to the output buffer.
@ -355,13 +355,13 @@ Returns \fIch\fR, or -1 if an error occurred.
Sets the size of the QSocket's internal read buffer to \fIbufSize\fR.
.PP
Usually QSocket reads all data that is available from the operating system's socket. If the buffer size is limited to a certain size, this means that the QSocket class doesn't buffer more than this size of data.
@ -424,7 +424,7 @@ Examples:
This implementation of the virtual function QIODevice::ungetch() prepends the character \fIch\fR to the read buffer so that the next read returns this character as the first character of the output.
Assigns a name to an unnamed socket. The name is the host address \fIaddress\fR and the port number \fIport\fR. If the operation succeeds, bind() returns TRUE; otherwise it returns FALSE without changing what port() and address() return.
.PP
bind() is used by servers for setting up incoming connections. Call bind() before listen().
@ -229,11 +229,11 @@ Note that this function does not set error().
\fBWarning:\fR On Windows, this function always returns TRUE since the ioctlsocket() function is broken.
Returns the number of bytes available for reading, or -1 if an error occurred.
.PP
\fBWarning:\fR On Microsoft Windows, we use the ioctlsocket() function to determine the number of bytes queued on the socket. According to Microsoft (KB Q125486), ioctlsocket() sometimes returns an incorrect number. The only safe way to determine the amount of data on the socket is to read it using readBlock(). QSocket has workarounds to deal with this problem.
Connects to the IP address and port specified by \fIaddr\fR and \fIport\fR. Returns TRUE if it establishes a connection; otherwise returns FALSE. If it returns FALSE, error() explains why.
.PP
Note that error() commonly returns NoError for non-blocking sockets; this just means that you can call connect() again in a little while and it'll probably succeed.
@ -253,11 +253,11 @@ See also bind() and accept().
Returns the address of the port this socket device is connected to. This may be 0.0.0.0 for a while, but is set to something sensible as soon as a sensible value is available.
.PP
Note that for Datagram sockets, this is the source port of the last packet received.
.SH "Q_UINT16 QSocketDevice::peerPort () const"
.SH "TQ_UINT16 QSocketDevice::peerPort () const"
Returns the port number of the port this socket device is connected to. This may be 0 for a while, but is set to something sensible as soon as a sensible value is available.
.PP
Note that for Datagram sockets, this is the source port of the last packet received, and that it is in native byte order.
.SH "Q_UINT16 QSocketDevice::port () const"
.SH "TQ_UINT16 QSocketDevice::port () const"
Returns the port number of this socket device. This may be 0 for a while, but is set to something sensible as soon as a sensible value is available.
.PP
Note that Qt always uses native byte order, i.e. 67 is 67 in Qt; there is no need to call htons().
@ -267,7 +267,7 @@ Returns the socket's protocol family, which is one of Unknown, IPv4, or IPv6.
QSocketDevice either creates a socket with a well known protocol family or it uses an already existing socket. In the first case, this function returns the protocol family it was constructed with. In the second case, it tries to determine the protocol family of the socket; if this fails, it returns Unknown.
Reads \fImaxlen\fR bytes from the socket into \fIdata\fR and returns the number of bytes read. Returns -1 if an error occurred. Returning 0 is not an error. For Stream sockets, 0 is returned when the remote host closes the connection. For Datagram sockets, 0 is a valid datagram size.
.PP
Reimplemented from QIODevice.
@ -323,7 +323,7 @@ See also isValid() and type().
Returns the socket type which is either QSocketDevice::Stream or QSocketDevice::Datagram.
@ -82,10 +82,10 @@ All the functions in this class are reentrant when Qt is built with thread suppo
.BI "QString \fBarg\fR ( ulong a, int fieldWidth = 0, int base = 10 ) const"
.br
.ti -1c
.BI "QString \fBarg\fR ( Q_LLONG a, int fieldWidth = 0, int base = 10 ) const"
.BI "QString \fBarg\fR ( TQ_LLONG a, int fieldWidth = 0, int base = 10 ) const"
.br
.ti -1c
.BI "QString \fBarg\fR ( Q_ULLONG a, int fieldWidth = 0, int base = 10 ) const"
.BI "QString \fBarg\fR ( TQ_ULLONG a, int fieldWidth = 0, int base = 10 ) const"
.br
.ti -1c
.BI "QString \fBarg\fR ( int a, int fieldWidth = 0, int base = 10 ) const"
@ -331,10 +331,10 @@ All the functions in this class are reentrant when Qt is built with thread suppo
.BI "ulong \fBtoULong\fR ( bool * ok = 0, int base = 10 ) const"
.br
.ti -1c
.BI "Q_LLONG \fBtoLongLong\fR ( bool * ok = 0, int base = 10 ) const"
.BI "TQ_LLONG \fBtoLongLong\fR ( bool * ok = 0, int base = 10 ) const"
.br
.ti -1c
.BI "Q_ULLONG \fBtoULongLong\fR ( bool * ok = 0, int base = 10 ) const"
.BI "TQ_ULLONG \fBtoULongLong\fR ( bool * ok = 0, int base = 10 ) const"
.br
.ti -1c
.BI "float \fBtoFloat\fR ( bool * ok = 0 ) const"
@ -361,10 +361,10 @@ All the functions in this class are reentrant when Qt is built with thread suppo
.BI "QString & \fBsetNum\fR ( ulong n, int base = 10 )"
.br
.ti -1c
.BI "QString & \fBsetNum\fR ( Q_LLONG n, int base = 10 )"
.BI "QString & \fBsetNum\fR ( TQ_LLONG n, int base = 10 )"
.br
.ti -1c
.BI "QString & \fBsetNum\fR ( Q_ULLONG n, int base = 10 )"
.BI "QString & \fBsetNum\fR ( TQ_ULLONG n, int base = 10 )"
.br
.ti -1c
.BI "QString & \fBsetNum\fR ( float n, char f = 'g', int prec = 6 )"
@ -490,10 +490,10 @@ All the functions in this class are reentrant when Qt is built with thread suppo
.BI "QString \fBnumber\fR ( ulong n, int base = 10 )"
.br
.ti -1c
.BI "QString \fBnumber\fR ( Q_LLONG n, int base = 10 )"
.BI "QString \fBnumber\fR ( TQ_LLONG n, int base = 10 )"
.br
.ti -1c
.BI "QString \fBnumber\fR ( Q_ULLONG n, int base = 10 )"
.BI "QString \fBnumber\fR ( TQ_ULLONG n, int base = 10 )"
.br
.ti -1c
.BI "QString \fBnumber\fR ( int n, int base = 10 )"
@ -810,11 +810,11 @@ The '%' can be followed by an 'L', in which case the sequence is replaced with a
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
\fIa\fR is expressed in base \fIbase\fR, which is 10 by default and must be between 2 and 36. If \fIbase\fR is 10, the '%L' syntax can be used to produce localized strings.
.SH "QString QString::arg ( Q_LLONG a, int fieldWidth = 0, int base = 10 ) const"
.SH "QString QString::arg ( TQ_LLONG a, int fieldWidth = 0, int base = 10 ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
\fIa\fR is expressed in base \fIbase\fR, which is 10 by default and must be between 2 and 36. If \fIbase\fR is 10, the '%L' syntax can be used to produce localized strings.
.SH "QString QString::arg ( Q_ULLONG a, int fieldWidth = 0, int base = 10 ) const"
.SH "QString QString::arg ( TQ_ULLONG a, int fieldWidth = 0, int base = 10 ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
\fIa\fR is expressed in base \fIbase\fR, which is 10 by default and must be between 2 and 36. If \fIbase\fR is 10, the '%L' syntax can be used to produce localized strings.
@ -1410,11 +1410,11 @@ Examples:
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
See also setNum().
.SH "QString QString::number ( Q_LLONG n, int base = 10 )\fC [static]\fR"
.SH "QString QString::number ( TQ_LLONG n, int base = 10 )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
See also setNum().
.SH "QString QString::number ( Q_ULLONG n, int base = 10 )\fC [static]\fR"
.SH "QString QString::number ( TQ_ULLONG n, int base = 10 )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
See also setNum().
@ -1971,7 +1971,7 @@ See also isNull() and isEmpty().
Ensures that at least \fInewLen\fR characters are allocated to the string, and sets the length of the string to \fInewLen\fR. Any new space allocated contains arbitrary data.
.PP
See also reserve() and truncate().
.SH "QString & QString::setNum ( Q_LLONG n, int base = 10 )"
.SH "QString & QString::setNum ( TQ_LLONG n, int base = 10 )"
Sets the string to the printed value of \fIn\fR in base \fIbase\fR and returns a reference to the string. The returned string is in "C" locale.
.PP
The base is 10 by default and must be between 2 and 36.
@ -2011,7 +2011,7 @@ The base is 10 by default and must be between 2 and 36.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.SH "QString & QString::setNum ( ulong n, int base = 10 )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.SH "QString & QString::setNum ( Q_ULLONG n, int base = 10 )"
.SH "QString & QString::setNum ( TQ_ULLONG n, int base = 10 )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the string to the printed value of \fIn\fR in base \fIbase\fR and returns a reference to the string.
@ -2246,7 +2246,7 @@ Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
.PP
See also number().
.SH "Q_LLONG QString::toLongLong ( bool * ok = 0, int base = 10 ) const"
.SH "TQ_LLONG QString::toLongLong ( bool * ok = 0, int base = 10 ) const"
Returns the string converted to a \fClong long\fR using base \fIbase\fR, which is 10 by default and must be between 2 and 36 or 0. If \fIbase\fR is 0, the base is determined automatically using the following rules:
.TP
If the string begins with "0x", it is assumed to be hexadecimal;
@ -2318,7 +2318,7 @@ Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
.PP
See also number().
.SH "Q_ULLONG QString::toULongLong ( bool * ok = 0, int base = 10 ) const"
.SH "TQ_ULLONG QString::toULongLong ( bool * ok = 0, int base = 10 ) const"
Returns the string converted to an \fCunsigned long long\fR using base \fIbase\fR, which is 10 by default and must be between 2 and 36 or 0. If \fIbase\fR is 0, the base is determined automatically using the following rules:
.TP
If the string begins with "0x", it is assumed to be hexadecimal;
Returns the variant's value as variant map reference.
@ -854,7 +854,7 @@ Returns a reference to the stored time.
See also toTime().
.SH "uint & QVariant::asUInt ()"
Returns the variant's value as unsigned int reference.
.SH "Q_ULLONG & QVariant::asULongLong ()"
.SH "TQ_ULLONG & QVariant::asULongLong ()"
Returns the variant's value as unsigned long long reference.
.SH "bool QVariant::canCast ( Type t ) const"
Returns TRUE if the variant's type can be cast to the requested type, \fIt\fR. Such casting is done automatically when calling the toInt(), toBool(), ... or asInt(), asBool(), ... methods.
@ -1015,7 +1015,7 @@ Note that if you want to iterate over the list, you should iterate over a copy,