shooter/SFML-mingw32/doc/html/classsf_1_1Ftp.html

746 lines
52 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML 2.5.1</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.14 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Ftp.html">Ftp</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classsf_1_1Ftp-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">sf::Ftp Class Reference<div class="ingroups"><a class="el" href="group__network.html">Network module</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>A FTP client.
<a href="classsf_1_1Ftp.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Ftp_8hpp_source.html">Ftp.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for sf::Ftp:</div>
<div class="dyncontent">
<div class="center">
<img src="classsf_1_1Ftp.png" usemap="#sf::Ftp_map" alt=""/>
<map id="sf::Ftp_map" name="sf::Ftp_map">
<area href="classsf_1_1NonCopyable.html" title="Utility class that makes any derived class non-copyable. " alt="sf::NonCopyable" shape="rect" coords="0,0,105,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp_1_1DirectoryResponse.html">DirectoryResponse</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specialization of FTP response returning a directory. <a href="classsf_1_1Ftp_1_1DirectoryResponse.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp_1_1ListingResponse.html">ListingResponse</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specialization of FTP response returning a filename listing. <a href="classsf_1_1Ftp_1_1ListingResponse.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a FTP response. <a href="classsf_1_1Ftp_1_1Response.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a1cd6b89ad23253f6d97e6d4ca4d558cb"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cb">TransferMode</a> { <a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cba6f253b362639fb5e059dc292762a21ee">Binary</a>,
<a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cbac9e544a22dce8ef3177449cb235d15c2">Ascii</a>,
<a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cbabb1e34435231e73c96534c71090be7f4">Ebcdic</a>
}</td></tr>
<tr class="memdesc:a1cd6b89ad23253f6d97e6d4ca4d558cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration of transfer modes. <a href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cb">More...</a><br /></td></tr>
<tr class="separator:a1cd6b89ad23253f6d97e6d4ca4d558cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2edfa8e9009caf27bce74459ae76dc52"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a2edfa8e9009caf27bce74459ae76dc52">~Ftp</a> ()</td></tr>
<tr class="memdesc:a2edfa8e9009caf27bce74459ae76dc52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a2edfa8e9009caf27bce74459ae76dc52">More...</a><br /></td></tr>
<tr class="separator:a2edfa8e9009caf27bce74459ae76dc52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af02fb3de3f450a50a27981961c69c860"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#af02fb3de3f450a50a27981961c69c860">connect</a> (const <a class="el" href="classsf_1_1IpAddress.html">IpAddress</a> &amp;server, unsigned short port=21, <a class="el" href="classsf_1_1Time.html">Time</a> timeout=<a class="el" href="classsf_1_1Time.html#a8db127b632fa8da21550e7282af11fa0">Time::Zero</a>)</td></tr>
<tr class="memdesc:af02fb3de3f450a50a27981961c69c860"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to the specified FTP server. <a href="#af02fb3de3f450a50a27981961c69c860">More...</a><br /></td></tr>
<tr class="separator:af02fb3de3f450a50a27981961c69c860"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf7459926f3391cd06bf84337ed6a0f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#acf7459926f3391cd06bf84337ed6a0f4">disconnect</a> ()</td></tr>
<tr class="memdesc:acf7459926f3391cd06bf84337ed6a0f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close the connection with the server. <a href="#acf7459926f3391cd06bf84337ed6a0f4">More...</a><br /></td></tr>
<tr class="separator:acf7459926f3391cd06bf84337ed6a0f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a686262bc377584cd50e52e1576aa3a9b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a686262bc377584cd50e52e1576aa3a9b">login</a> ()</td></tr>
<tr class="memdesc:a686262bc377584cd50e52e1576aa3a9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Log in using an anonymous account. <a href="#a686262bc377584cd50e52e1576aa3a9b">More...</a><br /></td></tr>
<tr class="separator:a686262bc377584cd50e52e1576aa3a9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99d8114793c1659e9d51d45cecdcd965"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a99d8114793c1659e9d51d45cecdcd965">login</a> (const std::string &amp;name, const std::string &amp;password)</td></tr>
<tr class="memdesc:a99d8114793c1659e9d51d45cecdcd965"><td class="mdescLeft">&#160;</td><td class="mdescRight">Log in using a username and a password. <a href="#a99d8114793c1659e9d51d45cecdcd965">More...</a><br /></td></tr>
<tr class="separator:a99d8114793c1659e9d51d45cecdcd965"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1127d442b4acb2105aa8060a39d04fc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#aa1127d442b4acb2105aa8060a39d04fc">keepAlive</a> ()</td></tr>
<tr class="memdesc:aa1127d442b4acb2105aa8060a39d04fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a null command to keep the connection alive. <a href="#aa1127d442b4acb2105aa8060a39d04fc">More...</a><br /></td></tr>
<tr class="separator:aa1127d442b4acb2105aa8060a39d04fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a79c654fcdd0c81e68c4fa29af3b45e0c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1DirectoryResponse.html">DirectoryResponse</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a79c654fcdd0c81e68c4fa29af3b45e0c">getWorkingDirectory</a> ()</td></tr>
<tr class="memdesc:a79c654fcdd0c81e68c4fa29af3b45e0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current working directory. <a href="#a79c654fcdd0c81e68c4fa29af3b45e0c">More...</a><br /></td></tr>
<tr class="separator:a79c654fcdd0c81e68c4fa29af3b45e0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f37258e461fcb9e2a0655e9df0be4a0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1ListingResponse.html">ListingResponse</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a8f37258e461fcb9e2a0655e9df0be4a0">getDirectoryListing</a> (const std::string &amp;directory=&quot;&quot;)</td></tr>
<tr class="memdesc:a8f37258e461fcb9e2a0655e9df0be4a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the contents of the given directory. <a href="#a8f37258e461fcb9e2a0655e9df0be4a0">More...</a><br /></td></tr>
<tr class="separator:a8f37258e461fcb9e2a0655e9df0be4a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e93488ea6330dd4dd76e428da9bb6d3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a7e93488ea6330dd4dd76e428da9bb6d3">changeDirectory</a> (const std::string &amp;directory)</td></tr>
<tr class="memdesc:a7e93488ea6330dd4dd76e428da9bb6d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the current working directory. <a href="#a7e93488ea6330dd4dd76e428da9bb6d3">More...</a><br /></td></tr>
<tr class="separator:a7e93488ea6330dd4dd76e428da9bb6d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad295cf77f30f9ad07b5c401fd9849189"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#ad295cf77f30f9ad07b5c401fd9849189">parentDirectory</a> ()</td></tr>
<tr class="memdesc:ad295cf77f30f9ad07b5c401fd9849189"><td class="mdescLeft">&#160;</td><td class="mdescRight">Go to the parent directory of the current one. <a href="#ad295cf77f30f9ad07b5c401fd9849189">More...</a><br /></td></tr>
<tr class="separator:ad295cf77f30f9ad07b5c401fd9849189"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a247b84c4b25da37804218c2b748c4787"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a247b84c4b25da37804218c2b748c4787">createDirectory</a> (const std::string &amp;name)</td></tr>
<tr class="memdesc:a247b84c4b25da37804218c2b748c4787"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new directory. <a href="#a247b84c4b25da37804218c2b748c4787">More...</a><br /></td></tr>
<tr class="separator:a247b84c4b25da37804218c2b748c4787"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a8a7ef9144204b5b319c9a4be8806c2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a2a8a7ef9144204b5b319c9a4be8806c2">deleteDirectory</a> (const std::string &amp;name)</td></tr>
<tr class="memdesc:a2a8a7ef9144204b5b319c9a4be8806c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove an existing directory. <a href="#a2a8a7ef9144204b5b319c9a4be8806c2">More...</a><br /></td></tr>
<tr class="separator:a2a8a7ef9144204b5b319c9a4be8806c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f99251d7153e1dc26723e4006deb764"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a8f99251d7153e1dc26723e4006deb764">renameFile</a> (const std::string &amp;file, const std::string &amp;newName)</td></tr>
<tr class="memdesc:a8f99251d7153e1dc26723e4006deb764"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rename an existing file. <a href="#a8f99251d7153e1dc26723e4006deb764">More...</a><br /></td></tr>
<tr class="separator:a8f99251d7153e1dc26723e4006deb764"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8aa272b0eb7769a850006e70fcad370f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a8aa272b0eb7769a850006e70fcad370f">deleteFile</a> (const std::string &amp;name)</td></tr>
<tr class="memdesc:a8aa272b0eb7769a850006e70fcad370f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove an existing file. <a href="#a8aa272b0eb7769a850006e70fcad370f">More...</a><br /></td></tr>
<tr class="separator:a8aa272b0eb7769a850006e70fcad370f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20c1600ec5fd6f5a2ad1429ab8aa5df4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a20c1600ec5fd6f5a2ad1429ab8aa5df4">download</a> (const std::string &amp;remoteFile, const std::string &amp;localPath, <a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cb">TransferMode</a> mode=<a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cba6f253b362639fb5e059dc292762a21ee">Binary</a>)</td></tr>
<tr class="memdesc:a20c1600ec5fd6f5a2ad1429ab8aa5df4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Download a file from the server. <a href="#a20c1600ec5fd6f5a2ad1429ab8aa5df4">More...</a><br /></td></tr>
<tr class="separator:a20c1600ec5fd6f5a2ad1429ab8aa5df4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0402d2cec27a197ffba34c88ffaddeac"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a0402d2cec27a197ffba34c88ffaddeac">upload</a> (const std::string &amp;localFile, const std::string &amp;remotePath, <a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cb">TransferMode</a> mode=<a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cba6f253b362639fb5e059dc292762a21ee">Binary</a>, bool append=false)</td></tr>
<tr class="memdesc:a0402d2cec27a197ffba34c88ffaddeac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Upload a file to the server. <a href="#a0402d2cec27a197ffba34c88ffaddeac">More...</a><br /></td></tr>
<tr class="separator:a0402d2cec27a197ffba34c88ffaddeac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44e095103ecbce175a33eaf0820440ff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Ftp.html#a44e095103ecbce175a33eaf0820440ff">sendCommand</a> (const std::string &amp;command, const std::string &amp;parameter=&quot;&quot;)</td></tr>
<tr class="memdesc:a44e095103ecbce175a33eaf0820440ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a command to the FTP server. <a href="#a44e095103ecbce175a33eaf0820440ff">More...</a><br /></td></tr>
<tr class="separator:a44e095103ecbce175a33eaf0820440ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a8dee57337b6a7e183bfe21d178757b0c"><td class="memItemLeft" align="right" valign="top"><a id="a8dee57337b6a7e183bfe21d178757b0c"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>DataChannel</b></td></tr>
<tr class="separator:a8dee57337b6a7e183bfe21d178757b0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A FTP client. </p>
<p><a class="el" href="classsf_1_1Ftp.html" title="A FTP client. ">sf::Ftp</a> is a very simple FTP client that allows you to communicate with a FTP server.</p>
<p>The FTP protocol allows you to manipulate a remote file system (list files, upload, download, create, remove, ...).</p>
<p>Using the FTP client consists of 4 parts: </p><ul>
<li>Connecting to the FTP server </li>
<li>Logging in (either as a registered user or anonymously) </li>
<li>Sending commands to the server </li>
<li>Disconnecting (this part can be done implicitly by the destructor)</li>
</ul>
<p>Every command returns a FTP response, which contains the status code as well as a message from the server. Some commands such as <a class="el" href="classsf_1_1Ftp.html#a79c654fcdd0c81e68c4fa29af3b45e0c" title="Get the current working directory. ">getWorkingDirectory()</a> and <a class="el" href="classsf_1_1Ftp.html#a8f37258e461fcb9e2a0655e9df0be4a0" title="Get the contents of the given directory. ">getDirectoryListing()</a> return additional data, and use a class derived from <a class="el" href="classsf_1_1Ftp_1_1Response.html" title="Define a FTP response. ">sf::Ftp::Response</a> to provide this data. The most often used commands are directly provided as member functions, but it is also possible to use specific commands with the <a class="el" href="classsf_1_1Ftp.html#a44e095103ecbce175a33eaf0820440ff" title="Send a command to the FTP server. ">sendCommand()</a> function.</p>
<p>Note that response statuses &gt;= 1000 are not part of the FTP standard, they are generated by SFML when an internal error occurs.</p>
<p>All commands, especially upload and download, may take some time to complete. This is important to know if you don't want to block your application while the server is completing the task.</p>
<p>Usage example: </p><div class="fragment"><div class="line"><span class="comment">// Create a new FTP client</span></div><div class="line"><a class="code" href="classsf_1_1Ftp.html">sf::Ftp</a> ftp;</div><div class="line"></div><div class="line"><span class="comment">// Connect to the server</span></div><div class="line"><a class="code" href="classsf_1_1Ftp_1_1Response.html">sf::Ftp::Response</a> response = ftp.<a class="code" href="classsf_1_1Ftp.html#af02fb3de3f450a50a27981961c69c860">connect</a>(<span class="stringliteral">&quot;ftp://ftp.myserver.com&quot;</span>);</div><div class="line"><span class="keywordflow">if</span> (response.<a class="code" href="classsf_1_1Ftp_1_1Response.html#a5102552955a2652c1a39e9046e617b36">isOk</a>())</div><div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Connected&quot;</span> &lt;&lt; std::endl;</div><div class="line"></div><div class="line"><span class="comment">// Log in</span></div><div class="line">response = ftp.<a class="code" href="classsf_1_1Ftp.html#a686262bc377584cd50e52e1576aa3a9b">login</a>(<span class="stringliteral">&quot;laurent&quot;</span>, <span class="stringliteral">&quot;dF6Zm89D&quot;</span>);</div><div class="line"><span class="keywordflow">if</span> (response.<a class="code" href="classsf_1_1Ftp_1_1Response.html#a5102552955a2652c1a39e9046e617b36">isOk</a>())</div><div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Logged in&quot;</span> &lt;&lt; std::endl;</div><div class="line"></div><div class="line"><span class="comment">// Print the working directory</span></div><div class="line"><a class="code" href="classsf_1_1Ftp_1_1DirectoryResponse.html">sf::Ftp::DirectoryResponse</a> directory = ftp.<a class="code" href="classsf_1_1Ftp.html#a79c654fcdd0c81e68c4fa29af3b45e0c">getWorkingDirectory</a>();</div><div class="line"><span class="keywordflow">if</span> (directory.<a class="code" href="classsf_1_1Ftp_1_1Response.html#a5102552955a2652c1a39e9046e617b36">isOk</a>())</div><div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Working directory: &quot;</span> &lt;&lt; directory.<a class="code" href="classsf_1_1Ftp_1_1DirectoryResponse.html#a311575c5c50905219025acfa73de67e2">getDirectory</a>() &lt;&lt; std::endl;</div><div class="line"></div><div class="line"><span class="comment">// Create a new directory</span></div><div class="line">response = ftp.<a class="code" href="classsf_1_1Ftp.html#a247b84c4b25da37804218c2b748c4787">createDirectory</a>(<span class="stringliteral">&quot;files&quot;</span>);</div><div class="line"><span class="keywordflow">if</span> (response.<a class="code" href="classsf_1_1Ftp_1_1Response.html#a5102552955a2652c1a39e9046e617b36">isOk</a>())</div><div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Created new directory&quot;</span> &lt;&lt; std::endl;</div><div class="line"></div><div class="line"><span class="comment">// Upload a file to this new directory</span></div><div class="line">response = ftp.<a class="code" href="classsf_1_1Ftp.html#a0402d2cec27a197ffba34c88ffaddeac">upload</a>(<span class="stringliteral">&quot;local-path/file.txt&quot;</span>, <span class="stringliteral">&quot;files&quot;</span>, <a class="code" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cbac9e544a22dce8ef3177449cb235d15c2">sf::Ftp::Ascii</a>);</div><div class="line"><span class="keywordflow">if</span> (response.<a class="code" href="classsf_1_1Ftp_1_1Response.html#a5102552955a2652c1a39e9046e617b36">isOk</a>())</div><div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;File uploaded&quot;</span> &lt;&lt; std::endl;</div><div class="line"></div><div class="line"><span class="comment">// Send specific commands (here: FEAT to list supported FTP features)</span></div><div class="line">response = ftp.<a class="code" href="classsf_1_1Ftp.html#a44e095103ecbce175a33eaf0820440ff">sendCommand</a>(<span class="stringliteral">&quot;FEAT&quot;</span>);</div><div class="line"><span class="keywordflow">if</span> (response.<a class="code" href="classsf_1_1Ftp_1_1Response.html#a5102552955a2652c1a39e9046e617b36">isOk</a>())</div><div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Feature list:\n&quot;</span> &lt;&lt; response.<a class="code" href="classsf_1_1Ftp_1_1Response.html#a4af82a0b3620c90558390e1f600abc05">getMessage</a>() &lt;&lt; std::endl;</div><div class="line"></div><div class="line"><span class="comment">// Disconnect from the server (optional)</span></div><div class="line">ftp.<a class="code" href="classsf_1_1Ftp.html#acf7459926f3391cd06bf84337ed6a0f4">disconnect</a>();</div></div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="Ftp_8hpp_source.html#l00047">47</a> of file <a class="el" href="Ftp_8hpp_source.html">Ftp.hpp</a>.</p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a1cd6b89ad23253f6d97e6d4ca4d558cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1cd6b89ad23253f6d97e6d4ca4d558cb">&#9670;&nbsp;</a></span>TransferMode</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cb">sf::Ftp::TransferMode</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Enumeration of transfer modes. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a1cd6b89ad23253f6d97e6d4ca4d558cba6f253b362639fb5e059dc292762a21ee"></a>Binary&#160;</td><td class="fielddoc"><p>Binary mode (file is transfered as a sequence of bytes) </p>
</td></tr>
<tr><td class="fieldname"><a id="a1cd6b89ad23253f6d97e6d4ca4d558cbac9e544a22dce8ef3177449cb235d15c2"></a>Ascii&#160;</td><td class="fielddoc"><p><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target. ">Text</a> mode using ASCII encoding. </p>
</td></tr>
<tr><td class="fieldname"><a id="a1cd6b89ad23253f6d97e6d4ca4d558cbabb1e34435231e73c96534c71090be7f4"></a>Ebcdic&#160;</td><td class="fielddoc"><p><a class="el" href="classsf_1_1Text.html" title="Graphical text that can be drawn to a render target. ">Text</a> mode using EBCDIC encoding. </p>
</td></tr>
</table>
<p class="definition">Definition at line <a class="el" href="Ftp_8hpp_source.html#l00055">55</a> of file <a class="el" href="Ftp_8hpp_source.html">Ftp.hpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a2edfa8e9009caf27bce74459ae76dc52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2edfa8e9009caf27bce74459ae76dc52">&#9670;&nbsp;</a></span>~Ftp()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Ftp::~Ftp </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
<p>Automatically closes the connection with the server if it is still opened. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7e93488ea6330dd4dd76e428da9bb6d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e93488ea6330dd4dd76e428da9bb6d3">&#9670;&nbsp;</a></span>changeDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::changeDirectory </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>directory</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Change the current working directory. </p>
<p>The new directory must be relative to the current one.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">directory</td><td>New working directory</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a79c654fcdd0c81e68c4fa29af3b45e0c" title="Get the current working directory. ">getWorkingDirectory</a>, <a class="el" href="classsf_1_1Ftp.html#a8f37258e461fcb9e2a0655e9df0be4a0" title="Get the contents of the given directory. ">getDirectoryListing</a>, <a class="el" href="classsf_1_1Ftp.html#ad295cf77f30f9ad07b5c401fd9849189" title="Go to the parent directory of the current one. ">parentDirectory</a> </dd></dl>
</div>
</div>
<a id="af02fb3de3f450a50a27981961c69c860"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af02fb3de3f450a50a27981961c69c860">&#9670;&nbsp;</a></span>connect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::connect </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1IpAddress.html">IpAddress</a> &amp;&#160;</td>
<td class="paramname"><em>server</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned short&#160;</td>
<td class="paramname"><em>port</em> = <code>21</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td>
<td class="paramname"><em>timeout</em> = <code><a class="el" href="classsf_1_1Time.html#a8db127b632fa8da21550e7282af11fa0">Time::Zero</a></code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Connect to the specified FTP server. </p>
<p>The port has a default value of 21, which is the standard port used by the FTP protocol. You shouldn't use a different value, unless you really know what you do. This function tries to connect to the server so it may take a while to complete, especially if the server is not reachable. To avoid blocking your application for too long, you can use a timeout. The default value, <a class="el" href="classsf_1_1Time.html#a8db127b632fa8da21550e7282af11fa0" title="Predefined &quot;zero&quot; time value. ">Time::Zero</a>, means that the system timeout will be used (which is usually pretty long).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">server</td><td>Name or address of the FTP server to connect to </td></tr>
<tr><td class="paramname">port</td><td>Port used for the connection </td></tr>
<tr><td class="paramname">timeout</td><td>Maximum time to wait</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#acf7459926f3391cd06bf84337ed6a0f4" title="Close the connection with the server. ">disconnect</a> </dd></dl>
</div>
</div>
<a id="a247b84c4b25da37804218c2b748c4787"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a247b84c4b25da37804218c2b748c4787">&#9670;&nbsp;</a></span>createDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::createDirectory </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a new directory. </p>
<p>The new directory is created as a child of the current working directory.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>Name of the directory to create</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a2a8a7ef9144204b5b319c9a4be8806c2" title="Remove an existing directory. ">deleteDirectory</a> </dd></dl>
</div>
</div>
<a id="a2a8a7ef9144204b5b319c9a4be8806c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a8a7ef9144204b5b319c9a4be8806c2">&#9670;&nbsp;</a></span>deleteDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::deleteDirectory </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Remove an existing directory. </p>
<p>The directory to remove must be relative to the current working directory. Use this function with caution, the directory will be removed permanently!</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>Name of the directory to remove</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a247b84c4b25da37804218c2b748c4787" title="Create a new directory. ">createDirectory</a> </dd></dl>
</div>
</div>
<a id="a8aa272b0eb7769a850006e70fcad370f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8aa272b0eb7769a850006e70fcad370f">&#9670;&nbsp;</a></span>deleteFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::deleteFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Remove an existing file. </p>
<p>The file name must be relative to the current working directory. Use this function with caution, the file will be removed permanently!</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>File to remove</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a8f99251d7153e1dc26723e4006deb764" title="Rename an existing file. ">renameFile</a> </dd></dl>
</div>
</div>
<a id="acf7459926f3391cd06bf84337ed6a0f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf7459926f3391cd06bf84337ed6a0f4">&#9670;&nbsp;</a></span>disconnect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::disconnect </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Close the connection with the server. </p>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#af02fb3de3f450a50a27981961c69c860" title="Connect to the specified FTP server. ">connect</a> </dd></dl>
</div>
</div>
<a id="a20c1600ec5fd6f5a2ad1429ab8aa5df4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20c1600ec5fd6f5a2ad1429ab8aa5df4">&#9670;&nbsp;</a></span>download()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::download </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>remoteFile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>localPath</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cb">TransferMode</a>&#160;</td>
<td class="paramname"><em>mode</em> = <code><a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cba6f253b362639fb5e059dc292762a21ee">Binary</a></code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Download a file from the server. </p>
<p>The filename of the distant file is relative to the current working directory of the server, and the local destination path is relative to the current directory of your application. If a file with the same filename as the distant file already exists in the local destination path, it will be overwritten.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">remoteFile</td><td>Filename of the distant file to download </td></tr>
<tr><td class="paramname">localPath</td><td>The directory in which to put the file on the local computer </td></tr>
<tr><td class="paramname">mode</td><td>Transfer mode</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a0402d2cec27a197ffba34c88ffaddeac" title="Upload a file to the server. ">upload</a> </dd></dl>
</div>
</div>
<a id="a8f37258e461fcb9e2a0655e9df0be4a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f37258e461fcb9e2a0655e9df0be4a0">&#9670;&nbsp;</a></span>getDirectoryListing()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1ListingResponse.html">ListingResponse</a> sf::Ftp::getDirectoryListing </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>directory</em> = <code>&quot;&quot;</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the contents of the given directory. </p>
<p>This function retrieves the sub-directories and files contained in the given directory. It is not recursive. The <em>directory</em> parameter is relative to the current working directory.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">directory</td><td>Directory to list</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a79c654fcdd0c81e68c4fa29af3b45e0c" title="Get the current working directory. ">getWorkingDirectory</a>, <a class="el" href="classsf_1_1Ftp.html#a7e93488ea6330dd4dd76e428da9bb6d3" title="Change the current working directory. ">changeDirectory</a>, <a class="el" href="classsf_1_1Ftp.html#ad295cf77f30f9ad07b5c401fd9849189" title="Go to the parent directory of the current one. ">parentDirectory</a> </dd></dl>
</div>
</div>
<a id="a79c654fcdd0c81e68c4fa29af3b45e0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79c654fcdd0c81e68c4fa29af3b45e0c">&#9670;&nbsp;</a></span>getWorkingDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1DirectoryResponse.html">DirectoryResponse</a> sf::Ftp::getWorkingDirectory </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the current working directory. </p>
<p>The working directory is the root path for subsequent operations involving directories and/or filenames.</p>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a8f37258e461fcb9e2a0655e9df0be4a0" title="Get the contents of the given directory. ">getDirectoryListing</a>, <a class="el" href="classsf_1_1Ftp.html#a7e93488ea6330dd4dd76e428da9bb6d3" title="Change the current working directory. ">changeDirectory</a>, <a class="el" href="classsf_1_1Ftp.html#ad295cf77f30f9ad07b5c401fd9849189" title="Go to the parent directory of the current one. ">parentDirectory</a> </dd></dl>
</div>
</div>
<a id="aa1127d442b4acb2105aa8060a39d04fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa1127d442b4acb2105aa8060a39d04fc">&#9670;&nbsp;</a></span>keepAlive()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::keepAlive </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send a null command to keep the connection alive. </p>
<p>This command is useful because the server may close the connection automatically if no command is sent.</p>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request </dd></dl>
</div>
</div>
<a id="a686262bc377584cd50e52e1576aa3a9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a686262bc377584cd50e52e1576aa3a9b">&#9670;&nbsp;</a></span>login() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::login </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Log in using an anonymous account. </p>
<p>Logging in is mandatory after connecting to the server. Users that are not logged in cannot perform any operation.</p>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request </dd></dl>
</div>
</div>
<a id="a99d8114793c1659e9d51d45cecdcd965"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a99d8114793c1659e9d51d45cecdcd965">&#9670;&nbsp;</a></span>login() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::login </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>password</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Log in using a username and a password. </p>
<p>Logging in is mandatory after connecting to the server. Users that are not logged in cannot perform any operation.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>User name </td></tr>
<tr><td class="paramname">password</td><td>Password</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request </dd></dl>
</div>
</div>
<a id="ad295cf77f30f9ad07b5c401fd9849189"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad295cf77f30f9ad07b5c401fd9849189">&#9670;&nbsp;</a></span>parentDirectory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::parentDirectory </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Go to the parent directory of the current one. </p>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a79c654fcdd0c81e68c4fa29af3b45e0c" title="Get the current working directory. ">getWorkingDirectory</a>, <a class="el" href="classsf_1_1Ftp.html#a8f37258e461fcb9e2a0655e9df0be4a0" title="Get the contents of the given directory. ">getDirectoryListing</a>, <a class="el" href="classsf_1_1Ftp.html#a7e93488ea6330dd4dd76e428da9bb6d3" title="Change the current working directory. ">changeDirectory</a> </dd></dl>
</div>
</div>
<a id="a8f99251d7153e1dc26723e4006deb764"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f99251d7153e1dc26723e4006deb764">&#9670;&nbsp;</a></span>renameFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::renameFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>file</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>newName</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Rename an existing file. </p>
<p>The filenames must be relative to the current working directory.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file</td><td>File to rename </td></tr>
<tr><td class="paramname">newName</td><td>New name of the file</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a8aa272b0eb7769a850006e70fcad370f" title="Remove an existing file. ">deleteFile</a> </dd></dl>
</div>
</div>
<a id="a44e095103ecbce175a33eaf0820440ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44e095103ecbce175a33eaf0820440ff">&#9670;&nbsp;</a></span>sendCommand()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::sendCommand </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>command</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>parameter</em> = <code>&quot;&quot;</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send a command to the FTP server. </p>
<p>While the most often used commands are provided as member functions in the <a class="el" href="classsf_1_1Ftp.html" title="A FTP client. ">sf::Ftp</a> class, this method can be used to send any FTP command to the server. If the command requires one or more parameters, they can be specified in <em>parameter</em>. If the server returns information, you can extract it from the response using <a class="el" href="classsf_1_1Ftp_1_1Response.html#a4af82a0b3620c90558390e1f600abc05" title="Get the full message contained in the response. ">Response::getMessage()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">command</td><td>Command to send </td></tr>
<tr><td class="paramname">parameter</td><td>Command parameter</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request </dd></dl>
</div>
</div>
<a id="a0402d2cec27a197ffba34c88ffaddeac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0402d2cec27a197ffba34c88ffaddeac">&#9670;&nbsp;</a></span>upload()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Ftp_1_1Response.html">Response</a> sf::Ftp::upload </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>localFile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>remotePath</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cb">TransferMode</a>&#160;</td>
<td class="paramname"><em>mode</em> = <code><a class="el" href="classsf_1_1Ftp.html#a1cd6b89ad23253f6d97e6d4ca4d558cba6f253b362639fb5e059dc292762a21ee">Binary</a></code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>append</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Upload a file to the server. </p>
<p>The name of the local file is relative to the current working directory of your application, and the remote path is relative to the current directory of the FTP server.</p>
<p>The append parameter controls whether the remote file is appended to or overwritten if it already exists.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">localFile</td><td>Path of the local file to upload </td></tr>
<tr><td class="paramname">remotePath</td><td>The directory in which to put the file on the server </td></tr>
<tr><td class="paramname">mode</td><td>Transfer mode </td></tr>
<tr><td class="paramname">append</td><td>Pass true to append to or false to overwrite the remote file if it already exists</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Server response to the request</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Ftp.html#a20c1600ec5fd6f5a2ad1429ab8aa5df4" title="Download a file from the server. ">download</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Ftp_8hpp_source.html">Ftp.hpp</a></li>
</ul>
</div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
</div>
</div>
</body>
</html>