#include <ftp.h>
Public Types | |
| typedef set< direntry, direntry::_compare > | dir_type |
| set of direntries. More... | |
Public Methods | |
| void | sendCommand (std::string cmd) |
| low level functions. More... | |
| int | getResponse (std::string *resp=0) |
| FTPSocket () | |
| empty constructor. More... | |
| FTPSocket (InetHostAddress host, timeout_t to=0) | |
| constructor; connects to a host on creation. More... | |
| FTPSocket (InetHostAddress host, std::string user, std::string passwd, timeout_t to=0) | |
| constructor; connects to a host and logs in. More... | |
| ~FTPSocket () | |
| destructor; logs out and disconnects if needed. More... | |
| void | setAscii () |
| set ascii-mode for datatransfer. More... | |
| void | setEbcdic () |
| set ebcdic-mode for datatransfer. More... | |
| void | setBinary () |
| set binary-mode for datatransfer. More... | |
| std::string | Command (std::string cmd) |
| process a ftp-command. More... | |
| void | Open (InetHostAddress host, timeout_t to=0) |
| sessionmanagement. More... | |
| void | Open (InetHostAddress host, std::string user, std::string passwd, timeout_t to=0) |
| creates a connection to host and logs in. More... | |
| void | Login (std::string user, std::string passwd) |
| logs in to a host; connection must be set up. More... | |
| void | Close (void) |
| log out. More... | |
| void | Quit (void) |
| close connection. More... | |
| dir_type | getDir (std::string dir="", timeout_t to=0) |
| get directory. More... | |
| std::string | pwd (void) |
| get current working directory on the server. More... | |
| void | cwd (std::string dir) |
| change current working directory on the server. More... | |
| void | cdup (void) |
| change current working directory. More... | |
| void | Put (std::string file, std::string rfilename, timeout_t to=0) |
| send local file to remote. More... | |
| void | Put (std::string file, timeout_t to=0) |
| send local file to remote; local and remote filenames are identical. More... | |
| void | Get (std::string file, std::string lfilename, timeout_t to=0) |
| get file from server. More... | |
| void | Get (std::string file, timeout_t to=0) |
| get file from server; local and remote filenames are identical. More... | |
| void | remove (std::string file) |
| delete file from server. More... | |
| void | rename (std::string from, std::string to) |
| rename file on server. More... | |
| void | mkdir (std::string dir) |
| create directory on server. More... | |
| void | rmdir (std::string dir) |
| remove directory on server. More... | |
Static Public Methods | |
| void | setDebug (int d=1) |
| enable debugging. More... | |
| int | getDebug () |
| queries debugging. More... | |
Protected Attributes | |
| TCPStream * | cs |
Static Protected Attributes | |
| int | debug |
Friends | |
| class | oftpstream |
| class | iftpstream |
It is based on the CommonC++-Framework.
Example use:
include <iostream>
include <iterator>
include <algorithm>
include <ftp.h>
using namespace ost;
using namespace std;
int main()
{
try
{
ftp f("ftp.gnu.org", "anonymous", "my@email.adress.org");
ftp::iftpstream in(f, "/pub/somefile.txt");
copy(in.begin(), in.end(), output_iterator(cout));
}
catch(FTPException& e)
{
cerr << "exception occured: " << e.what() << endl;
return 1;
}
return 0;
}
|
|
set of direntries.
|
|
|
empty constructor.
|
|
||||||||||||
|
constructor; connects to a host on creation.
|
|
||||||||||||||||||||
|
constructor; connects to a host and logs in.
|
|
|
destructor; logs out and disconnects if needed.
|
|
|
log out.
|
|
|
process a ftp-command.
|
|
||||||||||||
|
get file from server; local and remote filenames are identical.
|
|
||||||||||||||||
|
get file from server.
|
|
||||||||||||
|
logs in to a host; connection must be set up.
|
|
||||||||||||||||||||
|
creates a connection to host and logs in.
|
|
||||||||||||
|
sessionmanagement. creates a connection to host |
|
||||||||||||
|
send local file to remote; local and remote filenames are identical.
|
|
||||||||||||||||
|
send local file to remote.
|
|
|
close connection.
|
|
|
change current working directory.
|
|
|
change current working directory on the server.
|
|
|
queries debugging.
|
|
||||||||||||
|
get directory.
|
|
|
|
|
|
create directory on server.
|
|
|
get current working directory on the server.
|
|
|
delete file from server.
|
|
||||||||||||
|
rename file on server.
|
|
|
remove directory on server.
|
|
|
low level functions.
|
|
|
set ascii-mode for datatransfer.
|
|
|
set binary-mode for datatransfer.
|
|
|
enable debugging.
|
|
|
set ebcdic-mode for datatransfer.
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.10 written by Dimitri van Heesch,
© 1997-2001