SFML logo
  • Main Page
  • Data Structures
  • Files
  • File List

Ftp.h

00001 
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024 
00025 #ifndef SFML_FTP_H
00026 #define SFML_FTP_H
00027 
00029 // Headers
00031 #include <SFML/Config.h>
00032 #include <SFML/Network/IPAddress.h>
00033 #include <SFML/Network/Types.h>
00034 
00035 
00039 enum sfFtpTransferMode
00040 {
00041     sfFtpBinary, 
00042     sfFtpAscii,  
00043     sfFtpEbcdic  
00044 };
00045 
00046 
00051 enum sfFtpStatus
00052 {
00053     // 1xx: the requested action is being initiated,
00054     // expect another reply before proceeding with a new command
00055     sfFtpRestartMarkerReply          = 110, 
00056     sfFtpServiceReadySoon            = 120, 
00057     sfFtpDataConnectionAlreadyOpened = 125, 
00058     sfFtpOpeningDataConnection       = 150, 
00059 
00060     // 2xx: the requested action has been successfully completed
00061     sfFtpOk                    = 200, 
00062     sfFtpPointlessCommand      = 202, 
00063     sfFtpSystemStatus          = 211, 
00064     sfFtpDirectoryStatus       = 212, 
00065     sfFtpFileStatus            = 213, 
00066     sfFtpHelpMessage           = 214, 
00067     sfFtpSystemType            = 215, 
00068     sfFtpServiceReady          = 220, 
00069     sfFtpClosingConnection     = 221, 
00070     sfFtpDataConnectionOpened  = 225, 
00071     sfFtpClosingDataConnection = 226, 
00072     sfFtpEnteringPassiveMode   = 227, 
00073     sfFtpLoggedIn              = 230, 
00074     sfFtpFileActionOk          = 250, 
00075     sfFtpDirectoryOk           = 257, 
00076 
00077     // 3xx: the command has been accepted, but the requested action
00078     // is dormant, pending receipt of further information
00079     sfFtpNeedPassword       = 331, 
00080     sfFtpNeedAccountToLogIn = 332, 
00081     sfFtpNeedInformation    = 350, 
00082 
00083     // 4xx: the command was not accepted and the requested action did not take place,
00084     // but the error condition is temporary and the action may be requested again
00085     sfFtpServiceUnavailable        = 421, 
00086     sfFtpDataConnectionUnavailable = 425, 
00087     sfFtpTransferAborted           = 426, 
00088     sfFtpFileActionAborted         = 450, 
00089     sfFtpLocalError                = 451, 
00090     sfFtpInsufficientStorageSpace  = 452, 
00091 
00092     // 5xx: the command was not accepted and
00093     // the requested action did not take place
00094     sfFtpCommandUnknown          = 500, 
00095     sfFtpParametersUnknown       = 501, 
00096     sfFtpCommandNotImplemented   = 502, 
00097     sfFtpBadCommandSequence      = 503, 
00098     sfFtpParameterNotImplemented = 504, 
00099     sfFtpNotLoggedIn             = 530, 
00100     sfFtpNeedAccountToStore      = 532, 
00101     sfFtpFileUnavailable         = 550, 
00102     sfFtpPageTypeUnknown         = 551, 
00103     sfFtpNotEnoughMemory         = 552, 
00104     sfFtpFilenameNotAllowed      = 553, 
00105 
00106     // 10xx: SFML custom codes
00107     sfFtpInvalidResponse  = 1000, 
00108     sfFtpConnectionFailed = 1001, 
00109     sfFtpConnectionClosed = 1002, 
00110     sfFtpInvalidFile      = 1003  
00111 };
00112 
00113 
00120 CSFML_API void sfFtpListingResponse_Destroy(sfFtpListingResponse* FtpListingResponse);
00121 
00131 CSFML_API sfBool sfFtpListingResponse_IsOk(sfFtpListingResponse* FtpListingResponse);
00132 
00141 CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* FtpListingResponse);
00142 
00151 CSFML_API const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* FtpListingResponse);
00152 
00161 CSFML_API size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* FtpListingResponse);
00162 
00172 CSFML_API const char* sfFtpListingResponse_GetFilename(sfFtpListingResponse* FtpListingResponse, size_t Index);
00173 
00180 CSFML_API void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* FtpDirectoryResponse);
00181 
00191 CSFML_API sfBool sfFtpDirectoryResponse_IsOk(sfFtpDirectoryResponse* FtpDirectoryResponse);
00192 
00201 CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* FtpDirectoryResponse);
00202 
00211 CSFML_API const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* FtpDirectoryResponse);
00212 
00221 CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* FtpDirectoryResponse);
00222 
00223 
00230 CSFML_API void sfFtpResponse_Destroy(sfFtpResponse* FtpResponse);
00231 
00241 CSFML_API sfBool sfFtpResponse_IsOk(sfFtpResponse* FtpResponse);
00242 
00251 CSFML_API sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* FtpResponse);
00252 
00261 CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* FtpResponse);
00262 
00269 CSFML_API sfFtp* sfFtp_Create();
00270 
00277 CSFML_API void sfFtp_Destroy(sfFtp* Ftp);
00278 
00290 CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* Ftp, sfIPAddress Server, unsigned short Port, float Timeout);
00291 
00300 CSFML_API sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* Ftp);
00301 
00312 CSFML_API sfFtpResponse* sfFtp_Login(sfFtp* Ftp, const char* UserName, const char* Password);
00313 
00322 CSFML_API sfFtpResponse* sfFtp_Disconnect(sfFtp* Ftp);
00323 
00332 CSFML_API sfFtpResponse* sfFtp_KeepAlive(sfFtp* Ftp);
00333 
00342 CSFML_API sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* Ftp);
00343 
00354 CSFML_API sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* Ftp, const char* Directory);
00355 
00365 CSFML_API sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* Ftp, const char* Directory);
00366 
00375 CSFML_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* Ftp);
00376 
00386 CSFML_API sfFtpResponse* sfFtp_MakeDirectory(sfFtp* Ftp, const char* Name);
00387 
00397 CSFML_API sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* Ftp, const char* Name);
00398 
00409 CSFML_API sfFtpResponse* sfFtp_RenameFile(sfFtp* Ftp, const char* File, const char* NewName);
00410 
00420 CSFML_API sfFtpResponse* sfFtp_DeleteFile(sfFtp* Ftp, const char* Name);
00421 
00433 CSFML_API sfFtpResponse* sfFtp_Download(sfFtp* Ftp, const char* DistantFile, const char* DestPath, sfFtpTransferMode Mode);
00434 
00446 CSFML_API sfFtpResponse* sfFtp_Upload(sfFtp* Ftp, const char* LocalFile, const char* DestPath, sfFtpTransferMode Mode);
00447 
00448 
00449 #endif // SFML_FTP_H

 ::  Copyright © 2007-2008 Laurent Gomila, all rights reserved  ::  Documentation generated by doxygen 1.5.2  ::