Loading...
Searching...
No Matches
Ftp.hpp
Go to the documentation of this file.
7// In no event will the authors be held liable for any damages arising from the use of this software.
80 RestartMarkerReply = 110,
81 ServiceReadySoon = 120,
82 DataConnectionAlreadyOpened = 125,
83 OpeningDataConnection = 150,
86 Ok = 200,
87 PointlessCommand = 202,
88 SystemStatus = 211,
89 DirectoryStatus = 212,
90 FileStatus = 213,
91 HelpMessage = 214,
92 SystemType = 215,
93 ServiceReady = 220,
94 ClosingConnection = 221,
95 DataConnectionOpened = 225,
96 ClosingDataConnection = 226,
97 EnteringPassiveMode = 227,
98 LoggedIn = 230,
99 FileActionOk = 250,
100 DirectoryOk = 257,
104 NeedPassword = 331,
105 NeedAccountToLogIn = 332,
106 NeedInformation = 350,
110 ServiceUnavailable = 421,
111 DataConnectionUnavailable = 425,
112 TransferAborted = 426,
113 FileActionAborted = 450,
114 LocalError = 451,
115 InsufficientStorageSpace = 452,
119 CommandUnknown = 500,
120 ParametersUnknown = 501,
121 CommandNotImplemented = 502,
122 BadCommandSequence = 503,
123 ParameterNotImplemented = 504,
124 NotLoggedIn = 530,
125 NeedAccountToStore = 532,
126 FileUnavailable = 550,
127 PageTypeUnknown = 551,
128 NotEnoughMemory = 552,
129 FilenameNotAllowed = 553,
132 InvalidResponse = 1000,
133 ConnectionFailed = 1001,
134 ConnectionClosed = 1002,
135 InvalidFile = 1003
295 [[nodiscard]] Response connect(IpAddress server, unsigned short port = 21, Time timeout = Time::Zero);
443 [[nodiscard]] Response renameFile(const std::filesystem::path& file, const std::filesystem::path& newName);
528 [[nodiscard]] Response sendCommand(const std::string& command, const std::string& parameter = "");
Specialization of FTP response returning a directory.
Definition Ftp.hpp:190
DirectoryResponse(const Response &response)
Default constructor.
const std::filesystem::path & getDirectory() const
Get the directory returned in the response.
Specialization of FTP response returning a file name listing.
Definition Ftp.hpp:221
const std::vector< std::string > & getListing() const
Return the array of directory/file names.
ListingResponse(const Response &response, const std::string &data)
Default constructor.
Response(Status code=Status::InvalidResponse, std::string message="")
Default constructor.
const std::string & getMessage() const
Get the full message contained in the response.
@ InvalidResponse
Not part of the FTP standard, generated by SFML when a received response cannot be parsed.
Definition Ftp.hpp:132
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 connect(IpAddress server, unsigned short port=21, Time timeout=Time::Zero)
Connect to the specified FTP server.
DirectoryResponse getWorkingDirectory()
Get the current working directory.
Response changeDirectory(const std::string &directory)
Change the current working directory.
ListingResponse getDirectoryListing(const std::string &directory="")
Get the contents of the given directory.
Response download(const std::filesystem::path &remoteFile, const std::filesystem::path &localPath, TransferMode mode=TransferMode::Binary)
Download a file from the server.
Response renameFile(const std::filesystem::path &file, const std::filesystem::path &newName)
Rename an existing file.
Response login(const std::string &name, const std::string &password)
Log in using a username and a password.
Response upload(const std::filesystem::path &localFile, const std::filesystem::path &remotePath, TransferMode mode=TransferMode::Binary, bool append=false)
Upload a file to the server.
Definition AudioResource.hpp:36