25 #ifndef CPP3DS_FTP_HPP
26 #define CPP3DS_FTP_HPP
31 #include <cpp3ds/Network/TcpSocket.hpp>
32 #include <cpp3ds/System/NonCopyable.hpp>
33 #include <cpp3ds/System/Time.hpp>
180 std::string m_message;
212 std::string m_directory;
239 const std::vector<std::string>&
getListing()
const;
246 std::vector<std::string> m_listing;
315 Response login(
const std::string& name,
const std::string& password);
526 friend class DataChannel;
537 #endif // CPP3DS_FTP_HPP
Service ready in N minutes.
Requested action not taken, file name not allowed.
System status, or system help reply.
Requested file action ok.
Data connection already opened, transfer starting.
Encapsulate an IPv4 network address.
Data connection open, no transfer in progress.
Response download(const std::string &remoteFile, const std::string &localPath, TransferMode mode=Binary)
Download a file from the server.
Requested action not taken, file unavailable.
Text mode using ASCII encoding.
Need account for storing files.
Text mode using EBCDIC encoding.
Command not implemented for that parameter.
Status getStatus() const
Get the status code of the response.
File status ok, about to open data connection.
DirectoryResponse(const Response &response)
Default constructor.
TransferMode
Enumeration of transfer modes.
Response upload(const std::string &localFile, const std::string &remotePath, TransferMode mode=Binary)
Upload a file to the server.
Response(Status code=InvalidResponse, const std::string &message="")
Default constructor.
Closing data connection, requested file action successful.
Not part of the FTP standard, generated by cpp3ds when a received response cannot be parsed...
Specialization of FTP response returning a directory.
Service ready for new user.
Connection closed, transfer aborted.
NAME system type, where NAME is an official system name from the list in the Assigned Numbers documen...
bool isOk() const
Check if the status code means a success.
Can't open data connection.
Requested action aborted, page type unknown.
const std::vector< std::string > & getListing() const
Return the array of directory/file names.
Binary mode (file is transfered as a sequence of bytes)
Response parentDirectory()
Go to the parent directory of the current one.
Response login()
Log in using an anonymous account.
Requested file action aborted, exceeded storage allocation.
const std::string & getMessage() const
Get the full message contained in the response.
Response deleteDirectory(const std::string &name)
Remove an existing directory.
Response keepAlive()
Send a null command to keep the connection alive.
Bad sequence of commands.
Requested action not taken; insufficient storage space in system, file unavailable.
Response connect(const IpAddress &server, unsigned short port=21, Time timeout=Time::Zero)
Connect to the specified FTP server.
Requested file action pending further information.
User logged in, proceed. Logged out if appropriate.
Response sendCommand(const std::string &command, const std::string ¶meter="")
Send a command to the FTP server.
Not part of the FTP standard, generated by cpp3ds when a local file cannot be read or written...
Not part of the FTP standard, generated by cpp3ds when the low-level socket connection with the serve...
Requested action aborted, local error in processing.
const std::string & getDirectory() const
Get the directory returned in the response.
User name ok, need password.
Utility class that makes any derived class non-copyable.
Response changeDirectory(const std::string &directory)
Change the current working directory.
Specialized socket using the TCP protocol.
ListingResponse(const Response &response, const std::string &data)
Default constructor.
Response renameFile(const std::string &file, const std::string &newName)
Rename an existing file.
Response disconnect()
Close the connection with the server.
Response createDirectory(const std::string &name)
Create a new directory.
Syntax error, command unrecognized.
Service not available, closing control connection.
DirectoryResponse getWorkingDirectory()
Get the current working directory.
Not part of the FTP standard, generated by cpp3ds when the low-level socket connection is unexpectedl...
Specialization of FTP response returning a filename listing.
Response deleteFile(const std::string &name)
Remove an existing file.
Syntax error in parameters or arguments.
Service closing control connection.
Status
Status codes possibly returned by a FTP response.
ListingResponse getDirectoryListing(const std::string &directory="")
Get the contents of the given directory.
Requested file action not taken.
static const Time Zero
Predefined "zero" time value.