ArClientDeleteFileOnServer Class Reference

#include <ArClientFileUtils.h>

List of all members.


Detailed Description

This class will interact with the ArServerFileFromClient and put a file on to the server.

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


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
ArClientBasemyClient
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


Constructor & Destructor Documentation

ArClientDeleteFileOnServer::ArClientDeleteFileOnServer ( ArClientBase client  ) 

Constructor.

ArClientDeleteFileOnServer::~ArClientDeleteFileOnServer (  )  [virtual]

Destructor.


Member Function Documentation

void ArClientDeleteFileOnServer::addFileDeletedCallback ( ArFunctor1< int > *  functor,
ArListPos::Pos  position = ArListPos::LAST 
)

Adds a callback for when we get the desired file (or fail).

void ArClientDeleteFileOnServer::callFileDeletedCallbacks ( int  val  )  [protected]

bool ArClientDeleteFileOnServer::deleteFileFromDirectory ( const char *  directory,
const char *  fileName 
)

Get the file from a directory.

const char * ArClientDeleteFileOnServer::getDirectory ( void   ) 

Gets the directory we're putting to.

const char * ArClientDeleteFileOnServer::getFileName ( void   ) 

Gets the filename we're putting.

ArTime ArClientDeleteFileOnServer::getLastCompletedSend ( void   ) 

Gets the last time we finished putting a file.

ArTime ArClientDeleteFileOnServer::getLastStartedSend ( void   ) 

Gets the last time we started putting a file.

bool ArClientDeleteFileOnServer::isAvailable ( void   ) 

Sees if the server supports what this class needs.

bool ArClientDeleteFileOnServer::isWaitingForReturn ( void   ) 

If we're waiting for completion now.

void ArClientDeleteFileOnServer::netDeleteFile ( ArNetPacket packet  )  [protected]

void ArClientDeleteFileOnServer::remFileDeletedCallback ( ArFunctor1< int > *  functor  ) 

Removes a callback for when we get the desired file (or fail).


Member Data Documentation

ArMutex ArClientDeleteFileOnServer::myCallbackMutex [protected]

ArClientBase* ArClientDeleteFileOnServer::myClient [protected]

ArMutex ArClientDeleteFileOnServer::myDataMutex [protected]

ArFunctor1C<ArClientDeleteFileOnServer, ArNetPacket *> ArClientDeleteFileOnServer::myDeleteFileCB [protected]

std::string ArClientDeleteFileOnServer::myDirectory [protected]

FILE* ArClientDeleteFileOnServer::myFile [protected]

std::list<ArFunctor1<int> *> ArClientDeleteFileOnServer::myFileDeletedCallbacks [protected]

std::string ArClientDeleteFileOnServer::myFileName [protected]

bool ArClientDeleteFileOnServer::myIsWaitingForReturn [protected]

ArTime ArClientDeleteFileOnServer::myLastCompletedSend [protected]

ArTime ArClientDeleteFileOnServer::myLastStartedSend [protected]

std::string ArClientDeleteFileOnServer::myWholeFileName [protected]


The documentation for this class was generated from the following files:
Generated on Fri Jul 31 12:37:28 2009 for ArNetworking by  doxygen 1.4.7