This class provides methods for manipulating the FTP protocol (described in RFC 959).
More...
#include <SFML/Network/Ftp.hpp>
This class provides methods for manipulating the FTP protocol (described in RFC 959).
It provides easy access and transfers to remote directories and files on a FTP server
Definition at line 47 of file Ftp.hpp.
◆ TransferMode
Enumeration of transfer modes.
| Enumerator |
|---|
| Binary | Binary mode (file is transfered as a sequence of bytes).
|
| Ascii | Text mode using ASCII encoding.
|
| Ebcdic | Text mode using EBCDIC encoding.
|
Definition at line 54 of file Ftp.hpp.
◆ ~Ftp()
Destructor – close the connection with the server.
◆ ChangeDirectory()
| Response sf::Ftp::ChangeDirectory |
( |
const std::string & | Directory | ) |
|
Change the current working directory.
- Parameters
-
| Directory | : New directory, relative to the current one |
- Returns
- Server response to the request
◆ Connect()
| Response sf::Ftp::Connect |
( |
const IPAddress & | Server, |
|
|
unsigned short | Port = 21, |
|
|
float | Timeout = 0.f ) |
Connect to the specified FTP server.
- Parameters
-
| Server | : FTP server to connect to |
| Port | : Port used for connection (21 by default, standard FTP port) |
| Timeout | : Maximum time to wait, in seconds (0 by default, means no timeout) |
- Returns
- Server response to the request
◆ DeleteDirectory()
| Response sf::Ftp::DeleteDirectory |
( |
const std::string & | Name | ) |
|
Remove an existing directory.
- Parameters
-
| Name | : Name of the directory to remove |
- Returns
- Server response to the request
◆ DeleteFile()
| Response sf::Ftp::DeleteFile |
( |
const std::string & | Name | ) |
|
Remove an existing file.
- Parameters
-
- Returns
- Server response to the request
◆ Disconnect()
Close the connection with FTP server.
- Returns
- Server response to the request
◆ Download()
Download a file from the server.
- Parameters
-
| DistantFile | : Path of the distant file to download |
| DestPath | : Where to put to file on the local computer |
| Mode | : Transfer mode (binary by default) |
- Returns
- Server response to the request
◆ GetDirectoryListing()
| ListingResponse sf::Ftp::GetDirectoryListing |
( |
const std::string & | Directory = "" | ) |
|
Get the contents of the given directory (subdirectories and files).
- Parameters
-
| Directory | : Directory to list ("" by default, the current one) |
- Returns
- Server response to the request
◆ GetWorkingDirectory()
Get the current working directory.
- Returns
- Server response to the request
◆ KeepAlive()
Send a null command just to prevent from being disconnected.
- Returns
- Server response to the request
◆ Login() [1/2]
Log in using anonymous account.
- Returns
- Server response to the request
◆ Login() [2/2]
| Response sf::Ftp::Login |
( |
const std::string & | UserName, |
|
|
const std::string & | Password ) |
Log in using a username and a password.
- Parameters
-
| UserName | : User name |
| Password | : Password |
- Returns
- Server response to the request
◆ MakeDirectory()
| Response sf::Ftp::MakeDirectory |
( |
const std::string & | Name | ) |
|
Create a new directory.
- Parameters
-
| Name | : Name of the directory to create |
- Returns
- Server response to the request
◆ ParentDirectory()
Go to the parent directory of the current one.
- Returns
- Server response to the request
◆ RenameFile()
| Response sf::Ftp::RenameFile |
( |
const std::string & | File, |
|
|
const std::string & | NewName ) |
Rename a file.
- Parameters
-
| File | : File to rename |
| NewName | : New name |
- Returns
- Server response to the request
◆ Upload()
Upload a file to the server.
- Parameters
-
| LocalFile | : Path of the local file to upload |
| DestPath | : Where to put to file on the server |
| Mode | : Transfer mode (binary by default) |
- Returns
- Server response to the request
◆ DataChannel
The documentation for this class was generated from the following file: