import "sbIFileScan.idl";
Public Member Functions | |
void | setDirectory (in AString strDirectory) |
Set the directory to scan. | |
AString | getDirectory () |
Get the directory to scan. | |
void | setRecurse (in PRBool bRecurse) |
Set the scan to run recursively under the given directory. | |
PRBool | getRecurse () |
Whether or not the scan will run recursively. | |
void | setCallback (in sbIFileScanCallback pCallback) |
Set the callback object for the scan. | |
sbIFileScanCallback | getCallback () |
Get the callback object for the scan. | |
PRUint32 | getFileCount () |
Get the number of files found. | |
void | addFilePath (in AString strFilePath) |
USER CODE SHOULD NOT REFERENCE THIS METHOD. | |
AString | getFilePath (in PRUint32 nIndex) |
Get the N'th file from the results of the scan. | |
PRBool | isScanning () |
Whether or not the scan operation is executing. | |
void | setIsScanning (in PRBool bIsScanning) |
USER CODE SHOULD NOT REFERENCE THIS METHOD. | |
AString | getLastFileFound () |
Returns the most recent file found by the scan. | |
AString | getCurrentScanPath () |
Returns the most recent directory scanned. | |
void | setCurrentScanPath (in AString strScanPath) |
USER CODE SHOULD NOT REFERENCE THIS METHOD. | |
void | cancel () |
Cancel the current scanning loop. | |
PRBool | isCancelled () |
USER CODE SHOULD NOT REFERENCE THIS METHOD. | |
Public Attributes | |
attribute boolean | searchHidden |
This object is used to rapidly gather a list of all the files found under a given directory path. It runs from a separate thread.
User code may call getCurrentScanPath() and getLastFileFound() from the main thread to get a periodic snapshot of the current progress of the scan.
Execute a scan by creating a scan query, filling it out, and passing it to the sbIFileScan interface for processing:
function ScanBeneathADirectory(aPath) { // Create the objects var aFileScan = Components.classes["@songbirdnest.com/Songbird/FileScan;1"] .createInstance(Components.interfaces.sbIFileScan); var aFileScanQuery = Components.classes["@songbirdnest.com/Songbird/FileScanQuery;1"] .createInstance(Components.interfaces.sbIFileScanQuery); // Setup the query aFileScanQuery.setDirectory(aPath); aFileScanQuery.setRecurse(true); // Execute the query aFileScan.submitQuery(aFileScanQuery); return aFileScanQuery; }
Definition at line 117 of file sbIFileScan.idl.
void sbIFileScanQuery::setDirectory | ( | in AString | strDirectory | ) |
Set the directory to scan.
strDirectory | The directory to scan |
AString sbIFileScanQuery::getDirectory | ( | ) |
Get the directory to scan.
void sbIFileScanQuery::setRecurse | ( | in PRBool | bRecurse | ) |
Set the scan to run recursively under the given directory.
bRecurse | If true, scan subdirectories |
PRBool sbIFileScanQuery::getRecurse | ( | ) |
Whether or not the scan will run recursively.
void sbIFileScanQuery::setCallback | ( | in sbIFileScanCallback | pCallback | ) |
Set the callback object for the scan.
pCallback | The callback object |
sbIFileScanCallback sbIFileScanQuery::getCallback | ( | ) |
Get the callback object for the scan.
PRUint32 sbIFileScanQuery::getFileCount | ( | ) |
AString sbIFileScanQuery::getFilePath | ( | in PRUint32 | nIndex | ) |
Get the N'th file from the results of the scan.
Don't call this while isScanning() is true.
nIndex | The index of the files array to retrieve |
PRBool sbIFileScanQuery::isScanning | ( | ) |
Whether or not the scan operation is executing.
AString sbIFileScanQuery::getLastFileFound | ( | ) |
Returns the most recent file found by the scan.
This method may be called while the scan is executing to provide a periodic snapshot of the scan results.
AString sbIFileScanQuery::getCurrentScanPath | ( | ) |
Returns the most recent directory scanned.
This method may be called while the scan is executing to provide a periodic snapshot of the scan results.