new Finder(optionsopt)
Core Finder
class. Provides the constructor for applications to instantiate.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
object |
<optional> |
Default options for the
|
- Source:
Properties:
Name | Type | Description |
---|---|---|
options |
object | Easy access to |
type |
string | The type of DeviceStorage specified. |
hidden |
boolean | Boolean specifying whether hidden files will be included in search or not. |
casesensitive |
boolean | Boolean specifying whether searches will be case sensitive or not. |
debugmode |
boolean | Boolean activating or deactivating debug mode. |
storages |
array | Array of device storage cursors based on |
searchcompletecount |
number | Number of device storages searched through in latest search. |
filematchcount |
number | Number of files found in latest search |
searchkey |
string | Search term used in last search |
Example
var finder = new Applait.Finder({ type: "sdcard", debugMode: true });
Methods
-
checkhidden(filename) → {boolean}
-
Match hidden files based on settings
Parameters:
Name Type Description filename
string The filename to test
- Source:
Returns:
true
if file is a hidden file and ifhidden
istrue
in constructor options.
- Type
- boolean
-
log(message, args)
-
Generic logging method, dependent on debugMode
Parameters:
Name Type Description message
string A string identifying this log
args
array An array of stuff to print
- Source:
-
matchname(name) → {boolean}
-
Match name
Parameters:
Name Type Description name
string Filename
- Source:
Returns:
- Type
- boolean
-
reset()
-
Reset internals
- Source:
-
search(needle) → {null}
-
Instantiate search
Parameters:
Name Type Description needle
string The string to match file names from the device storage.
- Source:
Returns:
- Only if
needle
length is less thanminsearchlength
or if no DeviceStorages are found.
- Type
- null
-
splitname(filename) → {object}
-
Splits full file path into basename and path to directory.
Parameters:
Name Type Description filename
string Filename obtained for
File.filename
- Source:
Returns:
An object with two keys:
name
- the basename of the file with extensionpath
- path to the file's directory.
- Type
- object
-
storagecount() → {number}
-
Return the number of storages being used
- Source:
Returns:
- The length of storages
- Type
- number