Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1999

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qurloperator.cpp:87 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QUrlOperator Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QUrlOperator Class Reference<br><small>[<a href="network.html">network module</a>]</small></h1>

<p>The QUrlOperator class provides common operations on URLs.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qurloperator-h.html">qurloperator.h</a>&gt;</tt>
<p>Inherits <a href="qobject.html">QObject</a> and <a href="qurl.html">QUrl</a>.
<p><a href="qurloperator-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QUrlOperator"><b>QUrlOperator</b></a> ()</div></li>
<li><div class=fn><a href="#QUrlOperator-2"><b>QUrlOperator</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn><a href="#QUrlOperator-3"><b>QUrlOperator</b></a> ( const&nbsp;QUrlOperator&nbsp;&amp;&nbsp;url )</div></li>
<li><div class=fn><a href="#QUrlOperator-4"><b>QUrlOperator</b></a> ( const&nbsp;QUrlOperator&nbsp;&amp;&nbsp;url, const&nbsp;QString&nbsp;&amp;&nbsp;relUrl, bool&nbsp;checkSlash = FALSE )</div></li>
<li><div class=fn>virtual <a href="#~QUrlOperator"><b>~QUrlOperator</b></a> ()</div></li>
<li><div class=fn>virtual const QNetworkOperation * <a href="#listChildren"><b>listChildren</b></a> ()</div></li>
<li><div class=fn>virtual const QNetworkOperation * <a href="#mkdir"><b>mkdir</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;dirname )</div></li>
<li><div class=fn>virtual const QNetworkOperation * <a href="#remove"><b>remove</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;filename )</div></li>
<li><div class=fn>virtual const QNetworkOperation * <a href="#rename"><b>rename</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;oldname, const&nbsp;QString&nbsp;&amp;&nbsp;newname )</div></li>
<li><div class=fn>virtual const QNetworkOperation * <a href="#get"><b>get</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;location = QString::null )</div></li>
<li><div class=fn>virtual const QNetworkOperation * <a href="#put"><b>put</b></a> ( const&nbsp;QByteArray&nbsp;&amp;&nbsp;data, const&nbsp;QString&nbsp;&amp;&nbsp;location = QString::null )</div></li>
<li><div class=fn>virtual QPtrList&lt;QNetworkOperation&gt; <a href="#copy"><b>copy</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;from, const&nbsp;QString&nbsp;&amp;&nbsp;to, bool&nbsp;move = FALSE, bool&nbsp;toPath = TRUE )</div></li>
<li><div class=fn>virtual void <a href="#copy-2"><b>copy</b></a> ( const&nbsp;QStringList&nbsp;&amp;&nbsp;files, const&nbsp;QString&nbsp;&amp;&nbsp;dest, bool&nbsp;move = FALSE )</div></li>
<li><div class=fn>virtual bool <a href="#isDir"><b>isDir</b></a> ( bool&nbsp;*&nbsp;ok = 0 )</div></li>
<li><div class=fn>virtual void <a href="#setNameFilter"><b>setNameFilter</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;nameFilter )</div></li>
<li><div class=fn>QString <a href="#nameFilter"><b>nameFilter</b></a> () const</div></li>
<li><div class=fn>virtual QUrlInfo <a href="#info"><b>info</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;entry ) const</div></li>
<li><div class=fn>virtual void <a href="#stop"><b>stop</b></a> ()</div></li>
</ul>
<h2>Signals</h2>
<ul>
<li><div class=fn>void <a href="#newChildren"><b>newChildren</b></a> ( const&nbsp;QValueList&lt;QUrlInfo&gt;&nbsp;&amp;&nbsp;i, QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#finished"><b>finished</b></a> ( QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#start"><b>start</b></a> ( QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#createdDirectory"><b>createdDirectory</b></a> ( const&nbsp;QUrlInfo&nbsp;&amp;&nbsp;i, QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#removed"><b>removed</b></a> ( QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#itemChanged"><b>itemChanged</b></a> ( QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#data"><b>data</b></a> ( const&nbsp;QByteArray&nbsp;&amp;&nbsp;data, QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#dataTransferProgress"><b>dataTransferProgress</b></a> ( int&nbsp;bytesDone, int&nbsp;bytesTotal, QNetworkOperation&nbsp;*&nbsp;op )</div></li>
<li><div class=fn>void <a href="#startedNextCopy"><b>startedNextCopy</b></a> ( const&nbsp;QPtrList&lt;QNetworkOperation&gt;&nbsp;&amp;&nbsp;lst )</div></li>
<li><div class=fn>void <a href="#connectionStateChanged"><b>connectionStateChanged</b></a> ( int&nbsp;state, const&nbsp;QString&nbsp;&amp;&nbsp;data )</div></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class=fn>virtual void <a href="#clearEntries"><b>clearEntries</b></a> ()</div></li>
<li><div class=fn>void <a href="#getNetworkProtocol"><b>getNetworkProtocol</b></a> ()</div></li>
<li><div class=fn>void <a href="#deleteNetworkProtocol"><b>deleteNetworkProtocol</b></a> ()</div></li>
</ul>
<h2>Related Functions</h2>
<ul>
<li><div class=fn>void <a href="#qInitNetworkProtocols"><b>qInitNetworkProtocols</b></a> ()</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


<p> The QUrlOperator class provides common operations on URLs.
<p> 


<p> 
<p> This class operates on hierarchical structures (such as filesystems)
using URLs. Its API allows all the common operations (listing
children, removing children, renaming, etc.). The class uses the
functionality of registered network protocols to perform these
operations. Depending of the protocol of the URL, it uses an
appropriate network protocol class for the operations.
Each of the operation functions of QUrlOperator creates a
<a href="qnetworkoperation.html">QNetworkOperation</a> object that describes the operation and puts it
into the operation queue for the network protocol used.  If no
suitable protocol could be found (because no implementation of the
necessary network protocol is registered), the URL operator emits
errors. Not every protocol supports every operation, but error
handling deals with this problem.
<p> A QUrlOperator can be used like this e.g. for downloading a file:
<pre>
  QUrlOperator op;
  op.<a href="#copy">copy</a>( QString("ftp://ftp.trolltech.com/qt/source/qt-2.1.0.tar.gz"),
           "file:/tmp" );
  </pre>
 
<p> You will also need to connect to some signals of the QUrlOperator to be
informed of success, errors, progress and more things.
<p> Of course an implementation for the FTP protocol has to be
registered for this example to work, e.g. <a href="qftp.html">QFtp</a>. You can use
the function <a href="#qInitNetworkProtocols">qInitNetworkProtocols</a>() to register all the network
protocols that are shipped with the Qt network extension (at the
moment <a href="qftp.html">FTP</a>, <a href="qhttp.html">HTTP</a> and
<a href="qlocalfs.html">local file system</a> are supported).
<p> For more information about the Qt Network Architecture see the
<a href="network.html">Qt Network Documentation</a>.
<p> <p>See also <a href="qnetworkprotocol.html">QNetworkProtocol</a>, <a href="qnetworkoperation.html">QNetworkOperation</a>, <a href="io.html">Input/Output and Networking</a> and <a href="misc.html">Miscellaneous Classes</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QUrlOperator"></a>QUrlOperator::QUrlOperator ()
</h3>
Constructs a QUrlOperator with an empty (i.e. invalid) URL.

<h3 class=fn><a name="QUrlOperator-2"></a>QUrlOperator::QUrlOperator ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;url )
</h3>
Constructs a QUrlOperator using <em>url</em> and parses this string.
<p> If you pass strings like "/home/qt" the "file" protocol is
assumed.

<h3 class=fn><a name="QUrlOperator-3"></a>QUrlOperator::QUrlOperator ( const&nbsp;<a href="qurloperator.html">QUrlOperator</a>&nbsp;&amp;&nbsp;url )
</h3>
Constructs a copy of <em>url</em>.

<h3 class=fn><a name="QUrlOperator-4"></a>QUrlOperator::QUrlOperator ( const&nbsp;<a href="qurloperator.html">QUrlOperator</a>&nbsp;&amp;&nbsp;url, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;relUrl, bool&nbsp;checkSlash = FALSE )
</h3>
Constructs a QUrlOperator. The URL on which this QUrlOperator
operates is constructed out of the arguments <em>url</em>, <em>relUrl</em> and
<em>checkSlash</em>: see the corresponding <a href="qurl.html">QUrl</a> constructor for an
explanation of these arguments.

<h3 class=fn><a name="~QUrlOperator"></a>QUrlOperator::~QUrlOperator ()<tt> [virtual]</tt>
</h3>
Destructor.

<h3 class=fn>void <a name="clearEntries"></a>QUrlOperator::clearEntries ()<tt> [virtual protected]</tt>
</h3>
Clears the cache of children.

<h3 class=fn>void <a name="connectionStateChanged"></a>QUrlOperator::connectionStateChanged ( int&nbsp;state, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;data )<tt> [signal]</tt>
</h3>

<p> This signal is emitted whenever the state of the connection of the network
protocol of the URL operator changes. <em>state</em> describes the new state, which
is a <a href="qnetworkprotocol.html#ConnectionState-enum">QNetworkProtocol::ConnectionState</a> value.
<p> <em>data</em> is a string that describes the change of the connection. This can be
used to display a message to the user.

<h3 class=fn><a href="qptrlist.html">QPtrList</a>&lt;QNetworkOperation&gt; <a name="copy"></a>QUrlOperator::copy ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;from, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;to, bool&nbsp;move = FALSE, bool&nbsp;toPath = TRUE )<tt> [virtual]</tt>
</h3>  Copies the file <em>from</em> to <em>to</em>. If <em>move</em> is TRUE, the file is
moved (copied and removed). <em>from</em> must point to a file and <em>to</em>
points to a directory (into which <em>from</em> is copied) unless <em>toPath</em> is set to FALSE.  If <em>toPath</em> is set to FALSE then the <em>to</em>
variable is assumed to be the absolute file path (destination file
path + file name).  The copying is done using the <a href="#get">get</a>() and <a href="#put">put</a>()
operations. If you want to be notified about the progress of the
operation, connect to the <a href="#dataTransferProgress">dataTransferProgress</a>() signal. Bear in
mind that the get() and put() operations emit this signal through
the QUrlOperator. The number of transferred bytes and the total
bytes that you receive as arguments in this signal do not relate to
the the whole copy operation; they relate first to the get() and
then to the put() operation. Always check what type of operation the
signal comes from; this is given in the signal's last argument.
<p> At the end, <a href="#finished">finished</a>() (with success or failure) is emitted, so
check the state of the network operation object to see whether or
not the operation was successful.
<p> Because a move or copy operation consists of multiple operations (get(),
put() and maybe <a href="#remove">remove</a>()), this function doesn't return a single
<a href="qnetworkoperation.html">QNetworkOperation</a>, but rather a list of them. They are in the order:
<a href="#get">get</a>(), <a href="#put">put</a>() and (if applicable) remove().
<p> <p>See also <a href="#get">get</a>() and <a href="#put">put</a>().

<h3 class=fn>void <a name="copy-2"></a>QUrlOperator::copy ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;files, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;dest, bool&nbsp;move = FALSE )<tt> [virtual]</tt>
</h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Copies <em>files</em> to the directory <em>dest</em>. If <em>move</em> is TRUE
the files are moved, not copied. <em>dest</em> must point to a directory.
<p> This function calls <a href="#copy">copy</a>() for each entry in <em>files</em> one
after the other. You don't get a result from this function; each
time a new copy begins, <a href="#startedNextCopy">startedNextCopy</a>() is emitted, with a list of
QNetworkOperations that describe the new copy operation.

<h3 class=fn>void <a name="createdDirectory"></a>QUrlOperator::createdDirectory ( const&nbsp;<a href="qurlinfo.html">QUrlInfo</a>&nbsp;&amp;&nbsp;i, <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> This signal is emitted when <a href="#mkdir">mkdir</a>() succeeds and the directory has
been created. <em>i</em> holds the information about the new directory.
<em>op</em> is the pointer to the operation object, which contains all
the information about the operation, including the state. Using
op->arg(0) you also get the file name of the new directory.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>void <a name="data"></a>QUrlOperator::data ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;data, <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> This signal is emitted when new <em>data</em> has been received after calling
<a href="#get">get</a>() or <a href="#put">put</a>(). <em>op</em> holds the name of the file whose data is retrieved
in op->arg( 0 ) and the (raw) data in op->rawArg( 1 ).
<p> <em>op</em> is the pointer to the operation object which contains all
the information about the operation, including the state.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>void <a name="dataTransferProgress"></a>QUrlOperator::dataTransferProgress ( int&nbsp;bytesDone, int&nbsp;bytesTotal, <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> This signal is emitted during data transfer (using <a href="#put">put</a>() or
<a href="#get">get</a>()). <em>bytesDone</em> specifies how many bytes of <em>bytesTotal</em> have
been transferred. More information about the operation is stored in
<em>op</em>, the pointer to the network operation that is processed.
<em>bytesTotal</em> may be -1, which means that the total number of bytes
is not known.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>void <a name="deleteNetworkProtocol"></a>QUrlOperator::deleteNetworkProtocol ()<tt> [protected]</tt>
</h3>
Deletes the currently used network protocol.

<h3 class=fn>void <a name="finished"></a>QUrlOperator::finished ( <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> This signal is emitted when an operation of some sort finishes,
whether with success or failure.  <em>op</em> is the pointer to the
operation object, which contains all the information, including the
state, of the operation which has been finished. Check the state and
error code of the operation object to see whether or not the
operation was successful.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>const&nbsp;<a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;* <a name="get"></a>QUrlOperator::get ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;location = QString::null )<tt> [virtual]</tt>
</h3>  Tells the network protocol to get data from <em>location</em> or, if
this is <a href="qstring.html#QString-null">QString::null</a>, to get data from the location to which this
URL points (see <a href="qurl.html#fileName">QUrl::fileName</a>() and
<a href="qurl.html#encodedPathAndQuery">QUrl::encodedPathAndQuery</a>()). What happens then depends on the
network protocol.  The <a href="#data">data</a>() signal is emitted when data comes
in. Because it's unlikely that all data will come in at once,
multiple data() signals will most likely be emitted. The
<a href="#dataTransferProgress">dataTransferProgress</a>() is emitted while processing the operation.
At the end, <a href="#finished">finished</a>() (with success or failure) is emitted, so
check the state of the network operation object to see whether or
not the operation was successful.
<p> If <em>location</em> is QString::null, the path of this QUrlOperator
should point to a file when you use this operation. If <em>location</em>
is not empty, it can be a relative URL (a child of the path to which
the QUrlOperator points) or an absolute URL.
<p> For example, to get a web page you might do something like this:
<p> <pre>
  QUrlOperator op( "http://www.whatever.org/cgi-bin/search.pl?cmd=Hello" );
  op.<a href="#get">get</a>();
  </pre>
 
<p> For most other operations, the path of the QUrlOperator must point
to a directory. If you want to download a file you could do the
following:
<p> <pre>
  QUrlOperator op( "ftp://ftp.whatever.org/pub" );
  // do some other stuff like op.<a href="#listChildren">listChildren</a>() or op.<a href="#mkdir">mkdir</a>( "new_dir" )
  op.<a href="#get">get</a>( "a_file.txt" );
  </pre>
 
<p> This will get the data of ftp://ftp.whatever.org/pub/a_file.txt.
<p> <em>Never</em> do anything like this:
<p> <pre>
  QUrlOperator op( "http://www.whatever.org/cgi-bin" );
  op.<a href="#get">get</a>( "search.pl?cmd=Hello" ); // WRONG!
  </pre>
 
<p> If <em>location</em> is not empty and relative it must not
contain any queries or references, just the name of a child. So
if you need to specify a query or reference, do it as shown in the first
example or specify the full URL (such as
http://www.whatever.org/cgi-bin/search.pl?cmd=Hello) as <em>location</em>.
<p> <p>See also <a href="#copy">copy</a>().

<h3 class=fn>void <a name="getNetworkProtocol"></a>QUrlOperator::getNetworkProtocol ()<tt> [protected]</tt>
</h3>
Finds a network protocol for the URL and deletes the old network protocol.

<h3 class=fn><a href="qurlinfo.html">QUrlInfo</a> <a name="info"></a>QUrlOperator::info ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;entry ) const<tt> [virtual]</tt>
</h3>
Returns the URL information for the child <em>entry</em>, or returns an
empty <a href="qurlinfo.html">QUrlInfo</a> object if there is no information available
about <em>entry</em>.

<h3 class=fn>bool <a name="isDir"></a>QUrlOperator::isDir ( bool&nbsp;*&nbsp;ok = 0 )<tt> [virtual]</tt>
</h3>  Returns TRUE if the URL is a directory; otherwise returns FALSE.
This may not always work correctly, if the protocol of the URL is
something other than file (local filesystem). If you pass a bool
pointer as the <em>ok</em> argument, <em>*ok</em> is set to TRUE if the result of
this function is known to be correct, and to FALSE otherwise.

<h3 class=fn>void <a name="itemChanged"></a>QUrlOperator::itemChanged ( <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> This signal is emitted whenever a file which is a child of the URL
has been changed, for example by successfully calling <a href="#rename">rename</a>(). <em>op</em> holds
the original and new file names in the first and second arguments,
respectively; they can be accessed with
op->arg( 0 ) and op->arg( 1 ).
<p> <em>op</em> is the pointer to the operation object which contains all
the information about the operation, including the state.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>const&nbsp;<a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;* <a name="listChildren"></a>QUrlOperator::listChildren ()<tt> [virtual]</tt>
</h3>  Starts listing the children of this URL (e.g. of a
directory). The signal <a href="#start">start</a>() is emitted before the first entry is
listed and <a href="#finished">finished</a>() is emitted after the last one.  The
<a href="#newChildren">newChildren</a>() signal is emitted for each list of new entries.  If an
error occurs, the signal finished() is emitted, so be sure to check
the state of the network operation pointer.
<p> Because the operation may not be executed immediately, a pointer to the
<a href="qnetworkoperation.html">QNetworkOperation</a> object created by this function is
returned. This object contains all the data about the operation and is
used to refer to this operation later (e.g. in the signals that are emitted
by the QUrlOperator). The return value can also be 0 if the operation object
couldn't be created.
<p> The path of this QUrlOperator must to point to a directory (because
the children of this directory will be listed), not to a
file.

<h3 class=fn>const&nbsp;<a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;* <a name="mkdir"></a>QUrlOperator::mkdir ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;dirname )<tt> [virtual]</tt>
</h3>
Tries to create a directory (child) with the name <em>dirname</em>.
If it is successful, a <a href="#newChildren">newChildren</a>()
signal with the new child is emitted, and the
<a href="#createdDirectory">createdDirectory</a>() signal with
the information about the new child is emitted, too.
<a href="#finished">finished</a>() (with success or failure) is also emitted
after the operation has been processed, so check the state of the network
operation object to see whether or not the operation was successful.
<p> Because the operation will not be executed immediately, a pointer to the
<a href="qnetworkoperation.html">QNetworkOperation</a> object created by this function is
returned. This object contains all the data about the operation and is
used to refer to this operation later (e.g. in the signals that are emitted
by the QUrlOperator). The return value can also be 0 if the operation object
couldn't be created.
<p> The path of this QUrlOperator must to point to a directory because
the new directory will be created in this path, not to a
file.

<h3 class=fn><a href="qstring.html">QString</a> <a name="nameFilter"></a>QUrlOperator::nameFilter () const
</h3>
Returns the name filter of the URL.
<p> <p>See also <a href="#setNameFilter">QUrlOperator::setNameFilter</a>() and <a href="qdir.html#nameFilter">QDir::nameFilter</a>().

<h3 class=fn>void <a name="newChildren"></a>QUrlOperator::newChildren ( const&nbsp;<a href="qvaluelist.html">QValueList</a>&lt;QUrlInfo&gt;&nbsp;&amp;&nbsp;i, <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> This signal is emitted after <a href="#listChildren">listChildren</a>() was called and new
children (e.g. files) have been read from a list of files. <em>i</em>
holds the information about the new children. <em>op</em> is the pointer to
the operation object which contains all the information about the
operation, including the state.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>const&nbsp;<a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;* <a name="put"></a>QUrlOperator::put ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;data, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;location = QString::null )<tt> [virtual]</tt>
</h3>
This function tells the network protocol to put <em>data</em> in <em>location</em>. If <em>location</em> is empty (QString::null), it puts the <em>data</em> in
the location to which the URL points. What happens depends on the
network protocol. Depending on the network protocol, some data
might come back after putting data, in which case the <a href="#data">data</a>()
signal is emitted.  The <a href="#dataTransferProgress">dataTransferProgress</a>() is emitted during
processing of the operation.  At the end, <a href="#finished">finished</a>() (with success
or failure) is emitted, so check the state of the network
operation object to see whether or not the operation was
successful.
<p> If <em>location</em> is <a href="qstring.html#QString-null">QString::null</a>, the path of this QUrlOperator
should point to a file when you use this operation. If <em>location</em>
is not empty, it can be a relative (a child of the path to which the
QUrlOperator points) or an absolute URL.
<p> For putting some data to a file you can do the following:
<p> <pre>
  QUrlOperator op( "ftp://ftp.whatever.com/home/me/filename" );
  op.<a href="#put">put</a>( data );
  </pre>
 
<p> For most other operations, however, the path of the QUrlOperator
must point to a directory. If you want to upload data to a file you
could do the following:
<p> <pre>
  QUrlOperator op( "ftp://ftp.whatever.com/home/me" );
  // do some other stuff like op.<a href="#listChildren">listChildren</a>() or op.<a href="#mkdir">mkdir</a>( "new_dir" )
  op.<a href="#put">put</a>( data, "filename.dat" );
  </pre>
 
<p> This will upload the data to ftp://ftp.whatever.com/home/me/filename.dat.
<p> <p>See also <a href="#copy">copy</a>().

<h3 class=fn>const&nbsp;<a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;* <a name="remove"></a>QUrlOperator::remove ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;filename )<tt> [virtual]</tt>
</h3>
Tries to remove the file (child) <em>filename</em>.
If it succeeds the <a href="#removed">removed</a>() signal is emitted.
<a href="#finished">finished</a>() (with success or failure) is also emitted after
the operation has been processed, so check the state of the network operation
object to see whether or not the operation was successful.
<p> Because the operation will not be executed immediately, a pointer to the
<a href="qnetworkoperation.html">QNetworkOperation</a> object created by this function is
returned. This object contains all the data about the operation and is
used to refer to this operation later (e.g. in the signals that are emitted
by the QUrlOperator). The return value can also be 0 if the operation object
couldn't be created.
<p> The path of this QUrlOperator must point to a directory; because
if <em>filename</em> is relative, it will try to remove it in this
directory.

<h3 class=fn>void <a name="removed"></a>QUrlOperator::removed ( <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> This signal is emitted when <a href="#remove">remove</a>() has been succesful
and the file has been removed. <em>op</em> holds the file name
of the removed file in the first argument which can be accessed with
op->arg( 0 ).
<p> <em>op</em> is the pointer to the operation object which contains all
the information about the operation, including the state.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>const&nbsp;<a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;* <a name="rename"></a>QUrlOperator::rename ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;oldname, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;newname )<tt> [virtual]</tt>
</h3>
Tries to rename the file (child) <em>oldname</em> to <em>newname</em>.
If it succeeds, the signal <a href="#itemChanged">itemChanged</a>() is emitted.
<a href="#finished">finished</a>() (with success or failure) is also emitted after
the operation has been processed, so check the state of the network operation
object to see whether or not the operation was successful.
<p> Because the operation may not be executed immediately, a pointer to the
<a href="qnetworkoperation.html">QNetworkOperation</a> object created by this function is
returned. This object contains all the data about the operation and is
used to refer to this operation later (e.g. in the signals that are emitted
by the QUrlOperator). The return value can also be 0 if the operation object
couldn't be created.
<p> This path of this QUrlOperator must to point to a directory because
<em>oldname</em> and <em>newname</em> are handled relative to this directory.

<h3 class=fn>void <a name="setNameFilter"></a>QUrlOperator::setNameFilter ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;nameFilter )<tt> [virtual]</tt>
</h3>
Sets the name filter of the URL to <em>nameFilter</em>.
<p> <p>See also <a href="qdir.html#setNameFilter">QDir::setNameFilter</a>().

<h3 class=fn>void <a name="start"></a>QUrlOperator::start ( <a href="qnetworkoperation.html">QNetworkOperation</a>&nbsp;*&nbsp;op )<tt> [signal]</tt>
</h3>

<p> Some operations (such as <a href="#listChildren">listChildren</a>()) emit this signal
when they start processing the operation.
<em>op</em> is the pointer to the operation object which contains all the
information about the operation, including the state.
<p> <p>See also <a href="qnetworkoperation.html">QNetworkOperation</a> and <a href="qnetworkprotocol.html">QNetworkProtocol</a>.

<h3 class=fn>void <a name="startedNextCopy"></a>QUrlOperator::startedNextCopy ( const&nbsp;<a href="qptrlist.html">QPtrList</a>&lt;QNetworkOperation&gt;&nbsp;&amp;&nbsp;lst )<tt> [signal]</tt>
</h3>

<p> This signal is emitted if <a href="#copy">copy</a>() starts a new copy operation. <em>lst</em>
contains all QNetworkOperations related to this copy operation.
<p> <p>See also <a href="#copy">copy</a>().

<h3 class=fn>void <a name="stop"></a>QUrlOperator::stop ()<tt> [virtual]</tt>
</h3>
Stops the current network operation and removes all waiting network
operations of this QUrlOperator.

<hr><h2>Related Functions</h2>
<h3 class=fn>void <a name="qInitNetworkProtocols"></a>qInitNetworkProtocols ()
</h3>

<p> This function registers the network protocols for FTP and HTTP. You have to
call this function before you use QUrlOperator for these protocols.
<p> This function is declared in <a href="qnetwork-h.html">qnetwork.h</a>.

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>