• Home
  • Raw
  • Download

Lines Matching full:value

11value into a C/C++ integer and convert an ArkTS string into a C/C++ string array. You can also con…
18 | napi_coerce_to_bool | Forcibly converts an ArkTS value to an ArkTS Boolean value.|
19 | napi_coerce_to_number | Forcibly converts an ArkTS value to an ArkTS number.|
20 | napi_coerce_to_object | Forcibly converts an ArkTS value to an ArkTS object.|
21 | napi_coerce_to_string | Forcibly converts an ArkTS value to an ArkTS string.|
22 | napi_get_boolean | Obtains the ArkTS Boolean value based on the given C Boolean value.|
23 | napi_get_value_bool | Obtains the C/C++ equivalent of the given ArkTS Boolean value.|
34 Call **napi_coerce_to_bool** to forcibly convert an ArkTS value to an ArkTS Boolean value.
47 // Convert the input value to a Boolean value.
50 // Return the ArkTS boolean value.
68 let value = testNapi.coerceToBool<number>(0);
74 hilog.info(0x0000, 'testTag', 'Test Node-API napi_coerce_to_bool:%{public}s', value);
85 Call **napi_coerce_to_number** to forcibly convert an ArkTS value to an ArkTS number.
98 // Convert the input value to a number.
118 let value = testNapi.coerceToNumber<string>('2556');
121 hilog.info(0x0000, 'testTag', 'Test Node-API napi_coerce_to_number:%{public}d', value);
124 // The boolean value true is converted into 1.
130 Call **napi_coerce_to_object** to forcibly convert an ArkTS value to an ArkTS object.
144 // Convert the input value to an object.
163 let value = testNapi.coerceToObject<string>('222222');
166 if (typeof value === 'object') {
167 hilog.info(0x0000, 'testTag', 'Node-API The value is an object.');
169 hilog.info(0x0000, 'testTag', 'Node-API The value is not an object.');
175 Call **napi_coerce_to_string** to forcibly convert an ArkTS value to an ArkTS string.
188 // Convert the input value to a string.
208 let value = testNapi.coerceToString<number>(212);
212 hilog.info(0x0000, 'testTag', 'Test Node-API napi_coerce_to_string:%{public}s', value);
219 Call **napi_get_boolean** to obtain the ArkTS Boolean value based on the given C Boolean value.
231 napi_valuetype data, value;
235 napi_typeof(env, argv[1], &value);
238 …eck whether the types of the two parameters are the same and return the result via a Boolean value.
239 napi_get_boolean(env, data == value, &returnValue);
249 export const getBoolean: <T>(data: T, value: String) => boolean;
258 let value = testNapi.getBoolean<number>(1, '1');
260 hilog.info(0x0000, 'testTag', 'Test Node-API napi_get_boolean:%{public}s', value);
266 Call **napi_get_value_bool** to obtain the C Boolean equivalent of an ArkTS Boolean value.
282 …// If napi_get_value_bool is successful, napi_ok is returned. If a non-Boolean value is passed in,…
295 export const getValueBool: (value: boolean | string) => boolean | void;
304 …in a Boolean value and a non-Boolean value. After the Boolean value is passed in, the Boolean valu…
376 let value = testNapi.getNull();
377 hilog.info(0x0000, 'testTag', 'Test Node-API napi_get_null:%{public}s', value);
396 napi_value value = nullptr;
397 napi_get_undefined(env, &value);
398 … // Check whether the input parameter is equal to the ArkTS 'undefined' in both the type and value.
400 napi_strict_equals(env, args[0], value, &isEqual);
401 // Return a value based on the strict equality check.
413 export const getUndefined: (value: undefined) => boolean;
423 let value = testNapi.getUndefined(data);
424 hilog.info(0x0000, 'testTag', 'Test Node-API napi_get_undefined:%{public}s', value);