ToiStorageService Interface Reference
Description
- Service:
- This is a service and can be accessed through toi.storageService
The ToiStorageService interface provides access to any internal and external storage devices.
For an internal HDD the temperature can be monitored, while USB connected devices do not support this feature.
import "ToiStorageService.idl";
List of all members.
Member Typedef Documentation
Sequence of storage identifiers.
Member Function Documentation
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.
- Parameters:
-
| type | The event type of the event to subscribe to. |
| listener | The JavaScript function that will receive events. |
- Exceptions:
-
| TInvalidArgumentException | Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice. |
Creates a file. A limited number of simultaneous ToiStorageFile objects are allowed. This functionality is primarily interesting for non C++ appliations (such as portal) that do not have access to the file system directly.
- Parameters:
-
| fileName | The name of the file. Note: If the filetype is ToiStorageFile::FILE_TYPE_TEMPORARY, a unique random string is automatically added to the end of the filename (but before any extension). The purpose of the filename in such case would merely be to describe its file-extension (e.g. '.jpeg'). |
| fileType | The type of file to be created. |
- Return values:
-
- Exceptions:
-
| TToiInvalidArgumentException | Raised if the fileType is invalid. |
| TToiFileException | Raised if files cannot be created, i.e. no internal drive, no directory set up for temporary files, or the maximum number of simultaneous file objects is exceeded. |
Returns the address to the storage device handler for a given storage identifier.
- Parameters:
-
- Return values:
-
Returns the identifiers for the currently connected storage devices.
- Return values:
-
| identifiers | The storage identifiers. |
Returns the operation manager that handles asynchronous operations for this storage device.
- Return values:
-
This method removes an event listener for a specific event.
- Parameters:
-
| type | The event type of the event to remove the listener from. |
| listener | The JavaScript function that was previously added as an event listener. |
- Exceptions:
-
| TInvalidArgumentException | Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener had not previously been added. |
Member Data Documentation
This is an Event identifier for ToiStorageDeviceConnectedEvent.
This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_CONNECTED.