未验证 提交 3d6f2c52 编写于 作者: O openharmony_ci 提交者: Gitee

!4014 翻译已完成3766

Merge pull request !4014 from shawn_he/0516-a
# Resource Management # Resource Management
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> The resource management module provides APIs to obtain information about the current device configuration (including the language, region, screen direction, and MCC/MNC) and device capability (including the device type and resolution).
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -14,14 +16,14 @@ import resourceManager from '@ohos.resourceManager'; ...@@ -14,14 +16,14 @@ import resourceManager from '@ohos.resourceManager';
getResourceManager(callback: AsyncCallback&lt;ResourceManager&gt;): void getResourceManager(callback: AsyncCallback&lt;ResourceManager&gt;): void
Obtains the **ResourceManager** object of this application. This method uses a callback to return the result. Obtains the **ResourceManager** object of this application. This API uses a callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------------------------- | | -------- | ---------------------------------------- | ---- | ----------------------------- |
| callback | AsyncCallback&lt;[ResourceManager](#resourcemanager)&gt; | Yes | Callback used to return the **ResourceManager** object obtained.| | callback | AsyncCallback&lt;[ResourceManager](#resourcemanager)&gt; | Yes | Asynchronous callback used to return the **ResourceManager** object obtained.|
**Example** **Example**
``` ```
...@@ -45,7 +47,7 @@ Obtains the **ResourceManager** object of this application. This method uses a c ...@@ -45,7 +47,7 @@ Obtains the **ResourceManager** object of this application. This method uses a c
getResourceManager(bundleName: string, callback: AsyncCallback&lt;ResourceManager&gt;): void getResourceManager(bundleName: string, callback: AsyncCallback&lt;ResourceManager&gt;): void
Obtains the **ResourceManager** object of an application. This method uses an asynchronous callback to return the result. Obtains the **ResourceManager** object of an application. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -53,7 +55,7 @@ Obtains the **ResourceManager** object of an application. This method uses an as ...@@ -53,7 +55,7 @@ Obtains the **ResourceManager** object of an application. This method uses an as
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ---------------------------------------- | ---- | ----------------------------- | | ---------- | ---------------------------------------- | ---- | ----------------------------- |
| bundleName | string | Yes | Bundle name of the target application. | | bundleName | string | Yes | Bundle name of the target application. |
| callback | AsyncCallback&lt;[ResourceManager](#resourcemanager)&gt; | Yes | Callback used to return the **ResourceManager** object obtained.| | callback | AsyncCallback&lt;[ResourceManager](#resourcemanager)&gt; | Yes | Asynchronous callback used to return the **ResourceManager** object obtained.|
**Example** **Example**
``` ```
...@@ -66,7 +68,7 @@ Obtains the **ResourceManager** object of an application. This method uses an as ...@@ -66,7 +68,7 @@ Obtains the **ResourceManager** object of an application. This method uses an as
getResourceManager(): Promise&lt;ResourceManager&gt; getResourceManager(): Promise&lt;ResourceManager&gt;
Obtains the **ResourceManager** object of this application. This method uses a promise to return the result. Obtains the **ResourceManager** object of this application. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -95,7 +97,7 @@ Obtains the **ResourceManager** object of this application. This method uses a p ...@@ -95,7 +97,7 @@ Obtains the **ResourceManager** object of this application. This method uses a p
getResourceManager(bundleName: string): Promise&lt;ResourceManager&gt; getResourceManager(bundleName: string): Promise&lt;ResourceManager&gt;
Obtains the **ResourceManager** object of an application. This method uses a promise to return the result. Obtains the **ResourceManager** object of an application. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -139,12 +141,12 @@ Enumerates the device types. ...@@ -139,12 +141,12 @@ Enumerates the device types.
| Name | Default Value | Description | | Name | Default Value | Description |
| -------------------- | ---- | ---- | | -------------------- | ---- | ---- |
| DEVICE_TYPE_PHONE | 0x00 | Mobile phone. | | DEVICE_TYPE_PHONE | 0x00 | Phone |
| DEVICE_TYPE_TABLET | 0x01 | Tablet. | | DEVICE_TYPE_TABLET | 0x01 | Tablet |
| DEVICE_TYPE_CAR | 0x02 | Automobile. | | DEVICE_TYPE_CAR | 0x02 | Head unit |
| DEVICE_TYPE_PC | 0x03 | Computer. | | DEVICE_TYPE_PC | 0x03 | PC |
| DEVICE_TYPE_TV | 0x04 | TV. | | DEVICE_TYPE_TV | 0x04 | TV |
| DEVICE_TYPE_WEARABLE | 0x06 | Wearable. | | DEVICE_TYPE_WEARABLE | 0x06 | Wearable |
## ScreenDensity ## ScreenDensity
...@@ -175,6 +177,16 @@ Defines the device configuration. ...@@ -175,6 +177,16 @@ Defines the device configuration.
| direction | [Direction](#direction) | Yes | No | Screen direction of the device.| | direction | [Direction](#direction) | Yes | No | Screen direction of the device.|
| locale | string | Yes | No | Current system language. | | locale | string | Yes | No | Current system language. |
**Example**
```
resourceManager.getResourceManager((error, mgr) => {
mgr.getConfiguration((error, value) => {
console.log(value.direction);
console.log(value.locale);
});
});
```
## DeviceCapability ## DeviceCapability
...@@ -188,6 +200,16 @@ Defines the device capability. ...@@ -188,6 +200,16 @@ Defines the device capability.
| screenDensity | [ScreenDensity](#screendensity) | Yes | No | Screen density of the device.| | screenDensity | [ScreenDensity](#screendensity) | Yes | No | Screen density of the device.|
| deviceType | [DeviceType](#devicetype) | Yes | No | Type of the device. | | deviceType | [DeviceType](#devicetype) | Yes | No | Type of the device. |
**Example**
```
resourceManager.getResourceManager((error, mgr) => {
mgr.getDeviceCapability((error, value) => {
console.log(value.screenDensity);
console.log(value.deviceType);
});
});
```
## RawFileDescriptor<sup>8+</sup> ## RawFileDescriptor<sup>8+</sup>
...@@ -205,7 +227,7 @@ Defines the descriptor information of the raw file.<br> ...@@ -205,7 +227,7 @@ Defines the descriptor information of the raw file.<br>
Defines the capability of accessing application resources. Defines the capability of accessing application resources.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> - The methods involved in **ResourceManager** are applicable only to the TypeScript-based declarative development paradigm. > - The methods involved in **ResourceManager** are applicable only to the TypeScript-based declarative development paradigm.
> >
> - Resource files are defined in the **resources** directory of the project. You can obtain the resource ID using **$r(resource address).id**, for example, **$r('app.string.test').id**. > - Resource files are defined in the **resources** directory of the project. You can obtain the resource ID using **$r(resource address).id**, for example, **$r('app.string.test').id**.
...@@ -215,7 +237,7 @@ Defines the capability of accessing application resources. ...@@ -215,7 +237,7 @@ Defines the capability of accessing application resources.
getString(resId: number, callback: AsyncCallback&lt;string&gt;): void getString(resId: number, callback: AsyncCallback&lt;string&gt;): void
Obtains the string corresponding to the specified resource ID. This method uses an asynchronous callback to return the result. Obtains the string corresponding to the specified resource ID. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -223,7 +245,7 @@ Obtains the string corresponding to the specified resource ID. This method uses ...@@ -223,7 +245,7 @@ Obtains the string corresponding to the specified resource ID. This method uses
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | --------------- | | -------- | --------------------------- | ---- | --------------- |
| resId | number | Yes | Resource ID. | | resId | number | Yes | Resource ID. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the string obtained.| | callback | AsyncCallback&lt;string&gt; | Yes | Asynchronous callback used to return the obtained string.|
**Example** **Example**
``` ```
...@@ -243,7 +265,7 @@ Obtains the string corresponding to the specified resource ID. This method uses ...@@ -243,7 +265,7 @@ Obtains the string corresponding to the specified resource ID. This method uses
getString(resId: number): Promise&lt;string&gt; getString(resId: number): Promise&lt;string&gt;
Obtains the string corresponding to the specified resource ID. This method uses a promise to return the result. Obtains the string corresponding to the specified resource ID. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -273,7 +295,7 @@ Obtains the string corresponding to the specified resource ID. This method uses ...@@ -273,7 +295,7 @@ Obtains the string corresponding to the specified resource ID. This method uses
getStringArray(resId: number, callback: AsyncCallback&lt;Array&lt;string&gt;&gt;): void getStringArray(resId: number, callback: AsyncCallback&lt;Array&lt;string&gt;&gt;): void
Obtains the array of strings corresponding to the specified resource ID. This method uses an asynchronous callback to return the result. Obtains the array of strings corresponding to the specified resource ID. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -281,7 +303,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me ...@@ -281,7 +303,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------------- | | -------- | ---------------------------------------- | ---- | ----------------- |
| resId | number | Yes | Resource ID. | | resId | number | Yes | Resource ID. |
| callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | Yes | Callback used to return the obtained array of strings.| | callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | Yes | Asynchronous callback used to return the obtained array of strings.|
**Example** **Example**
``` ```
...@@ -301,7 +323,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me ...@@ -301,7 +323,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me
getStringArray(resId: number): Promise&lt;Array&lt;string&gt;&gt; getStringArray(resId: number): Promise&lt;Array&lt;string&gt;&gt;
Obtains the array of strings corresponding to the specified resource ID. This method uses a promise to return the result. Obtains the array of strings corresponding to the specified resource ID. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -331,7 +353,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me ...@@ -331,7 +353,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me
getMedia(resId: number, callback: AsyncCallback&lt;Uint8Array&gt;): void getMedia(resId: number, callback: AsyncCallback&lt;Uint8Array&gt;): void
Obtains the content of the media file corresponding to the specified resource ID. This method uses an asynchronous callback to return the result. Obtains the content of the media file corresponding to the specified resource ID. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -339,7 +361,7 @@ Obtains the content of the media file corresponding to the specified resource ID ...@@ -339,7 +361,7 @@ Obtains the content of the media file corresponding to the specified resource ID
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------- | ---- | ------------------ | | -------- | ------------------------------- | ---- | ------------------ |
| resId | number | Yes | Resource ID. | | resId | number | Yes | Resource ID. |
| callback | AsyncCallback&lt;Uint8Array&gt; | Yes | Callback used to return the content of the media file obtained.| | callback | AsyncCallback&lt;Uint8Array&gt; | Yes | Asynchronous callback used to return the content of the media file obtained.|
**Example** **Example**
``` ```
...@@ -359,7 +381,7 @@ Obtains the content of the media file corresponding to the specified resource ID ...@@ -359,7 +381,7 @@ Obtains the content of the media file corresponding to the specified resource ID
getMedia(resId: number): Promise&lt;Uint8Array&gt; getMedia(resId: number): Promise&lt;Uint8Array&gt;
Obtains the content of the media file corresponding to the specified resource ID. This method uses a promise to return the result. Obtains the content of the media file corresponding to the specified resource ID. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -389,7 +411,7 @@ Obtains the content of the media file corresponding to the specified resource ID ...@@ -389,7 +411,7 @@ Obtains the content of the media file corresponding to the specified resource ID
getMediaBase64(resId: number, callback: AsyncCallback&lt;string&gt;): void getMediaBase64(resId: number, callback: AsyncCallback&lt;string&gt;): void
Obtains the Base64 code of the image corresponding to the specified resource ID. This method uses an asynchronous callback to return the result. Obtains the Base64 code of the image corresponding to the specified resource ID. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -397,7 +419,7 @@ Obtains the Base64 code of the image corresponding to the specified resource ID. ...@@ -397,7 +419,7 @@ Obtains the Base64 code of the image corresponding to the specified resource ID.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ------------------------ | | -------- | --------------------------- | ---- | ------------------------ |
| resId | number | Yes | Resource ID. | | resId | number | Yes | Resource ID. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the Base64 code of the image obtained.| | callback | AsyncCallback&lt;string&gt; | Yes | Asynchronous callback used to return the Base64 code of the image obtained.|
**Example** **Example**
``` ```
...@@ -417,7 +439,7 @@ Obtains the Base64 code of the image corresponding to the specified resource ID. ...@@ -417,7 +439,7 @@ Obtains the Base64 code of the image corresponding to the specified resource ID.
getMediaBase64(resId: number): Promise&lt;string&gt; getMediaBase64(resId: number): Promise&lt;string&gt;
Obtains the Base64 code of the image corresponding to the specified resource ID. This method uses a promise to return the result. Obtains the Base64 code of the image corresponding to the specified resource ID. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -447,14 +469,14 @@ Obtains the Base64 code of the image corresponding to the specified resource ID. ...@@ -447,14 +469,14 @@ Obtains the Base64 code of the image corresponding to the specified resource ID.
getConfiguration(callback: AsyncCallback&lt;Configuration&gt;): void getConfiguration(callback: AsyncCallback&lt;Configuration&gt;): void
Obtains the device configuration. This method uses an asynchronous callback to return the result. Obtains the device configuration. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------------------- | | -------- | ---------------------------------------- | ---- | ------------------------- |
| callback | AsyncCallback&lt;[Configuration](#configuration)&gt; | Yes | Callback used to return the obtained device configuration.| | callback | AsyncCallback&lt;[Configuration](#configuration)&gt; | Yes | Asynchronous callback used to return the obtained device configuration.|
**Example** **Example**
``` ```
...@@ -474,7 +496,7 @@ Obtains the device configuration. This method uses an asynchronous callback to r ...@@ -474,7 +496,7 @@ Obtains the device configuration. This method uses an asynchronous callback to r
getConfiguration(): Promise&lt;Configuration&gt; getConfiguration(): Promise&lt;Configuration&gt;
Obtains the device configuration. This method uses a promise to return the result. Obtains the device configuration. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -499,14 +521,14 @@ Obtains the device configuration. This method uses a promise to return the resul ...@@ -499,14 +521,14 @@ Obtains the device configuration. This method uses a promise to return the resul
getDeviceCapability(callback: AsyncCallback&lt;DeviceCapability&gt;): void getDeviceCapability(callback: AsyncCallback&lt;DeviceCapability&gt;): void
Obtains the device capability. This method uses an asynchronous callback to return the result. Obtains the device capability. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------- | | -------- | ---------------------------------------- | ---- | ---------------------------- |
| callback | AsyncCallback&lt;[DeviceCapability](#devicecapability)&gt; | Yes | Callback used to return the obtained device capability.| | callback | AsyncCallback&lt;[DeviceCapability](#devicecapability)&gt; | Yes | Asynchronous callback used to return the obtained device capability.|
**Example** **Example**
``` ```
...@@ -526,7 +548,7 @@ Obtains the device capability. This method uses an asynchronous callback to retu ...@@ -526,7 +548,7 @@ Obtains the device capability. This method uses an asynchronous callback to retu
getDeviceCapability(): Promise&lt;DeviceCapability&gt; getDeviceCapability(): Promise&lt;DeviceCapability&gt;
Obtains the device capability. This method uses a promise to return the result. Obtains the device capability. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -551,7 +573,7 @@ Obtains the device capability. This method uses a promise to return the result. ...@@ -551,7 +573,7 @@ Obtains the device capability. This method uses a promise to return the result.
getPluralString(resId: number, num: number, callback: AsyncCallback&lt;string&gt;): void getPluralString(resId: number, num: number, callback: AsyncCallback&lt;string&gt;): void
Obtains the specified number of singular-plural strings corresponding to the specified resource ID. This method uses an asynchronous callback to return the result. Obtains the specified number of singular-plural strings corresponding to the specified resource ID. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -560,7 +582,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe ...@@ -560,7 +582,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe
| -------- | --------------------------- | ---- | ------------------------------- | | -------- | --------------------------- | ---- | ------------------------------- |
| resId | number | Yes | Resource ID. | | resId | number | Yes | Resource ID. |
| num | number | Yes | Number that determines the plural or singular form. | | num | number | Yes | Number that determines the plural or singular form. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the singular-plural string obtained.| | callback | AsyncCallback&lt;string&gt; | Yes | Asynchronous callback used to return the singular-plural string obtained.|
**Example** **Example**
``` ```
...@@ -580,7 +602,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe ...@@ -580,7 +602,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe
getPluralString(resId: number, num: number): Promise&lt;string&gt; getPluralString(resId: number, num: number): Promise&lt;string&gt;
Obtains the specified number of singular-plural strings corresponding to the specified resource ID. This method uses a promise to return the result. Obtains the specified number of singular-plural strings corresponding to the specified resource ID. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -610,7 +632,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe ...@@ -610,7 +632,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe
getRawFile(path: string, callback: AsyncCallback&lt;Uint8Array&gt;): void getRawFile(path: string, callback: AsyncCallback&lt;Uint8Array&gt;): void
Obtains the content of the raw file in the specified path. This method uses an asynchronous callback to return the result. Obtains the content of rawfile in the specified path. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -618,7 +640,7 @@ Obtains the content of the raw file in the specified path. This method uses an a ...@@ -618,7 +640,7 @@ Obtains the content of the raw file in the specified path. This method uses an a
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------- | ---- | ----------------------- | | -------- | ------------------------------- | ---- | ----------------------- |
| path | string | Yes | Path of the raw file. | | path | string | Yes | Path of the raw file. |
| callback | AsyncCallback&lt;Uint8Array&gt; | Yes | Callback used to return the raw file content, in byte arrays.| | callback | AsyncCallback&lt;Uint8Array&gt; | Yes | Asynchronous callback used to return the raw file content, in byte arrays.|
**Example** **Example**
``` ```
...@@ -637,7 +659,7 @@ Obtains the content of the raw file in the specified path. This method uses an a ...@@ -637,7 +659,7 @@ Obtains the content of the raw file in the specified path. This method uses an a
getRawFile(path: string): Promise&lt;Uint8Array&gt; getRawFile(path: string): Promise&lt;Uint8Array&gt;
Obtains the content of the raw file in the specified path. This method uses a promise to return the result. Obtains the content of the raw file in the specified path. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -666,7 +688,7 @@ Obtains the content of the raw file in the specified path. This method uses a pr ...@@ -666,7 +688,7 @@ Obtains the content of the raw file in the specified path. This method uses a pr
getRawFileDescriptor(path: string, callback: AsyncCallback&lt;RawFileDescriptor&gt;): void getRawFileDescriptor(path: string, callback: AsyncCallback&lt;RawFileDescriptor&gt;): void
Obtains the descriptor of the raw file in the specified path. This method uses an asynchronous callback to return the result. Obtains the descriptor of the raw file in the specified path. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -674,7 +696,7 @@ Obtains the descriptor of the raw file in the specified path. This method uses a ...@@ -674,7 +696,7 @@ Obtains the descriptor of the raw file in the specified path. This method uses a
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | -------------------------------- | | -------- | ---------------------------------------- | ---- | -------------------------------- |
| path | string | Yes | Path of the raw file. | | path | string | Yes | Path of the raw file. |
| callback | AsyncCallback&lt;[RawFileDescriptor](#rawfiledescriptor8)&gt; | Yes | Callback used to return the raw file descriptor.| | callback | AsyncCallback&lt;[RawFileDescriptor](#rawfiledescriptor8)&gt; | Yes | Asynchronous callback used to return the raw file descriptor.|
**Example** **Example**
``` ```
...@@ -695,7 +717,7 @@ Obtains the descriptor of the raw file in the specified path. This method uses a ...@@ -695,7 +717,7 @@ Obtains the descriptor of the raw file in the specified path. This method uses a
getRawFileDescriptor(path: string): Promise&lt;RawFileDescriptor&gt; getRawFileDescriptor(path: string): Promise&lt;RawFileDescriptor&gt;
Obtains the descriptor of the raw file in the specified path. This method uses a promise to return the result. Obtains the descriptor of the raw file in the specified path. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -726,7 +748,7 @@ Obtains the descriptor of the raw file in the specified path. This method uses a ...@@ -726,7 +748,7 @@ Obtains the descriptor of the raw file in the specified path. This method uses a
closeRawFileDescriptor(path: string, callback: AsyncCallback&lt;void&gt;): void closeRawFileDescriptor(path: string, callback: AsyncCallback&lt;void&gt;): void
Closes the descriptor of the raw file in the specified path. This method uses an asynchronous callback to return the result. Closes the descriptor of the raw file in the specified path. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
...@@ -734,7 +756,7 @@ Closes the descriptor of the raw file in the specified path. This method uses an ...@@ -734,7 +756,7 @@ Closes the descriptor of the raw file in the specified path. This method uses an
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ----------- | | -------- | ------------------------- | ---- | ----------- |
| path | string | Yes | Path of the raw file.| | path | string | Yes | Path of the raw file.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Asynchronous callback used to return the result. |
**Example** **Example**
``` ```
...@@ -751,7 +773,7 @@ Closes the descriptor of the raw file in the specified path. This method uses an ...@@ -751,7 +773,7 @@ Closes the descriptor of the raw file in the specified path. This method uses an
closeRawFileDescriptor(path: string): Promise&lt;void&gt; closeRawFileDescriptor(path: string): Promise&lt;void&gt;
Closes the descriptor of the raw file in the specified path. This method uses a promise to return the result. Closes the descriptor of the raw file in the specified path. This API uses a promise to return the result.
**System capability**: SystemCapability.Global.ResourceManager **System capability**: SystemCapability.Global.ResourceManager
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册