31#include <SFML/Network/Export.hpp>
32#include <SFML/Network/TcpSocket.hpp>
33#include <SFML/System/NonCopyable.hpp>
34#include <SFML/System/Time.hpp>
181 std::string m_message;
213 std::string m_directory;
247 std::vector<std::string> m_listing;
531 friend class DataChannel;
537 std::string m_receiveBuffer;
Specialization of FTP response returning a directory.
DirectoryResponse(const Response &response)
Default constructor.
const std::string & getDirectory() const
Get the directory returned in the response.
Specialization of FTP response returning a filename listing.
const std::vector< std::string > & getListing() const
Return the array of directory/file names.
ListingResponse(const Response &response, const std::string &data)
Default constructor.
bool isOk() const
Check if the status code means a success.
Status getStatus() const
Get the status code of the response.
const std::string & getMessage() const
Get the full message contained in the response.
Response(Status code=InvalidResponse, const std::string &message="")
Default constructor.
Status
Status codes possibly returned by a FTP response.
@ NeedInformation
Requested file action pending further information.
@ FilenameNotAllowed
Requested action not taken, file name not allowed.
@ DirectoryOk
PATHNAME created.
@ RestartMarkerReply
Restart marker reply.
@ NeedAccountToStore
Need account for storing files.
@ ServiceReadySoon
Service ready in N minutes.
@ CommandNotImplemented
Command not implemented.
@ PointlessCommand
Command not implemented.
@ FileUnavailable
Requested action not taken, file unavailable.
@ ServiceUnavailable
Service not available, closing control connection.
@ EnteringPassiveMode
Entering passive mode.
@ ConnectionFailed
Not part of the FTP standard, generated by SFML when the low-level socket connection with the server ...
@ LoggedIn
User logged in, proceed. Logged out if appropriate.
@ InvalidResponse
Not part of the FTP standard, generated by SFML when a received response cannot be parsed.
@ InsufficientStorageSpace
Requested action not taken; insufficient storage space in system, file unavailable.
@ DataConnectionUnavailable
Can't open data connection.
@ CommandUnknown
Syntax error, command unrecognized.
@ SystemType
NAME system type, where NAME is an official system name from the list in the Assigned Numbers documen...
@ OpeningDataConnection
File status ok, about to open data connection.
@ TransferAborted
Connection closed, transfer aborted.
@ HelpMessage
Help message.
@ DirectoryStatus
Directory status.
@ ParameterNotImplemented
Command not implemented for that parameter.
@ NeedPassword
User name ok, need password.
@ SystemStatus
System status, or system help reply.
@ NeedAccountToLogIn
Need account for login.
@ ClosingConnection
Service closing control connection.
@ ClosingDataConnection
Closing data connection, requested file action successful.
@ BadCommandSequence
Bad sequence of commands.
@ ConnectionClosed
Not part of the FTP standard, generated by SFML when the low-level socket connection is unexpectedly ...
@ PageTypeUnknown
Requested action aborted, page type unknown.
@ DataConnectionOpened
Data connection open, no transfer in progress.
@ LocalError
Requested action aborted, local error in processing.
@ ServiceReady
Service ready for new user.
@ InvalidFile
Not part of the FTP standard, generated by SFML when a local file cannot be read or written.
@ NotEnoughMemory
Requested file action aborted, exceeded storage allocation.
@ ParametersUnknown
Syntax error in parameters or arguments.
@ FileActionAborted
Requested file action not taken.
@ FileActionOk
Requested file action ok.
@ DataConnectionAlreadyOpened
Data connection already opened, transfer starting.
@ NotLoggedIn
Not logged in.
Response upload(const std::string &localFile, const std::string &remotePath, TransferMode mode=Binary, bool append=false)
Upload a file to the server.
TransferMode
Enumeration of transfer modes.
@ Binary
Binary mode (file is transfered as a sequence of bytes)
@ Ebcdic
Text mode using EBCDIC encoding.
@ Ascii
Text mode using ASCII encoding.
Response download(const std::string &remoteFile, const std::string &localPath, TransferMode mode=Binary)
Download a file from the server.
Response createDirectory(const std::string &name)
Create a new directory.
Response deleteDirectory(const std::string &name)
Remove an existing directory.
Response sendCommand(const std::string &command, const std::string ¶meter="")
Send a command to the FTP server.
Response login()
Log in using an anonymous account.
DirectoryResponse getWorkingDirectory()
Get the current working directory.
Response changeDirectory(const std::string &directory)
Change the current working directory.
Response deleteFile(const std::string &name)
Remove an existing file.
ListingResponse getDirectoryListing(const std::string &directory="")
Get the contents of the given directory.
Response renameFile(const std::string &file, const std::string &newName)
Rename an existing file.
Response login(const std::string &name, const std::string &password)
Log in using a username and a password.
Response keepAlive()
Send a null command to keep the connection alive.
Response disconnect()
Close the connection with the server.
Response parentDirectory()
Go to the parent directory of the current one.
Response connect(const IpAddress &server, unsigned short port=21, Time timeout=Time::Zero)
Connect to the specified FTP server.
Encapsulate an IPv4 network address.
NonCopyable()
Default constructor.
Specialized socket using the TCP protocol.
static const Time Zero
Predefined "zero" time value.