mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 05:26:13 +01:00
Merge pull request #88 from BlaXpirit/feature/ftp_sendcommand
Added sfFtp_sendCommand
This commit is contained in:
commit
d91b8d0dfb
2 files changed
+29
No files matched your search
@@ -506,5 +506,25 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantF
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
|
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Send a command to the FTP server
|
||||||
|
///
|
||||||
|
/// While the most often used commands are provided as
|
||||||
|
/// specific functions, this function can be used to send
|
||||||
|
/// any FTP command to the server. If the command requires
|
||||||
|
/// one or more parameters, they can be specified in
|
||||||
|
/// \a parameter. Otherwise you should pass NULL.
|
||||||
|
/// If the server returns information, you can extract it
|
||||||
|
/// from the response using sfResponse_getMessage().
|
||||||
|
///
|
||||||
|
/// \param ftp Ftp object
|
||||||
|
/// \param command Command to send
|
||||||
|
/// \param parameter Command parameter
|
||||||
|
///
|
||||||
|
/// \return Server response to the request
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_NETWORK_API sfFtpResponse* sfFtp_sendCommand(sfFtp* ftp, const char* command, const char* parameter);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_FTP_H
|
#endif // SFML_FTP_H
|
||||||
@@ -307,3 +307,12 @@ sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destP
|
|||||||
destPath ? destPath : "",
|
destPath ? destPath : "",
|
||||||
static_cast<sf::Ftp::TransferMode>(mode)));
|
static_cast<sf::Ftp::TransferMode>(mode)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfFtpResponse* sfFtp_sendCommand(sfFtp* ftp, const char* command, const char* parameter)
|
||||||
|
{
|
||||||
|
CSFML_CHECK_RETURN(ftp, NULL);
|
||||||
|
|
||||||
|
return new sfFtpResponse(ftp->This.sendCommand(command ? command : "", parameter ? parameter : ""));
|
||||||
|
}
|
||||||
Reference in new issue
Block a user