#include <ArClientFileUtils.h>
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] |
| ArClientFileLister::ArClientFileLister | ( | ArClientBase * | client | ) |
Constructor.
| ArClientFileLister::~ArClientFileLister | ( | ) | [virtual] |
Destructor.
| void ArClientFileLister::addUpdatedCallback | ( | ArFunctor1< int > * | functor, | |
| ArListPos::Pos | position = ArListPos::LAST | |||
| ) |
Adds a callback for when we get the desired directory info.
| void ArClientFileLister::callUpdatedCallbacks | ( | int | val | ) | [protected] |
| void ArClientFileLister::changeToAbsDir | ( | const char * | dir | ) |
Goes to this absolute directory.
| void ArClientFileLister::changeToDir | ( | const char * | dir | ) |
Goes to this directory in the current directory.
| void ArClientFileLister::changeToTopDir | ( | void | ) |
Goes to the top directory.
| const char * ArClientFileLister::getCurrentDir | ( | void | ) | const |
Gets the name of the directory we're in.
| std::list< ArClientFileListerItem > ArClientFileLister::getDirectories | ( | void | ) | const |
Gets the directories in the current directory.
| void ArClientFileLister::getDirListing | ( | const char * | dir | ) | [protected] |
| std::list< ArClientFileListerItem > ArClientFileLister::getFiles | ( | void | ) | const |
Gets the files in the current directory.
| ArTime ArClientFileLister::getLastRequested | ( | void | ) |
Gets the last time we requested an update.
| ArTime ArClientFileLister::getLastUpdated | ( | void | ) |
Gets the last time we were updated.
| const char * ArClientFileLister::getWaitingForDir | ( | void | ) | const |
Gets the name of the directory that we're currently waiting for.
| bool ArClientFileLister::isAvailable | ( | void | ) |
Sees if the server supports what this class needs.
| void ArClientFileLister::log | ( | bool | withTimes | ) |
Logs the current directory.
| void ArClientFileLister::logList | ( | std::list< ArClientFileListerItem > * | logThis, | |
| bool | withTimes | |||
| ) | [protected] |
| void ArClientFileLister::netGetDirListing | ( | ArNetPacket * | packet | ) | [protected] |
| void ArClientFileLister::netGetDirListingMultiplePackets | ( | ArNetPacket * | packet | ) | [protected] |
| void ArClientFileLister::remUpdatedCallback | ( | ArFunctor1< int > * | functor | ) |
Removes a callback for when we get the desired directory info.
| void ArClientFileLister::upOneDir | ( | void | ) |
Goes up one directory from current directory.
ArMutex ArClientFileLister::myCallbackMutex [protected] |
ArClientBase* ArClientFileLister::myClient [protected] |
char ArClientFileLister::myCurrentDir[2048] [protected] |
ArMutex ArClientFileLister::myDataMutex [protected] |
std::list<ArClientFileListerItem> ArClientFileLister::myDirectories [protected] |
std::list<ArClientFileListerItem> ArClientFileLister::myFiles [protected] |
ArFunctor1C<ArClientFileLister, ArNetPacket *> ArClientFileLister::myGetDirListingMultiplePacketsCB [protected] |
bool ArClientFileLister::myLastDirMatched [protected] |
ArTime ArClientFileLister::myLastRequested [protected] |
ArTime ArClientFileLister::myLastUpdated [protected] |
bool ArClientFileLister::myNewDirListing [protected] |
std::list<ArFunctor1<int> *> ArClientFileLister::myUpdatedCallbacks [protected] |
char ArClientFileLister::myWaitingForDir[2048] [protected] |
1.4.7