ReplicaNet and RNLobby  1
Public Member Functions | List of all members
ScanChecksum Class Reference

This scans a supplied path and stores the results. More...

#include <ScanChecksum.h>

Inheritance diagram for ScanChecksum:
Inheritance graph
[legend]
Collaboration diagram for ScanChecksum:
Collaboration graph
[legend]

Public Member Functions

bool Start (std::list< ScanPath::Entry > &paths, const bool multiThread=false, const size_t chunkSize=1024 *1024)
 
bool Start (ScanPath::Entry &entry, const size_t chunkSize=1024 *1024)
 
bool Stop (void)
 
bool GetCompleted (void)
 
virtual bool CallbackUpdate (const size_t numFiles, const ScanPath::Entry &currentEntry, const size_t currentBytesScanned)
 
virtual void CallbackComplete (void)
 A virtual callback that is triggered when the scanning is complete.
 

Detailed Description

This scans a supplied path and stores the results.

Member Function Documentation

virtual bool CallbackUpdate ( const size_t  numFiles,
const ScanPath::Entry currentEntry,
const size_t  currentBytesScanned 
)
virtual

A virtual callback that is triggered when the scanning status is updated.

Returns
True allows the scan to continue. False terminates the scan as quickly as possible.
bool GetCompleted ( void  )

Tests the completion state of the last scan.

Returns
A completed scan returns true, a pending scan returns false.
bool Start ( std::list< ScanPath::Entry > &  paths,
const bool  multiThread = false,
const size_t  chunkSize = 1024 *1024 
)

Starts scanning the paths supplied using an optional new thread and generates checksum information for each file. If a scan is already running the previous scan is stopped.

Parameters
pathsThe paths to scan and produce checksum information for.
multiThreadBy default the scan does not use an extra thread. Using true will start a thread to start scanning and Start() will return immediately.
chunkSizeThe number of bytes to use for a file buffer when accessing files. By default this uses a megabyte.
Returns
Success returns true, failure returns false.
bool Stop ( void  )

Stops the current scan if it is running.

Returns
Success returns true, failure returns false.