[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qnetworkprotocol.cpp:974 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QNetworkOperation Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QNetworkOperation Class Reference<br><small>[<a href="network.html">network module</a>]</small></h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QNetworkOperation class provides common operations for network protocols.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qnetworkprotocol-h.html">qnetworkprotocol.h</a>></tt>
|
---|
| 37 | <p>Inherits <a href="qobject.html">QObject</a>.
|
---|
| 38 | <p><a href="qnetworkoperation-members.html">List of all member functions.</a>
|
---|
| 39 | <h2>Public Members</h2>
|
---|
| 40 | <ul>
|
---|
| 41 | <li class=fn><a href="#QNetworkOperation"><b>QNetworkOperation</b></a> ( QNetworkProtocol::Operation operation, const QString & arg0, const QString & arg1, const QString & arg2 )</li>
|
---|
| 42 | <li class=fn><a href="#QNetworkOperation-2"><b>QNetworkOperation</b></a> ( QNetworkProtocol::Operation operation, const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 )</li>
|
---|
| 43 | <li class=fn><a href="#~QNetworkOperation"><b>~QNetworkOperation</b></a> ()</li>
|
---|
| 44 | <li class=fn>void <a href="#setState"><b>setState</b></a> ( QNetworkProtocol::State state )</li>
|
---|
| 45 | <li class=fn>void <a href="#setProtocolDetail"><b>setProtocolDetail</b></a> ( const QString & detail )</li>
|
---|
| 46 | <li class=fn>void <a href="#setErrorCode"><b>setErrorCode</b></a> ( int ec )</li>
|
---|
| 47 | <li class=fn>void <a href="#setArg"><b>setArg</b></a> ( int num, const QString & arg )</li>
|
---|
| 48 | <li class=fn>void <a href="#setRawArg"><b>setRawArg</b></a> ( int num, const QByteArray & arg )</li>
|
---|
| 49 | <li class=fn>QNetworkProtocol::Operation <a href="#operation"><b>operation</b></a> () const</li>
|
---|
| 50 | <li class=fn>QNetworkProtocol::State <a href="#state"><b>state</b></a> () const</li>
|
---|
| 51 | <li class=fn>QString <a href="#arg"><b>arg</b></a> ( int num ) const</li>
|
---|
| 52 | <li class=fn>QByteArray <a href="#rawArg"><b>rawArg</b></a> ( int num ) const</li>
|
---|
| 53 | <li class=fn>QString <a href="#protocolDetail"><b>protocolDetail</b></a> () const</li>
|
---|
| 54 | <li class=fn>int <a href="#errorCode"><b>errorCode</b></a> () const</li>
|
---|
| 55 | <li class=fn>void <a href="#free"><b>free</b></a> ()</li>
|
---|
| 56 | </ul>
|
---|
| 57 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 58 |
|
---|
| 59 |
|
---|
| 60 | <p> The QNetworkOperation class provides common operations for network protocols.
|
---|
| 61 |
|
---|
| 62 | <p>
|
---|
| 63 |
|
---|
| 64 | <p> An object is created to describe the operation and the current
|
---|
| 65 | state for each operation that a network protocol should process.
|
---|
| 66 | <p> For a detailed description of the Qt Network Architecture and how
|
---|
| 67 | to implement and use network protocols in Qt, see the <a href="network.html">Qt Network Documentation</a>.
|
---|
| 68 | <p> <p>See also <a href="qnetworkprotocol.html">QNetworkProtocol</a> and <a href="io.html">Input/Output and Networking</a>.
|
---|
| 69 |
|
---|
| 70 | <hr><h2>Member Function Documentation</h2>
|
---|
| 71 | <h3 class=fn><a name="QNetworkOperation"></a>QNetworkOperation::QNetworkOperation ( <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> operation, const <a href="qstring.html">QString</a> & arg0, const <a href="qstring.html">QString</a> & arg1, const <a href="qstring.html">QString</a> & arg2 )
|
---|
| 72 | </h3>
|
---|
| 73 | Constructs a network operation object. <em>operation</em> is the type of
|
---|
| 74 | the operation, and <em>arg0</em>, <em>arg1</em> and <em>arg2</em> are the first
|
---|
| 75 | three arguments of the operation. The state is initialized to
|
---|
| 76 | QNetworkProtocol::StWaiting.
|
---|
| 77 | <p> <p>See also <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> and <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a>.
|
---|
| 78 |
|
---|
| 79 | <h3 class=fn><a name="QNetworkOperation-2"></a>QNetworkOperation::QNetworkOperation ( <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> operation, const <a href="qbytearray.html">QByteArray</a> & arg0, const <a href="qbytearray.html">QByteArray</a> & arg1, const <a href="qbytearray.html">QByteArray</a> & arg2 )
|
---|
| 80 | </h3>
|
---|
| 81 | Constructs a network operation object. <em>operation</em> is the type of
|
---|
| 82 | the operation, and <em>arg0</em>, <em>arg1</em> and <em>arg2</em> are the first
|
---|
| 83 | three raw data arguments of the operation. The state is
|
---|
| 84 | initialized to QNetworkProtocol::StWaiting.
|
---|
| 85 | <p> <p>See also <a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> and <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a>.
|
---|
| 86 |
|
---|
| 87 | <h3 class=fn><a name="~QNetworkOperation"></a>QNetworkOperation::~QNetworkOperation ()
|
---|
| 88 | </h3>
|
---|
| 89 | Destructor.
|
---|
| 90 |
|
---|
| 91 | <h3 class=fn><a href="qstring.html">QString</a> <a name="arg"></a>QNetworkOperation::arg ( int num ) const
|
---|
| 92 | </h3>
|
---|
| 93 | Returns the operation's <em>num</em>-th argument. If this argument was
|
---|
| 94 | not already set, an empty string is returned.
|
---|
| 95 |
|
---|
| 96 | <p>Example: <a href="networkprotocol-example.html#x672">network/networkprotocol/nntp.cpp</a>.
|
---|
| 97 | <h3 class=fn>int <a name="errorCode"></a>QNetworkOperation::errorCode () const
|
---|
| 98 | </h3>
|
---|
| 99 | Returns the error code for the last error that occurred.
|
---|
| 100 |
|
---|
| 101 | <h3 class=fn>void <a name="free"></a>QNetworkOperation::free ()
|
---|
| 102 | </h3>
|
---|
| 103 | Sets this object to delete itself when it hasn't been used for one
|
---|
| 104 | second.
|
---|
| 105 | <p> Because QNetworkOperation pointers are passed around a lot the
|
---|
| 106 | <a href="qnetworkprotocol.html">QNetworkProtocol</a> generally does not have enough knowledge to
|
---|
| 107 | delete these at the correct time. If a QNetworkProtocol doesn't
|
---|
| 108 | need an operation any more it will call this function instead.
|
---|
| 109 | <p> Note: you should never need to call the method yourself.
|
---|
| 110 |
|
---|
| 111 | <h3 class=fn><a href="qnetworkprotocol.html#Operation-enum">QNetworkProtocol::Operation</a> <a name="operation"></a>QNetworkOperation::operation () const
|
---|
| 112 | </h3>
|
---|
| 113 | Returns the type of the operation.
|
---|
| 114 |
|
---|
| 115 | <h3 class=fn><a href="qstring.html">QString</a> <a name="protocolDetail"></a>QNetworkOperation::protocolDetail () const
|
---|
| 116 | </h3>
|
---|
| 117 | Returns a detailed error message for the last error. This must
|
---|
| 118 | have been set using <a href="#setProtocolDetail">setProtocolDetail</a>().
|
---|
| 119 |
|
---|
| 120 | <h3 class=fn><a href="qbytearray.html">QByteArray</a> <a name="rawArg"></a>QNetworkOperation::rawArg ( int num ) const
|
---|
| 121 | </h3>
|
---|
| 122 | Returns the operation's <em>num</em>-th raw data argument. If this
|
---|
| 123 | argument was not already set, an empty bytearray is returned.
|
---|
| 124 |
|
---|
| 125 | <h3 class=fn>void <a name="setArg"></a>QNetworkOperation::setArg ( int num, const <a href="qstring.html">QString</a> & arg )
|
---|
| 126 | </h3>
|
---|
| 127 | Sets the network operation's <em>num</em>-th argument to <em>arg</em>.
|
---|
| 128 |
|
---|
| 129 | <h3 class=fn>void <a name="setErrorCode"></a>QNetworkOperation::setErrorCode ( int ec )
|
---|
| 130 | </h3>
|
---|
| 131 | Sets the error code to <em>ec</em>.
|
---|
| 132 | <p> If the operation failed, the protocol should set an error code to
|
---|
| 133 | describe the error in more detail. If possible, one of the error
|
---|
| 134 | codes defined in <a href="qnetworkprotocol.html">QNetworkProtocol</a> should be used.
|
---|
| 135 | <p> <p>See also <a href="#setProtocolDetail">setProtocolDetail</a>() and <a href="qnetworkprotocol.html#Error-enum">QNetworkProtocol::Error</a>.
|
---|
| 136 |
|
---|
| 137 | <h3 class=fn>void <a name="setProtocolDetail"></a>QNetworkOperation::setProtocolDetail ( const <a href="qstring.html">QString</a> & detail )
|
---|
| 138 | </h3>
|
---|
| 139 | If the operation failed, the error message can be specified as <em>detail</em>.
|
---|
| 140 |
|
---|
| 141 | <h3 class=fn>void <a name="setRawArg"></a>QNetworkOperation::setRawArg ( int num, const <a href="qbytearray.html">QByteArray</a> & arg )
|
---|
| 142 | </h3>
|
---|
| 143 | Sets the network operation's <em>num</em>-th raw data argument to <em>arg</em>.
|
---|
| 144 |
|
---|
| 145 | <h3 class=fn>void <a name="setState"></a>QNetworkOperation::setState ( <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a> state )
|
---|
| 146 | </h3>
|
---|
| 147 | Sets the <em>state</em> of the operation object. This should be done by
|
---|
| 148 | the network protocol during processing; at the end it should be
|
---|
| 149 | set to QNetworkProtocol::StDone or QNetworkProtocol::StFailed,
|
---|
| 150 | depending on success or failure.
|
---|
| 151 | <p> <p>See also <a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a>.
|
---|
| 152 |
|
---|
| 153 | <h3 class=fn><a href="qnetworkprotocol.html#State-enum">QNetworkProtocol::State</a> <a name="state"></a>QNetworkOperation::state () const
|
---|
| 154 | </h3>
|
---|
| 155 | Returns the state of the operation. You can determine whether an
|
---|
| 156 | operation is still waiting to be processed, is being processed,
|
---|
| 157 | has been processed successfully, or failed.
|
---|
| 158 |
|
---|
| 159 | <!-- eof -->
|
---|
| 160 | <hr><p>
|
---|
| 161 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 162 | Copyright © 1995-2007
|
---|
| 163 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 164 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 165 | <td>Copyright © 2007
|
---|
| 166 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 167 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 168 | </table></div></address></body>
|
---|
| 169 | </html>
|
---|