#include <ArClientFileUtils.h>
Public Member Functions | |
void | addFileDeletedCallback (ArFunctor1< int > *functor, ArListPos::Pos position=ArListPos::LAST) |
Adds a callback for when we get the desired file (or fail). | |
ArClientDeleteFileOnServer (ArClientBase *client) | |
Constructor. | |
bool | deleteFileFromDirectory (const char *directory, const char *fileName) |
Get the file from a directory. | |
const char * | getDirectory (void) |
Gets the directory we're putting to. | |
const char * | getFileName (void) |
Gets the filename we're putting. | |
ArTime | getLastCompletedSend (void) |
Gets the last time we finished putting a file. | |
ArTime | getLastStartedSend (void) |
Gets the last time we started putting a file. | |
bool | isAvailable (void) |
Sees if the server supports what this class needs. | |
bool | isWaitingForReturn (void) |
If we're waiting for completion now. | |
void | remFileDeletedCallback (ArFunctor1< int > *functor) |
Removes a callback for when we get the desired file (or fail). | |
virtual | ~ArClientDeleteFileOnServer () |
Destructor. | |
Protected Member Functions | |
void | callFileDeletedCallbacks (int val) |
void | netDeleteFile (ArNetPacket *packet) |
Protected Attributes | |
ArMutex | myCallbackMutex |
ArClientBase * | myClient |
ArMutex | myDataMutex |
ArFunctor1C< ArClientDeleteFileOnServer, ArNetPacket * > | myDeleteFileCB |
std::string | myDirectory |
FILE * | myFile |
std::list< ArFunctor1< int > * > | myFileDeletedCallbacks |
std::string | myFileName |
bool | myIsWaitingForReturn |
ArTime | myLastCompletedSend |
ArTime | myLastStartedSend |
std::string | myWholeFileName |
If you want to find out what files are on the server use ArClientFileLister.
When get a file it doesn't happen right away, but when the file is received (or failes) the fileGotten callbacks will be called, 0 as the int for the callback means everything is good, positive error messages are from the server (0 = good (got file), 1 = getting file, 2 = tried to go outside allowed area, 3 = bad directory, 4 = empty file name (or other problem with fileName), 5 = can't write temp file, 6 = error moving file from temp to perm, 7 = another client putting file, 8 = timeout (no activity for 15 seconds) and another client wanted to put the file, 9 = client adding to, finishing, or canceling a file the server doesn't have), negative would be from this class but there aren't any of those yet
Definition at line 313 of file ArClientFileUtils.h.
|
Constructor.
Definition at line 928 of file ArClientFileUtils.cpp. References ArClientBase::addHandler(), client, myClient, myDeleteFileCB, and myIsWaitingForReturn. |
|
Destructor.
Definition at line 937 of file ArClientFileUtils.cpp. |
|
Adds a callback for when we get the desired file (or fail).
Definition at line 1045 of file ArClientFileUtils.cpp. References ArMutex::lock(), ArLog::log(), myCallbackMutex, myFileDeletedCallbacks, and ArMutex::unlock(). |
|
Definition at line 1067 of file ArClientFileUtils.cpp. References ArMutex::lock(), myCallbackMutex, myFileDeletedCallbacks, and ArMutex::unlock(). Referenced by netDeleteFile(). |
|
Get the file from a directory.
Definition at line 947 of file ArClientFileUtils.cpp. References ArUtil::appendSlash(), ArNetPacket::empty(), ArUtil::fixSlashes(), isAvailable(), ArMutex::lock(), ArLog::log(), myClient, myDataMutex, myDirectory, myFileName, myIsWaitingForReturn, myLastStartedSend, myWholeFileName, ArClientBase::requestOnce(), ArTime::setToNow(), ArBasePacket::strToBuf(), and ArMutex::unlock(). |
|
Gets the directory we're putting to.
Definition at line 1079 of file ArClientFileUtils.cpp. References ArMutex::lock(), myDataMutex, myDirectory, and ArMutex::unlock(). |
|
Gets the filename we're putting.
Definition at line 1088 of file ArClientFileUtils.cpp. References ArMutex::lock(), myDataMutex, myFileName, and ArMutex::unlock(). |
|
Gets the last time we finished putting a file.
Definition at line 1106 of file ArClientFileUtils.cpp. References ArMutex::lock(), myDataMutex, myLastCompletedSend, and ArMutex::unlock(). |
|
Gets the last time we started putting a file.
Definition at line 1115 of file ArClientFileUtils.cpp. References ArMutex::lock(), myDataMutex, myLastStartedSend, and ArMutex::unlock(). |
|
Sees if the server supports what this class needs.
Definition at line 942 of file ArClientFileUtils.cpp. References ArClientBase::dataExists(), and myClient. Referenced by deleteFileFromDirectory(). |
|
If we're waiting for completion now.
Definition at line 1097 of file ArClientFileUtils.cpp. References ArMutex::lock(), myDataMutex, myIsWaitingForReturn, and ArMutex::unlock(). |
|
Definition at line 1025 of file ArClientFileUtils.cpp. References callFileDeletedCallbacks(), ArMutex::lock(), myDataMutex, myIsWaitingForReturn, and ArMutex::unlock(). |
|
Removes a callback for when we get the desired file (or fail).
Definition at line 1059 of file ArClientFileUtils.cpp. References ArMutex::lock(), myCallbackMutex, myFileDeletedCallbacks, and ArMutex::unlock(). |
|
Definition at line 344 of file ArClientFileUtils.h. Referenced by addFileDeletedCallback(), callFileDeletedCallbacks(), and remFileDeletedCallback(). |
|
Definition at line 345 of file ArClientFileUtils.h. Referenced by ArClientDeleteFileOnServer(), deleteFileFromDirectory(), and isAvailable(). |
|
Definition at line 343 of file ArClientFileUtils.h. Referenced by deleteFileFromDirectory(), getDirectory(), getFileName(), getLastCompletedSend(), getLastStartedSend(), isWaitingForReturn(), and netDeleteFile(). |
|
Definition at line 354 of file ArClientFileUtils.h. Referenced by ArClientDeleteFileOnServer(). |
|
Definition at line 347 of file ArClientFileUtils.h. Referenced by deleteFileFromDirectory(), and getDirectory(). |
|
Definition at line 350 of file ArClientFileUtils.h. |
|
Definition at line 353 of file ArClientFileUtils.h. Referenced by addFileDeletedCallback(), callFileDeletedCallbacks(), and remFileDeletedCallback(). |
|
Definition at line 348 of file ArClientFileUtils.h. Referenced by deleteFileFromDirectory(), and getFileName(). |
|
Definition at line 346 of file ArClientFileUtils.h. Referenced by ArClientDeleteFileOnServer(), deleteFileFromDirectory(), isWaitingForReturn(), and netDeleteFile(). |
|
Definition at line 352 of file ArClientFileUtils.h. Referenced by getLastCompletedSend(). |
|
Definition at line 351 of file ArClientFileUtils.h. Referenced by deleteFileFromDirectory(), and getLastStartedSend(). |
|
Definition at line 349 of file ArClientFileUtils.h. Referenced by deleteFileFromDirectory(). |