NAMEQNetworkOperation - Common operations for network protocols
SYNOPSIS#include <qnetworkprotocol.h> Inherits QObject. Public Members QNetworkOperation ( QNetworkProtocol::Operation operation, const QString & arg0, const QString & arg1, const QString & arg2 ) QNetworkOperation ( QNetworkProtocol::Operation operation, const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 ) ~QNetworkOperation () void setState ( QNetworkProtocol::State state ) void setProtocolDetail ( const QString & detail ) void setErrorCode ( int ec ) void setArg ( int num, const QString & arg ) void setRawArg ( int num, const QByteArray & arg ) QNetworkProtocol::Operation operation () const QNetworkProtocol::State state () const QString arg ( int num ) const QByteArray rawArg ( int num ) const QString protocolDetail () const int errorCode () const void free ()
DESCRIPTIONThe QNetworkOperation class provides common operations for network protocols. An object is created to describe the operation and the current state for each operation that a network protocol should process. For a detailed description of the Qt Network Architecture and how to implement and use network protocols in Qt, see the Qt Network Documentation. See also QNetworkProtocol and Input/Output and Networking.
MEMBER FUNCTION DOCUMENTATION
QNETWORKOPERATION::QNETWORKOPERATION ( QNETWORKPROTOCOL::OPERATION OPERATION,const QString & arg0, const QString & arg1, const QString & arg2 ) Constructs a network operation object. operation is the type of the operation, and arg0, arg1 and arg2 are the first three arguments of the operation. The state is initialized to QNetworkProtocol::StWaiting. See also QNetworkProtocol::Operation and QNetworkProtocol::State.
QNETWORKOPERATION::QNETWORKOPERATION ( QNETWORKPROTOCOL::OPERATION OPERATION,const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 ) Constructs a network operation object. operation is the type of the operation, and arg0, arg1 and arg2 are the first three raw data arguments of the operation. The state is initialized to QNetworkProtocol::StWaiting. See also QNetworkProtocol::Operation and QNetworkProtocol::State.
QSTRING QNETWORKOPERATION::ARG ( INT NUM ) CONSTReturns the operation's num-th argument. If this argument was not already set, an empty string is returned. Example: network/networkprotocol/nntp.cpp.
INT QNETWORKOPERATION::ERRORCODE () CONSTReturns the error code for the last error that occurred.
VOID QNETWORKOPERATION::FREE ()Sets this object to delete itself when it hasn't been used for one second. Because QNetworkOperation pointers are passed around a lot the QNetworkProtocol generally does not have enough knowledge to delete these at the correct time. If a QNetworkProtocol doesn't need an operation any more it will call this function instead. Note: you should never need to call the method yourself.
QNETWORKPROTOCOL::OPERATION QNETWORKOPERATION::OPERATION () CONSTReturns the type of the operation.
QSTRING QNETWORKOPERATION::PROTOCOLDETAIL () CONSTReturns a detailed error message for the last error. This must have been set using setProtocolDetail().
QBYTEARRAY QNETWORKOPERATION::RAWARG ( INT NUM ) CONSTReturns the operation's num-th raw data argument. If this argument was not already set, an empty bytearray is returned.
VOID QNETWORKOPERATION::SETARG ( INT NUM, CONST QSTRING & ARG )Sets the network operation's num-th argument to arg.
VOID QNETWORKOPERATION::SETERRORCODE ( INT EC )Sets the error code to ec. If the operation failed, the protocol should set an error code to describe the error in more detail. If possible, one of the error codes defined in QNetworkProtocol should be used. See also setProtocolDetail() and QNetworkProtocol::Error.
VOID QNETWORKOPERATION::SETPROTOCOLDETAIL ( CONST QSTRING & DETAIL )If the operation failed, the error message can be specified as detail.
VOID QNETWORKOPERATION::SETRAWARG ( INT NUM, CONST QBYTEARRAY & ARG )Sets the network operation's num-th raw data argument to arg.
VOID QNETWORKOPERATION::SETSTATE ( QNETWORKPROTOCOL::STATE STATE )Sets the state of the operation object. This should be done by the network protocol during processing; at the end it should be set to QNetworkProtocol::StDone or QNetworkProtocol::StFailed, depending on success or failure. See also QNetworkProtocol::State.
QNETWORKPROTOCOL::STATE QNETWORKOPERATION::STATE () CONSTReturns the state of the operation. You can determine whether an operation is still waiting to be processed, is being processed, has been processed successfully, or failed.
SEE ALSO//doc.trolltech.com/qnetworkoperation.html //www.trolltech.com/faq/tech.html
COPYRIGHTCopyright 1992-2007 Trolltech ASA, //www.trolltech.com. See the license file included in the distribution for a complete license statement.
AUTHORGenerated automatically from the source code.
BUGSIf you find a bug in Qt, please report it as described in //doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt- firstname.lastname@example.org. Please include the name of the manual page (qnetworkoperation.3qt) and the Qt version (3.3.8). QNETWORKOPERATION(3)