-
__processError
(error, onError)
private
inherited
-
Name |
Type |
Description |
error |
*
|
Error |
onError |
function
|
optional
Callback function upon completion of an operation with error |
- Since:
-
-
Creates the directory
Returns a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
DKTools.IO.ERROR_DIRECTORY_ALREADY_EXISTS
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.mkdir |
options |
Object
|
optional
Options for FileSystem.mkdir or FileSystem.mkdirSync |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
options.recursive |
Boolean
|
optional
Parent folders should be created |
options.mode |
Number
|
String
|
optional
Directory permission |
|
- Version:
Returns:
Type |
Description |
Number
|
Code of the result of an operation |
Example
const directory = new DKTools.IO.Directory('test/');
const status = directory.create({ sync: true });
if (status === DKTools.IO.OK) {
console.log('created!');
}
-
createAsync
(object)Promise.<Number>
async
-
Creates the directory
Asynchronous version of DKTools.IO.Directory.prototype.create
Promise resolves a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_DIRECTORY_ALREADY_EXISTS
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.mkdir or FileSystem.mkdirSync
Name |
Type |
Description |
recursive |
Boolean
|
optional
Parent folders should be created |
mode |
Number
|
String
|
optional
Directory permission |
|
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<Number>
|
Code of the result of an operation |
Example
const directory = new DKTools.IO.Directory('test/');
const status = await directory.createAsync();
if (status === DKTools.IO.OK) {
console.log('created!');
}
-
createDirectory
(name, object)Number
-
Creates the new directory
Returns a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
DKTools.IO.ERROR_DIRECTORY_ALREADY_EXISTS
Name |
Type |
Description |
name |
String
|
Name of the directory |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.mkdir |
options |
Object
|
optional
Options for FileSystem.mkdir or FileSystem.mkdirSync |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
options.recursive |
Boolean
|
optional
Parent folders should be created |
options.mode |
Number
|
String
|
optional
Directory permission |
|
- Version:
- Since:
Returns:
Type |
Description |
Number
|
Code of the result of an operation |
Example
const directory = new DKTools.IO.Directory('save/');
const status = directory.createDirectory('backup', { sync: true });
if (status === DKTools.IO.OK) {
console.log('created!');
}
-
createDirectoryAsync
(name, object)Promise.<Number>
async
-
Creates the new directory
Asynchronous version of DKTools.IO.Directory.prototype.createDirectory
Promise resolves a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_DIRECTORY_ALREADY_EXISTS
Name |
Type |
Default |
Description |
name |
String
|
|
Name of the directory |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.mkdir or FileSystem.mkdirSync
Name |
Type |
Description |
recursive |
Boolean
|
optional
Parent folders should be created |
mode |
Number
|
String
|
optional
Directory permission |
|
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<Number>
|
Code of the result of an operation |
Example
const directory = new DKTools.IO.Directory('save/');
const status = await directory.createDirectoryAsync('backup');
if (status === DKTools.IO.OK) {
console.log('created!');
}
-
-
Returns true is the entity is same
- Since:
Returns:
Type |
Description |
Boolean
|
Entity is same |
-
-
Returns true if the entity exists
- Version:
Returns:
Type |
Description |
Boolean
|
Entity exists |
-
findDirectories
(object)Object
-
Finds the directories
Returns an object with 2 properties:
status - Result of an operation
data - Array with directories
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
template |
RegExp
|
String
|
optional
Template for filtering |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
searchLimit |
Number
|
optional
Search limit |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
All directories |
Example
const directory = new DKTools.IO.Directory('img/');
const result = directory.findDirectories({ sync: true, template: 'system' });
if (result.status === DKTools.IO.OK) {
console.log(result.data);
}
-
findDirectoriesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.Directory>|null)}>
async
-
Finds the directories
Asynchronous version of DKTools.IO.Directory.prototype.findDirectories
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with directories
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
template |
RegExp
|
String
|
optional
Template for filtering |
searchLimit |
Number
|
optional
Search limit |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.Directory>|null)}>
|
All directories |
-
-
Finds the files
Returns an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
template |
RegExp
|
String
|
optional
Template for filtering |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
searchLimit |
Number
|
optional
Search limit |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
All files |
Example
const directory = new DKTools.IO.Directory('img/');
const result = directory.findFiles({ sync: true, template: 'Window.png' });
if (result.status === DKTools.IO.OK) {
console.log(result.data);
}
-
findFilesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
async
-
Finds the files
Asynchronous version of DKTools.IO.Directory.prototype.findFiles
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
template |
RegExp
|
String
|
optional
Template for filtering |
searchLimit |
Number
|
optional
Search limit |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
|
All files |
-
-
Returns the absolute path
- Since:
Returns:
Type |
Description |
String
|
Absolute path |
-
-
Returns all files and directories
Returns an object with 2 properties:
status - Result of an operation
data - Array with files and directories
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
template |
RegExp
|
String
|
optional
Template for filtering |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
Returns:
Type |
Description |
Object
|
All files and directories |
-
getAllAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.Entity>|null)}>
async
-
Returns all files and directories
Asynchronous version of DKTools.IO.Directory.prototype.getAll
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files and directories
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
template |
RegExp
|
String
|
optional
Template for filtering |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.Entity>|null)}>
|
All files and directories |
-
getAudioFiles
(object)Object
-
Returns all audio files
Returns an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
All audio files |
-
getAudioFilesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
async
-
Returns all audio files
Asynchronous version of DKTools.IO.Directory.prototype.getAudioFiles
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
|
All audio files |
-
getDirectories
(object)Object
-
Returns all directories
Returns an object with 2 properties:
status - Result of an operation
data - Array with directories
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
template |
RegExp
|
optional
Template for filtering |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
Returns:
Type |
Description |
Object
|
All directories |
-
getDirectoriesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.Directory>|null)}>
async
-
Returns all directories
Asynchronous version of DKTools.IO.Directory.prototype.getDirectories
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with directories
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
template |
RegExp
|
String
|
optional
Template for filtering |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.Directory>|null)}>
|
All directories |
-
-
Returns the extension of the entity
- Since:
Returns:
Type |
Description |
String
|
Extension of the entity |
-
-
Returns all files
Returns an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
template |
RegExp
|
optional
Template for filtering |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
Returns:
Type |
Description |
Object
|
All files |
-
getFilesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
async
-
Returns all files
Asynchronous version of DKTools.IO.Directory.prototype.getFiles
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
template |
RegExp
|
String
|
optional
Template for filtering |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
|
All files |
-
-
Returns the full name
- Version:
- Since:
Returns:
Type |
Description |
String
|
Full name |
-
-
Returns the full path
- Version:
Returns:
Type |
Description |
String
|
Full Path |
-
getImageFiles
(object)Object
-
Returns all image files
Returns an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
All image files |
-
getImageFilesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
async
-
Returns all image files
Asynchronous version of DKTools.IO.Directory.prototype.getImageFiles
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
|
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
|
All image files |
-
getJsonFiles
(object)Object
-
Returns all JSON files
Returns an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
All JSON files |
-
getJsonFilesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
async
-
Returns all JSON files
Asynchronous version of DKTools.IO.Directory.prototype.getJsonFiles
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
|
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
|
All JSON files |
-
-
Returns the name of the entity without an extension
- Since:
Returns:
Type |
Description |
String
|
Name of the entity without an extension |
-
-
Returns the path
- Since:
Returns:
Type |
Description |
String
|
Path |
-
-
Returns the root directory
- Since:
Returns:
-
-
Returns a stats
Returns an object with 2 properties:
status - Result of an operation
data - Loaded data
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of stat |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
Loaded stats |
-
getStatsAsync
()Promise.<Object>
async
inherited
-
Returns a stats
Asynchronous version of DKTools.IO.Entity.prototype.getStats
Promise resolves an object with 2 properties:
status - Result of an operation
data - Loaded data
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
- Version:
- Since:
Returns:
Type |
Description |
Promise.<Object>
|
Loaded stats |
-
getTxtFiles
(object)Object
-
Returns all txt files
Returns an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
All txt files |
-
getTxtFilesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
async
-
Returns all txt files
Asynchronous version of DKTools.IO.Directory.prototype.getTxtFiles
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
|
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
|
All txt files |
-
getVideoFiles
(object)Object
-
Returns all video files
Returns an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.readdir |
options |
String
|
Object
|
optional
Options for FileSystem.readdir or FileSystem.readdirSync |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
All video files |
-
getVideoFilesAsync
(object)Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
async
-
Returns all video files
Asynchronous version of DKTools.IO.Directory.prototype.getVideoFiles
Promise resolves an object with 2 properties:
status - Result of an operation
data - Array with files
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
options |
String
|
Object
|
optional
Options for FileSystem.readdir |
|
- Since:
Returns:
Type |
Description |
Promise.<{status: Number, data: (Array.<DKTools.IO.File>|null)}>
|
All video files |
-
-
Returns true if the entity has an extension
- Since:
Returns:
Type |
Description |
Boolean
|
Entity has an extension |
-
-
Initializes the entity
Name |
Type |
Description |
fullPath |
String
|
Path to entity |
- Version:
- Since:
-
-
Returns true if the entity is a directory
- Version:
- Since:
Returns:
Type |
Description |
Boolean
|
Entity is a directory |
-
-
Returns true if the directory does not contain files and other directories
Returns:
Type |
Description |
Boolean
|
Directory does not contain files and other directories |
-
-
Returns true if the entity is a file
- Version:
- Since:
Returns:
Type |
Description |
Boolean
|
Entity is a file |
-
loadAudioFiles
()Array.<WebAudio>
-
Loads and returns an audio files
- Since:
Returns:
Type |
Description |
Array.<WebAudio>
|
Loaded audio files |
-
loadAudioFilesAsync
()Promise.<Array.<WebAudio>>
async
-
Loads and returns an audio files
Asynchronous version of DKTools.IO.Directory.prototype.loadAudioFiles
Promise resolves a loaded audio files (WebAudio[])
- Version:
- Since:
Returns:
Type |
Description |
Promise.<Array.<WebAudio>>
|
Loaded audio files |
-
loadBitmaps
(object, hue, smooth)Array.<Bitmap>
-
Loads and returns a bitmaps
Name |
Type |
Description |
object |
function
|
Object
|
optional
Function of processing after loading a bitmap or object with parameter |
hue |
Number
|
optional
Hue of bitmap (if object is Object) |
smooth |
Boolean
|
optional
Smooth of bitmap (if object is Object) |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
object.hue |
Number
|
optional
Hue of bitmap |
object.smooth |
Boolean
|
optional
Smooth of bitmap |
- Since:
Returns:
Type |
Description |
Array.<Bitmap>
|
Loaded bitmaps |
-
loadBitmapsAsync
(object, hue, smooth)Promise.<Array.<Bitmap>>
async
-
Loads and returns a bitmaps
Asynchronous version of DKTools.IO.Directory.prototype.loadBitmaps
Promise resolves a loaded bitmaps (Bitmap[])
Name |
Type |
Description |
object |
function
|
Object
|
optional
Function of processing after loading a bitmap or object with parameter |
hue |
Number
|
optional
Hue of bitmap (if object is Object) |
smooth |
Boolean
|
optional
Smooth of bitmap (if object is Object) |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
object.hue |
Number
|
optional
Hue of bitmap |
object.smooth |
Boolean
|
optional
Smooth of bitmap |
- Since:
Returns:
Type |
Description |
Promise.<Array.<Bitmap>>
|
Loaded bitmaps |
-
-
Removes the directory
Returns a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_DIRECTORY_IS_NOT_EMPTY
Name |
Type |
Default |
Description |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of FileSystem.rmdir |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
Returns:
Type |
Description |
Number
|
Code of the result of an operation |
-
removeAsync
()Promise.<Number>
async
-
Removes the directory
Asynchronous version of DKTools.IO.Directory.prototype.remove
Promise resolves a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_DIRECTORY_IS_NOT_EMPTY
- Since:
Returns:
Type |
Description |
Promise.<Number>
|
Code of the result of an operation |
-
-
Renames the entity (file or directory)
Returns a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OVERWRITING_IS_NOT_AVAILABLE
Name |
Type |
Default |
Description |
newName |
String
|
|
New name of entity (file or directory) without the extension |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of rename |
overwrite |
Boolean
|
optional
Overwrite existing entity |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
Returns:
Type |
Description |
Number
|
Code of the result of an operation |
-
renameAsync
(newName, object)Promise.<Number>
async
inherited
-
Renames the entity (file or directory)
Asynchronous version of DKTools.IO.Entity.prototype.rename
Promise resolves a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OVERWRITING_IS_NOT_AVAILABLE
Name |
Type |
Default |
Description |
newName |
String
|
|
New name of entity without the extension |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
overwrite |
Boolean
|
optional
Overwrite existing entity |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<Number>
|
Code of the result of an operation |
-
reserveBitmaps
(object, hue, smooth, reservationId)Array.<Bitmap>
-
Loads, reserves and returns a bitmaps
Name |
Type |
Description |
object |
function
|
Object
|
optional
Function of processing after loading a bitmap or object with parameter |
hue |
Number
|
optional
Hue of bitmap (if object is Object) |
smooth |
Boolean
|
optional
Smooth of bitmap (if object is Object) |
reservationId |
Number
|
optional
Reservation ID (if object is Object) |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
object.hue |
Number
|
optional
Hue of bitmap |
object.smooth |
Boolean
|
optional
Smooth of bitmap |
object.reservationId |
Number
|
optional
Reservation ID |
- Since:
Returns:
Type |
Description |
Array.<Bitmap>
|
Loaded bitmaps |
-
reserveBitmapsAsync
(object, hue, smooth, reservationId)Promise.<Array.<Bitmap>>
async
-
Loads, reserves and returns a bitmaps
Asynchronous version of DKTools.IO.Directory.prototype.reserveBitmaps
Promise resolves a loaded bitmaps (Bitmap[])
Name |
Type |
Description |
object |
function
|
Object
|
optional
Function of processing after loading a bitmap or object with parameter |
hue |
Number
|
optional
Hue of bitmap (if object is Object) |
smooth |
Boolean
|
optional
Smooth of bitmap (if object is Object) |
reservationId |
Number
|
optional
Reservation ID (if object is Object) |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
object.hue |
Number
|
optional
Hue of bitmap |
object.smooth |
Boolean
|
optional
Smooth of bitmap |
object.reservationId |
Number
|
optional
Reservation ID |
- Since:
Returns:
Type |
Description |
Promise.<Array.<Bitmap>>
|
Loaded bitmaps |