#include <ArClientFileUtils.h>
This class will interact with the ArServerFileLister and find out whats in directories and change directories and such. This class is all that should be used to get the information from ArServerFileLister, the API between the two is fairly volatile and will remain so. If you need more functionality let us know and we'll add it if its reasonable.
When you change directories or change to the top dir it doesn't happen right away, but when it happens the update callbacks will be called, 0 as the int for the callback means everything is good, positive error messages are from the server (1 == tried to go outside allowed area, 2 == no such directory), negative are from this class (-1 == got directory but it wasn't what we wanted (if you wait the right one might come in, like if someone selects one dir then the other)).
Public Member Functions | |
void | addUpdatedCallback (ArFunctor1< int > *functor, ArListPos::Pos position=ArListPos::LAST) |
Adds a callback for when we get the desired directory info. | |
ArClientFileLister (ArClientBase *client) | |
Constructor. | |
void | changeToAbsDir (const char *dir) |
Goes to this absolute directory. | |
void | changeToDir (const char *dir) |
Goes to this directory in the current directory. | |
void | changeToTopDir (void) |
Goes to the top directory. | |
const char * | getCurrentDir (void) const |
Gets the name of the directory we're in. | |
std::list< ArClientFileListerItem > | getDirectories (void) const |
Gets the directories in the current directory. | |
std::list< ArClientFileListerItem > | getFiles (void) const |
Gets the files in the current directory. | |
ArTime | getLastRequested (void) |
Gets the last time we requested an update. | |
ArTime | getLastUpdated (void) |
Gets the last time we were updated. | |
const char * | getWaitingForDir (void) const |
Gets the name of the directory that we're currently waiting for. | |
bool | isAvailable (void) |
Sees if the server supports what this class needs. | |
void | log (bool withTimes) |
Logs the current directory. | |
void | remUpdatedCallback (ArFunctor1< int > *functor) |
Removes a callback for when we get the desired directory info. | |
void | upOneDir (void) |
Goes up one directory from current directory. | |
virtual | ~ArClientFileLister () |
Destructor. | |
Protected Member Functions | |
void | callUpdatedCallbacks (int val) |
void | getDirListing (const char *dir) |
void | logList (std::list< ArClientFileListerItem > *logThis, bool withTimes) |
void | netGetDirListing (ArNetPacket *packet) |
void | netGetDirListingMultiplePackets (ArNetPacket *packet) |
Protected Attributes | |
ArMutex | myCallbackMutex |
ArClientBase * | myClient |
char | myCurrentDir [2048] |
ArMutex | myDataMutex |
std::list< ArClientFileListerItem > | myDirectories |
std::list< ArClientFileListerItem > | myFiles |
ArFunctor1C< ArClientFileLister, ArNetPacket * > | myGetDirListingCB |
ArFunctor1C< ArClientFileLister, ArNetPacket * > | myGetDirListingMultiplePacketsCB |
bool | myLastDirMatched |
ArTime | myLastRequested |
ArTime | myLastUpdated |
bool | myNewDirListing |
std::list< ArFunctor1< int > * > | myUpdatedCallbacks |
char | myWaitingForDir [2048] |