ReplicaNet and RNLobby
1
|
This scans a supplied path and stores the results. More...
#include <ScanPath.h>
Classes | |
struct | Entry |
An entry in the list updated by ScanPath::Start() More... | |
struct | FileChecksum |
Public Member Functions | |
bool | Start (const char *path, std::list< Entry > &result, const bool recurse=false, const bool justFiles=true, const bool multiThread=false) |
bool | Stop (void) |
bool | GetCompleted (void) |
virtual bool | CallbackUpdate (const size_t numFiles, const size_t numFolders) |
virtual void | CallbackComplete (void) |
A virtual callback that is triggered when the scanning is complete. | |
Static Public Member Functions | |
static bool | Write (const char *path, const std::list< Entry > &entries) |
A utility function to write the entries to a file. | |
static bool | Read (const char *path, std::list< Entry > &entries) |
A utility function to read the entries from a file. | |
This scans a supplied path and stores the results.
|
virtual |
A virtual callback that is triggered when the scanning status is updated.
bool GetCompleted | ( | void | ) |
Tests the completion state of the last scan.
bool Start | ( | const char * | path, |
std::list< Entry > & | result, | ||
const bool | recurse = false , |
||
const bool | justFiles = true , |
||
const bool | multiThread = false |
||
) |
Starts scanning a path using an optional new thread. If a scan is already running the previous scan is stopped.
path | The path to start scanning from. |
result | The std::list<RNReplicaNet::RNLobby::ScanPath::Entry> to use for storing results of the scan. The result is not cleared when the scan starts allowing results on other scans to be appended to the std::list. To access the result before the scan is finished use pairs of ScanPath::Lock()/UnLock() to lock access to the result variable using the thread mutex. |
recurse | By default recursive scanning of the input path is disabled. |
justFiles | By default only file names are added to the results of the scan. |
multiThread | By default the scan does not use an extra thread. Using true will start a thread to start scanning and Start() will return immediately. |
bool Stop | ( | void | ) |
Stops the current scan if it is running.