sbIFileScanQuery Interface Reference

An object to scan through the files of a folder (and optionally subfolders) More...

import"sbIFileScan.idl";

Inheritance diagram for sbIFileScanQuery:
[legend]
Collaboration diagram for sbIFileScanQuery:
[legend]

Public Member Functions

void setDirectory (in AString strDirectory)
 Set the directory to scan. More...
 
AString getDirectory ()
 Get the directory to scan. More...
 
void setRecurse (in PRBool bRecurse)
 Set the scan to run recursively under the given directory. More...
 
PRBool getRecurse ()
 Whether or not the scan will run recursively. More...
 
void addFileExtension (in AString strExtension)
 
void addFlaggedFileExtension (in AString strExtension)
 Add an extension that will not be added to the final discovered paths but will set the |flaggedExtensionsFound| attribute to true if a file with the specified extension is found during the scan. More...
 
void setCallback (in sbIFileScanCallback pCallback)
 Set the callback object for the scan. More...
 
sbIFileScanCallback getCallback ()
 Get the callback object for the scan. More...
 
PRUint32 getFileCount ()
 Get the number of files found. More...
 
PRUint32 getFlaggedFileCount ()
 Get the number of flagged files found. More...
 
void addFilePath (in AString strFilePath)
 USER CODE SHOULD NOT REFERENCE THIS METHOD. More...
 
AString getFilePath (in PRUint32 nIndex)
 Get the N'th file from the results of the scan. More...
 
AString getFlaggedFilePath (in PRUint32 nIndex)
 Get the N'th flagged file from the results of the scan. More...
 
PRBool isScanning ()
 Whether or not the scan operation is executing. More...
 
void setIsScanning (in PRBool bIsScanning)
 USER CODE SHOULD NOT REFERENCE THIS METHOD. More...
 
AString getLastFileFound ()
 Returns the most recent file found by the scan. More...
 
AString getCurrentScanPath ()
 Returns the most recent directory scanned. More...
 
void setCurrentScanPath (in AString strScanPath)
 USER CODE SHOULD NOT REFERENCE THIS METHOD. More...
 
void cancel ()
 Cancel the current scanning loop. More...
 
nsIArray getResultRangeAsURIStrings (in unsigned long aStartIndex, in unsigned long aEndIndex)
 
PRBool isCancelled ()
 USER CODE SHOULD NOT REFERENCE THIS METHOD. More...
 

Public Attributes

attribute boolean searchHidden
 
readonly attribute boolean flaggedExtensionsFound
 Returns true if a flagged file extension set in |addFlaggedFileExtension()| was found during the file scan. More...
 
attribute boolean wantLibraryContentURIs
 

Detailed Description

An object to scan through the files of a folder (and optionally subfolders)

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;
}
See Also
sbIFileScanCallback, sbIFileScan, FileScan.h

Definition at line 117 of file sbIFileScan.idl.

Member Function Documentation

void sbIFileScanQuery::addFileExtension ( in AString  strExtension)
void sbIFileScanQuery::addFilePath ( in AString  strFilePath)

USER CODE SHOULD NOT REFERENCE THIS METHOD.

void sbIFileScanQuery::addFlaggedFileExtension ( in AString  strExtension)

Add an extension that will not be added to the final discovered paths but will set the |flaggedExtensionsFound| attribute to true if a file with the specified extension is found during the scan.

void sbIFileScanQuery::cancel ( )

Cancel the current scanning loop.

sbIFileScanCallback sbIFileScanQuery::getCallback ( )

Get the callback object for the scan.

Returns
The callback object
See Also
sbIFileScanCallback, setCallback
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.

Returns
The path to the last file found
See Also
getLastFileFound, setCurrentScanPath
AString sbIFileScanQuery::getDirectory ( )

Get the directory to scan.

Returns
The directory to scan
See Also
setDirectory, setRecurse, getRecurse
PRUint32 sbIFileScanQuery::getFileCount ( )

Get the number of files found.

Returns
The number of files found
See Also
getFilePath
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.

Parameters
nIndexThe index of the files array to retrieve
See Also
getFileCount
PRUint32 sbIFileScanQuery::getFlaggedFileCount ( )

Get the number of flagged files found.

AString sbIFileScanQuery::getFlaggedFilePath ( in PRUint32  nIndex)

Get the N'th flagged file from the results of the scan.

NOTE: Don't call this while |isScanning()| is true.

Parameters
nIndexthe Index of the files array to retrieve
See Also
getFlaggedFileCount
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.

Returns
The path to the last file found
See Also
getCurrentScanPath
PRBool sbIFileScanQuery::getRecurse ( )

Whether or not the scan will run recursively.

Returns
If true, scan subdirectories
See Also
setDirectory, getDirectory, setRecurse
nsIArray sbIFileScanQuery::getResultRangeAsURIStrings ( in unsigned long  aStartIndex,
in unsigned long  aEndIndex 
)
PRBool sbIFileScanQuery::isCancelled ( )

USER CODE SHOULD NOT REFERENCE THIS METHOD.

PRBool sbIFileScanQuery::isScanning ( )

Whether or not the scan operation is executing.

Returns
True, if the scan is executing
See Also
sbIDatabaseQuery
void sbIFileScanQuery::setCallback ( in sbIFileScanCallback  pCallback)

Set the callback object for the scan.

Parameters
pCallbackThe callback object
See Also
sbIFileScanCallback, getCallback
void sbIFileScanQuery::setCurrentScanPath ( in AString  strScanPath)

USER CODE SHOULD NOT REFERENCE THIS METHOD.

void sbIFileScanQuery::setDirectory ( in AString  strDirectory)

Set the directory to scan.

Parameters
strDirectoryThe directory to scan
See Also
getDirectory, setRecurse, getRecurse
void sbIFileScanQuery::setIsScanning ( in PRBool  bIsScanning)

USER CODE SHOULD NOT REFERENCE THIS METHOD.

void sbIFileScanQuery::setRecurse ( in PRBool  bRecurse)

Set the scan to run recursively under the given directory.

Parameters
bRecurseIf true, scan subdirectories
See Also
setDirectory, getDirectory, getRecurse

Member Data Documentation

readonly attribute boolean sbIFileScanQuery::flaggedExtensionsFound

Returns true if a flagged file extension set in |addFlaggedFileExtension()| was found during the file scan.

Definition at line 166 of file sbIFileScan.idl.

attribute boolean sbIFileScanQuery::searchHidden

Definition at line 119 of file sbIFileScan.idl.

attribute boolean sbIFileScanQuery::wantLibraryContentURIs

If true, URLs are preprocessed to become library content URIs (ie, lowercase on win32). Default is TRUE.

Definition at line 282 of file sbIFileScan.idl.


The documentation for this interface was generated from the following file: