QFtp Class

Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QFtp Class Reference
[network module]

The QFtp class provides an implementation of the FTP protocol. More...

`#include <qftp.h>`

Inherits QNetworkProtocol.

List of all member functions.

## Public Members

- QFtp ()
- virtual ~QFtp ()

## Protected Members

- void parseDir ( const QString & buffer, QUrlInfo & info )

## Protected Slots

- void readyRead ()
- void dataConnected ()
- void dataClosed ()
- void dataReadyRead ()
- void dataBytesWritten ( int nbytes )

## Detailed Description

The QFtp class provides an implementation of the FTP protocol.

This class is derived from QNetworkProtocol. QFtp is not normally used directly, but rather through a QUrlOperator, for example:

      QUrlOperator op( "ftp://ftp.trolltech.com" );
      op.listChildren(); // Asks the server to provide a directory listing

This code will only work if the QFtp class is registered; to register the class, you must call qInitNetworkProtocols() before using a QUrlOperator with QFtp.

If you really need to use QFtp directly, don't forget to set its QUrlOperator with setUrl().

See also Qt Network Documentation, QNetworkProtocol, QUrlOperator and Input/Output and Networking.

## Member Function Documentation

### QFtp::QFtp ()

Constructs a QFtp object.

### QFtp::~QFtp ()`[virtual]`

Destructor

### void QFtp::dataBytesWritten ( int nbytes )`[protected slot]`

This function is called, when nbytes have been successfully written to the data socket.

### void QFtp::dataClosed ()`[protected slot]`

This function is called when the data connection has been closed.

### void QFtp::dataConnected ()`[protected slot]`

Some operations require a data connection to the server. If this connection could be opened, this function handles the data connection.

### void QFtp::dataReadyRead ()`[protected slot]`

This function is called when new data arrived on the data socket.

### void QFtp::parseDir ( const QString & buffer, QUrlInfo & info )`[protected]`

Parses the string, buffer, which is one line of a directory listing which came from the FTP server, and sets the values which have been parsed to the url info object, info.

### void QFtp::readyRead ()`[protected slot]`

If data has arrived on the command socket, this slot is called. The function loks at the data and passes it on to the function which can handle it

This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.