Inheritance diagram for CP_FTP:
Public Types | |
enum | { kCP_FTPPortNumber = 21 } |
enum | CP_E_FTPConnectionState { CP_E_FTPClosed, CP_E_FTPConnected } |
enum | CP_E_FTPTransferType { CP_FTP_UndefinedType = 0, CP_FTP_ASCIIType = 'A', CP_FTP_ImageType = 'I' } |
Public Member Functions | |
CP_E_FTPConnectionState | GetConnectionState () const |
void | SetID (FourCharCode inIdentifier) |
FourCharCode | GetID () |
void | RegisterSignal (const CP_SignalHolder &inSignal) |
CP_DataValueSignal * | FindSignal (const CP_String &inSignalName) |
UInt32 | GetNumberSignals () |
CP_String | GetNthSignalName (UInt32 inSignalIndex) |
void | RegisterSlot (const CP_SlotHolder &inSlot) |
CP_DataValueSlot | FindSlot (const CP_String &inSlotName) |
UInt32 | GetNumberSlots () |
CP_String | GetNthSlotName (UInt32 inSlotIndex) |
template<class R, class P1, class P2> | |
CP_CommandHandlerSignal * | Connect (CPLAT::CP_CommandNo cmd, void(R::*handler)(P1, P2), SInt32 mode) |
template<class R, class P1, class P2> | |
void | Connect (CP_Object *control, const CPLAT::CP_String &signalName, void(R::*handler)(P1, P2)) |
Constructor / Destructor | |
CP_FTP (CP_Socket *inSocketConnection) | |
Constructor. | |
virtual | ~CP_FTP () throw () |
Destructor. | |
Connection | |
void | Connect (const CP_String &inAddress, SInt16 inPortNumber=CP_FTP::kCP_FTPPortNumber) |
Commands - Connection | |
void | Disconnect () |
void | GetList (CP_String &inOutList, const CP_String &inWildcard="") |
Commands - Directory | |
void | ChangeDirectory (const CP_String &inDirectory) |
void | ChangeDirectoryUp () |
CP_String | GetWorkingDirectory () |
void | MakeDirectory (const CP_String &inDirectory) |
void | RemoveDirectory (const CP_String &inDirectory) |
Commands - File | |
void | DeleteFile (const CP_String &inFileName) |
void | GetFile (CP_File *inDestinationFile, const CP_String &inFileName, CP_E_FTPTransferType inTransferType) |
void | PutFile (CP_File *inSourceFile, const CP_String &inDestFileName, CP_E_FTPTransferType inTransferType, bool inCreateUnique) |
void | RenameFile (const CP_String &inOriginalName, const CP_String &inNewName) |
void | RenameFileFrom (const CP_String &inOriginalName) |
void | RenameFileTo (const CP_String &inNewName) |
SInt32 | SendRETR (const CP_String &inFileName) |
void | SendSTOR (const CP_String &inFileName, bool inCreateUnique) |
void | SendTYPE (CP_E_FTPTransferType inTransferType) |
Commands - Misc | |
void | SendPORT (UInt32 inHostNum, SInt16 inPort) |
void | SendQUIT () |
void | SendSYST () |
Getters | |
UInt32 | GetReceiveBufferSize () |
UInt32 | GetSendBufferSize () |
Login | |
void | LogIn (const CP_String &inUser, const CP_String &inPassword) |
Misc | |
CP_Socket * | GetDataPort () |
Setters | |
void | SetReceiveBufferSize (UInt32 inBufferSize) |
void | SetSendBufferSize (UInt32 inBufferSize) |
Static Public Member Functions | |
static void | Connect (CP_Object *sender, const CP_String &signalName, CP_Object *receiver, const CP_String &slotName, const bool reciprocal=false) |
static void | Connect (CP_Object *sender, CP_Object *receiver, const bool reciprocal=false, const CP_String &signalName=kCP_Signal_ValueChanged, const CP_String &slotName=kCP_Slot_SetValue) |
Protected Member Functions | |
File helper | |
void | GetFile_internal (CP_Socket *inSocket, CP_File *inDestinationFile) |
void | PutFile_internal (CP_Socket *inSocket, CP_File *inSourceFile) |
Protected Attributes | |
UInt32 | fReceiveBufferSize |
UInt32 | fSendBufferSize |
CP_E_FTPConnectionState | fConnectionState |
CP_E_FTPTransferType | fTransferType |
CP_Socket * | fSocketConnection |
CP_InternetResponse * | fLastServerResponse |
CP_DataValueSignal | fProgressSignal |
CP_Signals_Array * | fSignals |
CP_Slots_Array * | fSlots |
FourCharCode | fObjectID |
Static Protected Attributes | |
static FourCharCode | fObjectIDCount = 0 |
|
The port number used for this class. |
|
Current state of the FTP connection with the server. |
|
Type of information being transfered. |
|
Constructor.
|
|
Destructor.
|
|
Connect to the FTP server.
|
|
|
|
Disconnect from the FTP server.
|
|
Return a list of the files/directories on the FTP server. NOTE: The passed in inOutList will contain a list of the files from the server appended to the inOutList, so it should be of 0 length on entry.
|
|
Change to the passed in directory.
|
|
Change directory up one level.
|
|
Returns a string that contains the current working directory.
|
|
Make a new directory on the FTP server with the name specified in inDirectory.
|
|
Removes the passed in directory on the FTP server.
|
|
Deletes a file on the FTP server with the passed in file name.
|
|
Retrieve a file from our FTP server. This routine will open a data connection to the FTP server and return the data in the passed in inDestinationFile.
|
|
Put a file on the destination FTP server. This method assumes the file is already open for reading from.
|
|
Renames a file on the FTP server.
|
|
Sends the rename file from command to the FTP server. Called from the above RenameFile.
|
|
Sends the rename file from command to the FTP server. Called from the above RenameFile.
|
|
Sends the RETR command.
|
|
Sends the STOR command.
|
|
Sends the TYPE command.
|
|
Sends the PORT command.
|
|
Sends the QUIT command.
|
|
Sends the SYST command.
|
|
|
|
|
|
Log in to the FTP server using the passed in inUser and inPassword.
|
|
Return a CP_Socket object to be used to communicate with the FTP server over a data port. This is used when we need to establish a new data port connection with the FTP server to send or receive information.
|
|
|
|
|
|
Internal routine used by the GetFile method above to do the actual work of retrieving the file.
|
|
Internal routine to handle putting the file on the FTP server.
|
|
Returns the last server response.
|
|
Broadcast our progress information to any objects that have added themselves as listeners to this object. This will send the signal kCP_Signal_InternetProgress which listeners should connect a slot to.
|
|
Receive the next line from our server. We keep receiving until the end of line is reached.
|
|
Return true if our passed in string is in the form of a 6 part address. (h1,h2,h3,h4,p1,p2)
|
|
Sends a command to the server, but does not wait for a response.
|
|
Send the command, and wait for a response. The response will be placed in the CP_InternetResponse object associated with this object.
|
|
Send data to our socket connection. inData needs to be formatted correctly since we just send the bytes.
|
|
Send data to our socket connection. inData needs to be formatted correctly since we just send the bytes.
|
|
Sets the identifier for this object. If a specific identifier is not set with this function, then a default id is used, which is simply a running count of the number of objects created.
|
|
Returns the objects identifier.
|
|
Registers the signal / signal name contained in the passed in inSignal object.
|
|
Finds the CP_DataValueSignal object that matches the passed in inSignalName.
|
|
Returns the number of signals for this object.
|
|
Returns the signal name of the passed in signal index.
|
|
Registers the slot / slot name contained in the passed in inSlot object.
|
|
Finds the CP_Slot1 object that matches the passed in inSlotName.
|
|
Returns the number of slots for this object.
|
|
Returns the slot name of the passed in signal index.
|
|
|
|
|
|
|
|
|
|
|
|
Size of the buffer to hold received information. |
|
Size of the buffer to hold sent information. |
|
Current state of the connection. |
|
|
|
The CP_Socket object that communicates between CPLAT and the server. |
|
This object contains the last response for the server, each different protocol class will implement its own response class to handle server responses. |
|
|
|
List of registered signals for this object. |
|
List of registered slots for this object. |
|
Object identifier. |