QNetworkOperation(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

✨ QNetworkOperation β€” the manual page, but make it cute ✨

okay bestie, welcome to QNetworkOperation(3qt), the Qt 3 manual page that's literally about the common operations for network protocols πŸ’– grab a boba, we're doing networking lore.


πŸŽ€ NAME πŸŽ€

QNetworkOperation β€” common operations for network protocols. that's it, that's the whole vibe check.


🌸 SYNOPSIS 🌸

#include <qnetworkprotocol.h>

Inherits QObject. so yes, it's a proper Qt citizen, it has the whole QObject family tree going on πŸ‘‘

πŸ’… 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 ()

πŸ¦‹ DESCRIPTION πŸ¦‹

The QNetworkOperation class provides common operations for network protocols. no cap.

So like, an object gets created to describe the operation and the current state for each and every operation that a network protocol should process. it's giving "little note that travels around telling everyone what's happening" energy πŸ“

If you want the detailed description of the Qt Network Architecture, and how to actually implement and use network protocols in Qt, go read the Qt Network Documentation. it's the main character of this story fr fr.

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 (yes, raw, it's the bytearray twin of the constructor above, iconic duo 🌈). The state is initialized to QNetworkProtocol::StWaiting.

See also QNetworkProtocol::Operation and QNetworkProtocol::State.

πŸ’œ QNetworkOperation::~QNetworkOperation ()

Destructor. it's done, it's logging off, say bye πŸ’€

πŸ’œ QString QNetworkOperation::arg ( int num ) const

Returns the operation's num-th argument. If this argument was not already set, an empty string is returned. so like, no argument? you get "". humble. respectful. ✨

Example: network/networkprotocol/nntp.cpp.

πŸ’œ int QNetworkOperation::errorCode () const

Returns the error code for the last error that occurred 😭 the receipts of what went wrong.

πŸ’œ void QNetworkOperation::free ()

Sets this object to delete itself when it hasn't been used for one second. lowkey dramatic of it but okay ⏳

Here's why: because QNetworkOperation pointers are passed around a lot, QNetworkProtocol generally does not have enough knowledge to delete these at the correct time. So 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. like, never ever. hands off bestie πŸ™ˆ

πŸ’œ QNetworkProtocol::Operation QNetworkOperation::operation () const

Returns the type of the operation. the "what am i" of it all.

πŸ’œ QString QNetworkOperation::protocolDetail () const

Returns a detailed error message for the last error. This must have been set using setProtocolDetail(). if nobody set it, don't come for this function, it can't invent lore πŸŽ€

πŸ’œ QByteArray QNetworkOperation::rawArg ( int num ) const

Returns the operation's num-th raw data argument. If this argument was not already set, an empty bytearray is returned. same energy as arg(), but raw πŸ’…

πŸ’œ void QNetworkOperation::setArg ( int num, const QString & arg )

Sets the network operation's num-th argument to arg. boom. done. set. ✨

πŸ’œ 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. And if possible, one of the error codes defined in QNetworkProtocol should be used β€” like, please use the ones we already have, they're right there πŸ₯Ί

See also setProtocolDetail() and QNetworkProtocol::Error.

πŸ’œ void QNetworkOperation::setProtocolDetail ( const QString & detail )

If the operation failed, the error message can be specified as detail. the ✨narrative✨ of the failure.

πŸ’œ void QNetworkOperation::setRawArg ( int num, const QByteArray & arg )

Sets the network operation's num-th raw data argument to arg. raw version, obviously πŸ¦‹

πŸ’œ 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. so like, you HAVE to close the loop, either it ate or it flopped, no in-between 🫢

See also QNetworkProtocol::State.

πŸ’œ QNetworkProtocol::State QNetworkOperation::state () const

Returns 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. it's the vibe check for your operation: waiting, doing, slayed, or flopped πŸ”₯


🌈 SEE ALSO 🌈


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. read the license bestie, it's giving legally binding πŸ“œ


🧚 AUTHOR 🧚

Generated automatically from the source code. so no human author to thank, the machine did it πŸ’€


πŸ’€ BUGS πŸ’€

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. (genuinely, good bug reports are the love language of maintainers 🫢)

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. so like, the man page is the vibe version, the HTML is the canon ✨

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qnetworkoperation.3qt) and the Qt version (3.3.8). don't forget the version number, they will literally need it πŸ™ˆ


and that's the whole page, bestie!! this lil man page is brought to you by Trolltech AS, dated 2 February 2007, and it's from the Qt 3.3.8 era β€” so old it's vintage, so iconic it's still slaying πŸ‘‘πŸ’– periodt.

πŸ“¦ where this page comes from