提交 dbfcafcc 编写于 作者: G Gloria

Update docs against 15175

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 4c8f97ad
......@@ -47,21 +47,27 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco
**Example**
```js
let xml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
' <title>Happy</title>' +
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let conv = new convertxml.ConvertXML()
let options = {trim : false, declarationKey:"_declaration",
instructionKey : "_instruction", attributesKey : "_attributes",
textKey : "_text", cdataKey:"_cdata", doctypeKey : "_doctype",
commentKey : "_comment", parentKey : "_parent", typeKey : "_type",
nameKey : "_name", elementsKey : "_elements"}
let result = JSON.stringify(conv.convertToJSObject(xml, options));
console.log(result);
try {
let xml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
' <title>Happy</title>' +
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let conv = new convertxml.ConvertXML()
let options = {
trim: false, declarationKey: "_declaration",
instructionKey: "_instruction", attributesKey: "_attributes",
textKey: "_text", cdataKey: "_cdata", doctypeKey: "_doctype",
commentKey: "_comment", parentKey: "_parent", typeKey: "_type",
nameKey: "_name", elementsKey: "_elements"
}
let result = JSON.stringify(conv.convertToJSObject(xml, options));
console.log(result);
} catch (e) {
console.log(e.toString());
}
// Output (non-compact)
// {"_declaration":{"_attributes":{"version":"1.0","encoding":"utf-8"}},"_elements":[{"_type":"element","_name":"note","_attributes":{"importance":"high","logged":"true"},"_elements":[{"_type":"element","_name":"title","_elements":[{"_type":"text","_text":"Happy"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Work"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Play"}]}]}]}
```
......
......@@ -18,13 +18,8 @@ import process from '@ohos.process';
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| egid | number | Yes| No| Effective group identifier (EGID) of the process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| euid | number | Yes| No| Effective user identifier (EUID) of the process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| gid | number | Yes| No| Group identifier (GID) of the process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| uid | number | Yes| No| User identifier (UID) of the process.|
| groups | number[] | Yes| No| Array with supplementary group IDs.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| pid | number | Yes| No| Process ID (PID) of the process.|
| ppid | number | Yes| No| Parent process ID (PPID) of the process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| tid<sup>8+</sup> | number | Yes| No| Thread ID (TID) of the thread.|
......@@ -120,50 +115,6 @@ let result = process.getPastCpuTime() ;
```
## process.runCmd
runCmd(command: string, options?: { timeout?: number, killSignal?: number | string, maxBuffer?: number }): ChildProcess
Forks a new process to run a shell command and returns the **ChildProcess** object.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| command | string | Yes| Shell command to run.|
| options | Object | No| Related parameters.|
**Table 1** options
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| timeout | number | No| Maximum running time (in milliseconds) of the child process. When the running time of the child process exceeds the value of this parameter, the parent process sends a **killSignal** to the child process to terminate it. The default value is **0**.|
| killSignal | number&nbsp;\|&nbsp;string | No| Signal sent to the child process when the running time of a child process exceeds the timeout period. The default value is **SIGTERM**.|
| maxBuffer | number | No| Maximum buffer size for the standard input and output of the child process. When the size is exceeded, the child process will be terminated. The default value is **1024 \* 1024**.|
**Return value**
| Type| Description|
| -------- | -------- |
| [ChildProcess](#childprocess) | **ChildProcess** object.|
**Example**
```js
let child = process.runCmd('ls', { maxBuffer : 2 });
let result = child.wait();
child.getOutput.then(val=>{
console.log("child.getOutput = " + val);
})
```
## process.abort
abort(): void
......@@ -179,118 +130,6 @@ process.abort();
```
## process.on
on(type: string, listener: EventListener): void
Stores the events triggered by the user.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the events to store. |
| listener | [EventListener](#eventlistener) | Yes| Callback invoked to return the event.|
**Example**
```js
process.on("data", (e)=>{
console.log("data callback");
})
```
## process.off
off(type: string): boolean
Deletes the event stored by the user.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the event to delete.|
**Return value**
| Type| Description|
| -------- | -------- |
| boolean | Returns **true** if the event is deleted; returns **false** otherwise.|
**Example**
```js
process.on("data", (e)=>{
console.log("data callback");
})
let result = process.off("data");
```
## process.cwd
cwd(): string
Obtains the working directory of this process.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Return value**
| Type| Description|
| -------- | -------- |
| string| Working directory obtained.|
**Example**
```js
let path = process.cwd();
```
## process.chdir
chdir(dir: string): void
Changes the working directory of this process.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| dir | string | Yes| Path|
**Example**
```js
process.chdir('/system');
```
## process.uptime
uptime(): number
......@@ -729,156 +568,3 @@ let pro = new process.ProcessManager();
let pres = process.pid;
let result = pro.kill(28, pres);
```
## ChildProcess
The **ChildProcess** object is a new child process and can be obtained by calling [process.runCmd](#processruncmd). The main process can obtain the standard input and output of the child process, send signals to the child process, and close the child process.
**System API**: This is a system API.
### Attributes
**System API**: This is a system API.
**System capability**: SystemCapability.Utils.Lang
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| pid | number | Yes| No| PID of the child process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| ppid | number | Yes| No| PPID of the child process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| exitCode | number | Yes| No| Exit code of the child process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| killed | boolean | Yes| No| Whether the parent process successfully sends a signal to the child process to terminate it.<br>**System API**: This is a system API.<br>It is used only to test applications.|
### wait
wait(): Promise&lt;number&gt;
Waits until the child process ends. This method uses a promise to return the exit code of the child process.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;number&gt; | Promise used to return the exit code of the child process.|
**Example**
```js
let child = process.runCmd('ls');
let result = child.wait();
result.then(val=>{
console.log("result = " + val);
})
```
### getOutput
getOutput(): Promise&lt;Uint8Array&gt;
Obtains the standard output of the child process.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;Uint8Array&gt; | Promise used to return the standard output in a Uint8Array.|
**Example**
```js
let child = process.runCmd('ls');
let result = child.wait();
child.getOutput().then(val=>{
console.log("child.getOutput = " + val);
})
```
### getErrorOutput
getErrorOutput(): Promise&lt;Uint8Array&gt;
Obtains the standard error output of the child process.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;Uint8Array&gt; | Promise used to return the standard error output in a Uint8Array.|
**Example**
```js
let child = process.runCmd('madir test.text');
let result = child.wait();
child.getErrorOutput().then(val=>{
console.log("child.getErrorOutput= " + val);
})
```
### close
close(): void
Closes the child process in running.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Example**
```js
let child = process.runCmd('sleep 5; ls');
child.close();
```
### kill
kill(signal: number | string): void
Sends a signal to the specified child process to terminate it.
**System API**: This is a system API.
It is used only to test applications.
**System capability**: SystemCapability.Utils.Lang
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| signal | number&nbsp;\|&nbsp;string | Yes| Number or string to send.|
**Example**
```js
let child = process.runCmd('sleep 5; ls');
child.kill(9);
```
......@@ -26,7 +26,7 @@ Formats the specified values and inserts them into the string by replacing the w
| Name | Type | Mandatory| Description |
| ------- | -------- | ---- | -------------- |
| format | string | Yes | String.|
| ...args | Object[] | No | Values to format. The formatted values will be replaced the wildcard in the string. |
| ...args | Object[] | No | Values to format. The formatted values will replace the wildcard in the string. If this parameter is not set, the first parameter is returned by default.|
**Return value**
......@@ -69,6 +69,20 @@ let result = util.errnoToString(errnum);
console.log("result = " + result);
```
**Some error code and message examples**
| Error Code| Message |
| ------ | -------------------------------- |
| -1 | operation not permitted |
| -2 | no such file or directory |
| -3 | no such process |
| -4 | interrupted system call |
| -5 | i/o error |
| -11 | resource temporarily unavailable |
| -12 | not enough memory |
| -13 | permission denied |
| -100 | network is down |
## util.callbackWrapper
callbackWrapper(original: Function): (err: Object, value: Object )=&gt;void
......@@ -92,15 +106,14 @@ Calls back an asynchronous function. In the callback, the first parameter indica
**Example**
```js
async function promiseFn() {
return Promise.reject('value');
}
let err = "type err";
let cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
console.log(err);
console.log(ret);
}, err)
async function fn() {
return 'hello world';
}
let cb = util.callbackWrapper(fn);
cb(1, (err, ret) => {
if (err) throw err;
console.log(ret);
});
```
## util.promisify<sup>9+</sup>
......@@ -126,24 +139,30 @@ Processes an asynchronous function and returns a promise.
**Example**
```js
function aysnFun(str1, str2) {
if (typeof str1 === 'object' && typeof str2 === 'object') {
return str2
} else {
return str1
}
}
let newPromiseObj = util.promisify(aysnFun);
newPromiseObj({ err: "type error" }, {value:'HelloWorld'}).then(res => {
console.log(res);
})
function fun(num, callback) {
if (typeof num === 'number') {
callback(null, num + 3);
} else {
callback("type err");
}
}
const addCall = util.promisify(fun);
(async () => {
try {
let res = await addCall(2);
console.log(res);
} catch (err) {
console.log(err);
}
})();
```
## util.randomUUID<sup>9+</sup>
randomUUID(entropyCache?: boolean): string
Uses a secure random number generator to generate a random universally unique identifier (UUID) of RFC 4122 version 4.
Uses a secure random number generator to generate a random universally unique identifier (UUID) in RFC 4122 version 4.
**System capability**: SystemCapability.Utils.Lang
......@@ -172,7 +191,7 @@ Uses a secure random number generator to generate a random universally unique id
randomBinaryUUID(entropyCache?: boolean): Uint8Array
Uses a secure random number generator to generate a random binary UUID of RFC 4122 version 4.
Uses a secure random number generator to generate a random UUID in RFC 4122 version 4.
**System capability**: SystemCapability.Utils.Lang
......@@ -243,7 +262,7 @@ Formats the specified values and inserts them into the string by replacing the w
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| format | string | Yes| String.|
| ...args | Object[] | No| Values to format. The formatted values will be replaced the wildcard in the string.|
| ...args | Object[] | No| Values to format. The formatted values will replace the wildcard in the string. If this parameter is not set, the first parameter is returned by default.|
**Return value**
......@@ -497,6 +516,7 @@ Decodes the input content.
| -------- | -------- | -------- | -------- | -------- |
| encoding | string | Yes| No| Encoding format. The default format is **utf-8**.|
### constructor
constructor()
......@@ -1456,7 +1476,7 @@ Performs subsequent operations after a value is removed.
| Name | Type | Mandatory| Description |
| -------- | ------- | ---- | ------------------------------------------------------------ |
| isEvict | boolean | Yes | Whether the cache capacity is insufficient. If the value is **true**, this method is called due to insufficient capacity. |
| isEvict | boolean | Yes | Whether the cache capacity is insufficient. If the value is **true**, this API is called due to insufficient capacity. |
| key | K | Yes | Key removed. |
| value | V | Yes | Value removed. |
| newValue | V | Yes | New value for the key if the **put()** method is called and the key to be added already exists. In other cases, this parameter is left blank.|
......@@ -3358,7 +3378,7 @@ A constructor used to create a **LruBuffer** instance. The default capacity of t
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [constructor<sup>9+</sup>](#constructor9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.constructor<sup>9+</sup>](#constructor9-3) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3382,7 +3402,7 @@ Changes the **LruBuffer** capacity. If the new capacity is less than or equal to
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [updateCapacity<sup>9+</sup>](#updatecapacity9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.updateCapacity<sup>9+</sup>](#updatecapacity9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3407,7 +3427,7 @@ Obtains the string representation of this **LruBuffer** object.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [toString<sup>9+</sup>](#tostring9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.toString<sup>9+</sup>](#tostring9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3435,7 +3455,7 @@ Obtains the capacity of this buffer.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getCapacity<sup>9+</sup>](#getcapacity9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.getCapacity<sup>9+</sup>](#getcapacity9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3459,7 +3479,7 @@ Clears key-value pairs from this buffer. The **afterRemoval()** method will be c
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [clear<sup>9+</sup>](#clear9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.clear<sup>9+</sup>](#clear9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3480,7 +3500,7 @@ Obtains the number of return values for **createDefault()**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getCreateCount<sup>9+</sup>](#getcreatecount9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.getCreateCount<sup>9+</sup>](#getcreatecount9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3506,7 +3526,7 @@ Obtains the number of times that the queried values are mismatched.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getMissCount<sup>9+</sup>](#getmisscount9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.getMissCount<sup>9+</sup>](#getmisscount9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3533,7 +3553,7 @@ Obtains the number of removals from this buffer.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getRemovalCount<sup>9+</sup>](#getremovalcount9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.getRemovalCount<sup>9+</sup>](#getremovalcount9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3561,7 +3581,7 @@ Obtains the number of times that the queried values are matched.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getMatchCount<sup>9+</sup>](#getmatchcount9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.getMatchCount<sup>9+</sup>](#getmatchcount9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3588,7 +3608,7 @@ Obtains the number of additions to this buffer.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getPutCount<sup>9+</sup>](#getputcount9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.getPutCount<sup>9+</sup>](#getputcount9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3614,7 +3634,7 @@ Checks whether this buffer is empty.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [isEmpty<sup>9+</sup>](#isempty9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.isEmpty<sup>9+</sup>](#isempty9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3640,7 +3660,7 @@ Obtains the value of the specified key.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [get<sup>9+</sup>](#get9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.get<sup>9+</sup>](#get9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3672,7 +3692,7 @@ Adds a key-value pair to this buffer.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [put<sup>9+</sup>](#put9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.put<sup>9+</sup>](#put9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3704,7 +3724,7 @@ Obtains all values in this buffer, listed from the most to the least recently ac
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [values<sup>9+</sup>](#values9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.values<sup>9+</sup>](#values9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3732,7 +3752,7 @@ Obtains all keys in this buffer, listed from the most to the least recently acce
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [keys<sup>9+</sup>](#keys9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.keys<sup>9+</sup>](#keys9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3743,6 +3763,7 @@ Obtains all keys in this buffer, listed from the most to the least recently acce
| K&nbsp;[] | All keys in the buffer, listed from the most to the least recently accessed.|
**Example**
```js
let pro = new util.LruBuffer();
pro.put(2,10);
......@@ -3757,7 +3778,7 @@ Removes the specified key and its value from this buffer.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [remove<sup>9+</sup>](#remove9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.remove<sup>9+</sup>](#remove9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3788,7 +3809,7 @@ Performs subsequent operations after a value is removed.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [afterRemoval<sup>9+</sup>](#afterremoval9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.afterRemoval<sup>9+</sup>](#afterremoval9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3796,7 +3817,7 @@ Performs subsequent operations after a value is removed.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| isEvict | boolean | Yes| Whether the buffer capacity is insufficient. If the value is **true**, this method is called due to insufficient capacity.|
| isEvict | boolean | Yes| Whether the buffer capacity is insufficient. If the value is **true**, this API is called due to insufficient capacity.|
| key | K | Yes| Key removed.|
| value | V | Yes| Value removed.|
| newValue | V | Yes| New value for the key if the **put()** method is called and the key to be added already exists. In other cases, this parameter is left blank.|
......@@ -3832,7 +3853,7 @@ Checks whether this buffer contains the specified key.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [contains<sup>9+</sup>](#contains9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.contains<sup>9+</sup>](#contains9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3864,7 +3885,7 @@ Creates a value if the value of the specified key is not available.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [createDefault<sup>9+</sup>](#createdefault9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.createDefault<sup>9+</sup>](#createdefault9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3895,7 +3916,7 @@ Obtains a new iterator object that contains all key-value pairs in this object.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [entries<sup>9+</sup>](#entries9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.entries<sup>9+</sup>](#entries9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3921,7 +3942,7 @@ Obtains a two-dimensional array in key-value pairs.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Symbol.iterator<sup>9+</sup>](#symboliterator9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [LRUCache.Symbol.iterator<sup>9+</sup>](#symboliterator9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3953,7 +3974,7 @@ A constructor used to create a **Scope** object with the specified upper and low
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [constructor<sup>9+</sup>](#constructor9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.constructor<sup>9+</sup>](#constructor9-4) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -3980,7 +4001,7 @@ Obtains a string representation that contains this **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [toString<sup>9+</sup>](#tostring9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.toString<sup>9+</sup>](#tostring9-1) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4007,7 +4028,7 @@ Obtains the intersection of this **Scope** and the given **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [intersect<sup>9+</sup>](#intersect9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.intersect<sup>9+</sup>](#intersect9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4043,7 +4064,7 @@ Obtains the intersection of this **Scope** and the given lower and upper limits.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [intersect<sup>9+</sup>](#intersect9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.intersect<sup>9+</sup>](#intersect9-1) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4079,7 +4100,7 @@ Obtains the upper limit of this **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getUpper<sup>9+</sup>](#getupper9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.getUpper<sup>9+</sup>](#getupper9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4106,7 +4127,7 @@ Obtains the lower limit of this **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getLower<sup>9+</sup>](#getlower9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.getLower<sup>9+</sup>](#getlower9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4133,7 +4154,7 @@ Obtains the union set of this **Scope** and the given lower and upper limits.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [expand<sup>9+</sup>](#expand9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.expand<sup>9+</sup>](#expand9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4169,7 +4190,7 @@ Obtains the union set of this **Scope** and the given **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [expand<sup>9+</sup>](#expand9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.expand<sup>9+</sup>](#expand9-1) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4205,7 +4226,7 @@ Obtains the union set of this **Scope** and the given value.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [expand<sup>9+</sup>](#expand9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.expand<sup>9+</sup>](#expand9-2) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4239,7 +4260,7 @@ Checks whether a value is within this **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [contains<sup>9+</sup>](#contains9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.contains<sup>9+</sup>](#contains9-1) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4273,7 +4294,7 @@ Checks whether a range is within this **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [contains<sup>9+</sup>](#contains9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.contains<sup>9+</sup>](#contains9-2) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4310,7 +4331,7 @@ Limits a value to this **Scope**.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [clamp<sup>9+</sup>](#clamp9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [ScopeHelper.clamp<sup>9+</sup>](#clamp9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4351,7 +4372,7 @@ A constructor used to create a **Base64** object.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [constructor<sup>9+</sup>](#constructor9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Base64Helper.constructor<sup>9+</sup>](#constructor9-5) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4369,7 +4390,7 @@ Encodes the input content.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [encodeSync<sup>9+</sup>](#encodesync9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Base64Helper.encodeSync<sup>9+</sup>](#encodesync9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4401,7 +4422,7 @@ Encodes the input content.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [encodeToStringSync<sup>9+</sup>](#encodetostringsync9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Base64Helper.encodeToStringSync<sup>9+</sup>](#encodetostringsync9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4433,7 +4454,7 @@ Decodes the input content.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [decodeSync<sup>9+</sup>](#decodesync9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Base64Helper.decodeSync<sup>9+</sup>](#decodesync9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4465,7 +4486,7 @@ Encodes the input content asynchronously.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [encode<sup>9+</sup>](#encode9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Base64Helper.encode<sup>9+</sup>](#encode9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4502,7 +4523,7 @@ Encodes the input content asynchronously.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [encodeToString<sup>9+</sup>](#encodetostring9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Base64Helper.encodeToString<sup>9+</sup>](#encodetostring9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4537,7 +4558,7 @@ Decodes the input content asynchronously.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [decode<sup>9+</sup>](#decode9) instead.
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [Base64Helper.decode<sup>9+</sup>](#decode9) instead.
**System capability**: SystemCapability.Utils.Lang
......@@ -4565,5 +4586,3 @@ Decodes the input content asynchronously.
}
})
```
<!--no_check-->
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册