Home
last modified time | relevance | path

Searched refs:env (Results 1 – 25 of 431) sorted by relevance

12345678910>>...18

/base/security/huks/interfaces/kits/napi/src/
Dhuks_napi.cpp47 inline void AddInt32Property(napi_env env, napi_value object, const char *name, int32_t value) in AddInt32Property() argument
50 NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, value, &property)); in AddInt32Property()
51 NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, object, name, property)); in AddInt32Property()
54 static void AddHuksTagPart1(napi_env env, napi_value tag) in AddHuksTagPart1() argument
57 AddInt32Property(env, tag, "HUKS_TAG_INVALID", HKS_TAG_INVALID); in AddHuksTagPart1()
60 AddInt32Property(env, tag, "HUKS_TAG_ALGORITHM", HKS_TAG_ALGORITHM); in AddHuksTagPart1()
61 AddInt32Property(env, tag, "HUKS_TAG_PURPOSE", HKS_TAG_PURPOSE); in AddHuksTagPart1()
62 AddInt32Property(env, tag, "HUKS_TAG_KEY_SIZE", HKS_TAG_KEY_SIZE); in AddHuksTagPart1()
63 AddInt32Property(env, tag, "HUKS_TAG_DIGEST", HKS_TAG_DIGEST); in AddHuksTagPart1()
64 AddInt32Property(env, tag, "HUKS_TAG_PADDING", HKS_TAG_PADDING); in AddHuksTagPart1()
[all …]
Dhuks_napi_common.cpp30 napi_value ParseKeyAlias(napi_env env, napi_value object, HksBlob *&alias) in ParseKeyAlias() argument
33 napi_status status = napi_get_value_string_utf8(env, object, nullptr, 0, &length); in ParseKeyAlias()
35 GET_AND_THROW_LAST_ERROR((env)); in ParseKeyAlias()
47 napi_throw_error(env, NULL, "could not alloc memory"); in ParseKeyAlias()
54 status = napi_get_value_string_utf8(env, object, data, length + 1, &result); in ParseKeyAlias()
57 GET_AND_THROW_LAST_ERROR((env)); in ParseKeyAlias()
65 napi_throw_error(env, NULL, "could not alloc memory"); in ParseKeyAlias()
72 return GetInt32(env, 0); in ParseKeyAlias()
75 napi_value GetUint8Array(napi_env env, napi_value object, HksBlob &arrayBlob) in GetUint8Array() argument
84env, napi_get_typedarray_info(env, object, &arrayType, &length, (void **)&rawData, &arrayBuffer, &… in GetUint8Array()
[all …]
/base/user_iam/user_auth/interfaces/innerkits/napi/src/
Duser_auth_helper.cpp24 napi_value UserAuthServiceConstructor(napi_env env, napi_callback_info info) in UserAuthServiceConstructor() argument
35 NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, nullptr)); in UserAuthServiceConstructor()
36 NAPI_CALL(env, napi_wrap(env, thisVar, userAuthImpl, in UserAuthServiceConstructor()
37 [](napi_env env, void *data, void *hint) { in UserAuthServiceConstructor() argument
47 napi_value GetVersion(napi_env env, napi_callback_info info) in GetVersion() argument
53 NAPI_CALL(env, napi_get_cb_info(env, info, &argcAsync, args, &thisVar, nullptr)); in GetVersion()
55 NAPI_CALL(env, napi_unwrap(env, thisVar, (void **)&userAuthImpl)); in GetVersion()
60 return userAuthImpl->GetVersion(env, info); in GetVersion()
63 napi_value GetAvailableStatus(napi_env env, napi_callback_info info) in GetAvailableStatus() argument
69 NAPI_CALL(env, napi_get_cb_info(env, info, &argcAsync, args, &thisVar, nullptr)); in GetAvailableStatus()
[all …]
/base/notification/ans_standard/interfaces/kits/napi/ans/src/
Dcommon.cpp30 napi_value Common::NapiGetBoolean(napi_env env, const bool &isValue) in NapiGetBoolean() argument
33 napi_get_boolean(env, isValue, &result); in NapiGetBoolean()
37 napi_value Common::NapiGetNull(napi_env env) in NapiGetNull() argument
40 napi_get_null(env, &result); in NapiGetNull()
44 napi_value Common::NapiGetUndefined(napi_env env) in NapiGetUndefined() argument
47 napi_get_undefined(env, &result); in NapiGetUndefined()
51 napi_value Common::GetCallbackErrorValue(napi_env env, int errCode) in GetCallbackErrorValue() argument
55 NAPI_CALL(env, napi_create_int32(env, errCode, &eCode)); in GetCallbackErrorValue()
56 NAPI_CALL(env, napi_create_object(env, &result)); in GetCallbackErrorValue()
57 NAPI_CALL(env, napi_set_named_property(env, result, "code", eCode)); in GetCallbackErrorValue()
[all …]
Ddistributed.cpp28 napi_env env = nullptr; member
40 napi_env env = nullptr; member
53 napi_env env = nullptr; member
65 napi_env env = nullptr; member
73 napi_env env = nullptr; member
79 napi_value ParseParameters(const napi_env &env, const napi_callback_info &info, EnabledParams &para… in ParseParameters() argument
86 NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL)); in ParseParameters()
87 NAPI_ASSERT(env, argc >= ENABLED_MIN_PARA, "Wrong number of arguments"); in ParseParameters()
91 NAPI_CALL(env, napi_typeof(env, argv[PARAM0], &valuetype)); in ParseParameters()
92 NAPI_ASSERT(env, valuetype == napi_boolean, "Wrong argument type. Bool expected."); in ParseParameters()
[all …]
Dconstant.cpp22 void SetNamedPropertyByInteger(napi_env env, napi_value dstObj, int32_t objName, const char *propNa… in SetNamedPropertyByInteger() argument
25 if (napi_create_int32(env, objName, &prop) == napi_ok) { in SetNamedPropertyByInteger()
26 napi_set_named_property(env, dstObj, propName, prop); in SetNamedPropertyByInteger()
30 napi_value NotificationReasonInit(napi_env env, napi_value exports) in NotificationReasonInit() argument
35 napi_create_object(env, &obj); in NotificationReasonInit()
37 …SetNamedPropertyByInteger(env, obj, (int32_t)NotificationReason::CLICK_REASON_DELETE, "CLICK_REASO… in NotificationReasonInit()
38 …SetNamedPropertyByInteger(env, obj, (int32_t)NotificationReason::CANCEL_REASON_DELETE, "CANCEL_REA… in NotificationReasonInit()
40env, obj, (int32_t)NotificationReason::CANCEL_ALL_REASON_DELETE, "CANCEL_ALL_REASON_DELETE"); in NotificationReasonInit()
41 …SetNamedPropertyByInteger(env, obj, (int32_t)NotificationReason::ERROR_REASON_DELETE, "ERROR_REASO… in NotificationReasonInit()
43env, obj, (int32_t)NotificationReason::PACKAGE_CHANGED_REASON_DELETE, "PACKAGE_CHANGED_REASON_DELE… in NotificationReasonInit()
[all …]
Dslot.cpp36 napi_env env = nullptr; member
50 napi_env env = nullptr; member
63 napi_env env = nullptr; member
75 napi_env env = nullptr; member
88 napi_env env = nullptr; member
96 napi_env env = nullptr; member
108 napi_env env = nullptr; member
121 napi_env env = nullptr; member
128 napi_env env = nullptr; member
133 napi_value ParseParametersByAddSlot(const napi_env &env, const napi_callback_info &info, Parameters… in ParseParametersByAddSlot() argument
[all …]
/base/telephony/call_manager/frameworks/js/napi/include/
Dnapi_call_manager.h27 #define GET_PARAMS(env, info, num) \ argument
32 napi_get_cb_info(env, info, &argc, argv, &thisVar, &data)
42 static napi_value DeclareCallBasisInterface(napi_env env, napi_value exports);
43 static napi_value DeclareCallConferenceInterface(napi_env env, napi_value exports);
44 static napi_value DeclareCallSupplementInterface(napi_env env, napi_value exports);
45 static napi_value DeclareCallExtendInterface(napi_env env, napi_value exports);
46 static napi_value DeclareCallMultimediaInterface(napi_env env, napi_value exports);
47 static napi_value DeclareCallImsInterface(napi_env env, napi_value exports);
48 static napi_value DeclareCallMediaEnum(napi_env env, napi_value exports);
49 static napi_value DeclareCallDialEnum(napi_env env, napi_value exports);
[all …]
/base/sensors/sensor/interfaces/plugin/src/
Dsensor_napi_utils.cpp27 bool IsSameValue(const napi_env &env, const napi_value &lhs, const napi_value &rhs) in IsSameValue() argument
31 CHKNRF(env, napi_strict_equals(env, lhs, rhs, &result), "napi_strict_equals"); in IsSameValue()
35 bool IsMatchType(const napi_env &env, const napi_value &value, const napi_valuetype &type) in IsMatchType() argument
39 CHKNRF(env, napi_typeof(env, value, &paramType), "napi_typeof"); in IsMatchType()
43 bool IsMatchArrayType(const napi_env &env, const napi_value &value) in IsMatchArrayType() argument
47 CHKNRF(env, napi_is_array(env, value, &result), "napi_is_array"); in IsMatchArrayType()
51 bool GetFloatArray(const napi_env &env, const napi_value &value, vector<float> &array) in GetFloatArray() argument
55 CHKNRF(env, napi_get_array_length(env, value, &arrayLength), "napi_get_array_length"); in GetFloatArray()
58 CHKNRF(env, napi_get_element(env, value, i, &element), "napi_get_element"); in GetFloatArray()
59 …CHKNCF(env, IsMatchType(env, element, napi_number), "Wrong argument type. Number or function expec… in GetFloatArray()
[all …]
Dsensor_system_js.cpp21 napi_value SubscribeAccelerometer(napi_env env, napi_callback_info info) in SubscribeAccelerometer() argument
24 return Subscribe(env, info, SENSOR_TYPE_ID_ACCELEROMETER, SUBSCRIBE_CALLBACK); in SubscribeAccelerometer()
27 napi_value UnsubscribeAccelerometer(napi_env env, napi_callback_info info) in UnsubscribeAccelerometer() argument
30 return Unsubscribe(env, info, SENSOR_TYPE_ID_ACCELEROMETER); in UnsubscribeAccelerometer()
33 napi_value SubscribeCompass(napi_env env, napi_callback_info info) in SubscribeCompass() argument
36 return Subscribe(env, info, SENSOR_TYPE_ID_ORIENTATION, SUBSCRIBE_COMPASS); in SubscribeCompass()
39 napi_value UnsubscribeCompass(napi_env env, napi_callback_info info) in UnsubscribeCompass() argument
42 return Unsubscribe(env, info, SENSOR_TYPE_ID_ORIENTATION); in UnsubscribeCompass()
45 napi_value SubscribeProximity(napi_env env, napi_callback_info info) in SubscribeProximity() argument
48 return Subscribe(env, info, SENSOR_TYPE_ID_PROXIMITY, SUBSCRIBE_CALLBACK); in SubscribeProximity()
[all …]
/base/location/interfaces/innerkits/napi/
Dlocation_napi_system.cpp30 napi_value GetLocationOnce(const napi_env& env, in GetLocationOnce() argument
36 NAPI_ASSERT(env, g_locatorImpl != nullptr, "get locator SA failed"); in GetLocationOnce()
50 if (env == g_systemSingleLocatorCallbackHost->m_env) { in GetLocationOnce()
54 g_systemSingleLocatorCallbackHost->m_env = env; in GetLocationOnce()
60 return UndefinedNapiValue(env); in GetLocationOnce()
63 void GetAllCallback(const napi_env &env, const napi_value &argv, napi_ref &successHandlerRef, in GetAllCallback() argument
68 NAPI_CALL_RETURN_VOID(env, napi_has_named_property(env, argv, "success", &hasProperty)); in GetAllCallback()
70 … NAPI_CALL_RETURN_VOID(env, napi_get_named_property(env, argv, "success", &nVsuccessCallback)); in GetAllCallback()
71 … NAPI_CALL_RETURN_VOID(env, napi_create_reference(env, nVsuccessCallback, 1, &successHandlerRef)); in GetAllCallback()
74 NAPI_CALL_RETURN_VOID(env, napi_has_named_property(env, argv, "fail", &hasProperty)); in GetAllCallback()
[all …]
/base/compileruntime/js_api_module/xml/
Dnative_module_xml.cpp26 static napi_value XmlSerializerConstructor(napi_env env, napi_callback_info info) in XmlSerializerConstructor() argument
36 NAPI_CALL(env, napi_get_cb_info(env, info, &argc, nullptr, &thisVar, &data)); in XmlSerializerConstructor()
37 NAPI_ASSERT(env, argc == 1 || argc == 2, "Wrong number of arguments"); // 2: number of args in XmlSerializerConstructor()
38 NAPI_CALL(env, napi_get_cb_info(env, info, &argc, args, &thisVar, &data)); in XmlSerializerConstructor()
40 NAPI_CALL(env, napi_throw_error(env, "", "parameter is empty")); in XmlSerializerConstructor()
43 napi_is_arraybuffer(env, args[0], &bFlag); in XmlSerializerConstructor()
45 napi_get_arraybuffer_info(env, args[0], &data, &iLength); in XmlSerializerConstructor()
47 napi_is_dataview(env, args[0], &bFlag); in XmlSerializerConstructor()
49 napi_get_dataview_info(env, args[0], &iLength, &data, &arraybuffer, &offPos); in XmlSerializerConstructor()
57 NAPI_CALL(env, napi_typeof(env, args[1], &valuetype)); in XmlSerializerConstructor()
[all …]
/base/notification/ces_standard/interfaces/kits/napi/common_event/src/
Dsupport.cpp21 void SetNamedPropertyByStr(napi_env env, napi_value dstObj, const std::string &objName, const char … in SetNamedPropertyByStr() argument
24 if (napi_create_string_utf8(env, objName.c_str(), NAPI_AUTO_LENGTH, &prop) == napi_ok) { in SetNamedPropertyByStr()
25 napi_set_named_property(env, dstObj, propName, prop); in SetNamedPropertyByStr()
29 napi_value SupportInit(napi_env env, napi_value exports) in SupportInit() argument
32 napi_create_object(env, &obj); in SupportInit()
35env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_BOOT_COMPLETED, "COMMON_EVENT_BOOT_COMPLETED"… in SupportInit()
36 SetNamedPropertyByStr(env, in SupportInit()
40 …SetNamedPropertyByStr(env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_SHUTDOWN, "COMMON_EVENT… in SupportInit()
42env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_BATTERY_CHANGED, "COMMON_EVENT_BATTERY_CHANGE… in SupportInit()
43 …SetNamedPropertyByStr(env, obj, EventFwk::CommonEventSupport::COMMON_EVENT_BATTERY_LOW, "COMMON_EV… in SupportInit()
[all …]
Dcommon_event.cpp66 napi_create_string_utf8(commonEventDataWorkerData->env, in SetCommonEventData()
70 napi_set_named_property(commonEventDataWorkerData->env, result, "event", value); in SetCommonEventData()
73 napi_create_string_utf8(commonEventDataWorkerData->env, in SetCommonEventData()
77 napi_set_named_property(commonEventDataWorkerData->env, result, "bundleName", value); in SetCommonEventData()
80 napi_create_int32(commonEventDataWorkerData->env, commonEventDataWorkerData->code, &value); in SetCommonEventData()
81 napi_set_named_property(commonEventDataWorkerData->env, result, "code", value); in SetCommonEventData()
85 …commonEventDataWorkerData->env, commonEventDataWorkerData->data.c_str(), NAPI_AUTO_LENGTH, &value); in SetCommonEventData()
86 napi_set_named_property(commonEventDataWorkerData->env, result, "data", value); in SetCommonEventData()
91 wantParamsValue = OHOS::AppExecFwk::WrapWantParams(commonEventDataWorkerData->env, wantParams); in SetCommonEventData()
93 … napi_set_named_property(commonEventDataWorkerData->env, result, "parameters", wantParamsValue); in SetCommonEventData()
[all …]
/base/compileruntime/js_sys_module/process/
Dnative_module_process.cpp27 static napi_value DealType(napi_env env, napi_value args[], size_t argsSize) in DealType() argument
31 NAPI_CALL(env, napi_typeof(env, args[0], &valueType)); in DealType()
32 NAPI_ASSERT(env, valueType == napi_string, "Wrong argument typr. String expected"); in DealType()
35 NAPI_CALL(env, napi_throw_error(env, "", "command is empty")); in DealType()
47 NAPI_CALL(env, napi_get_named_property(env, args[1], keyStr[i].c_str(), &property)); in DealType()
51 NAPI_CALL(env, napi_typeof(env, property, &propertyType)); in DealType()
52 … NAPI_ASSERT(env, propertyType == napi_number || propertyType == napi_undefined, in DealType()
55 NAPI_CALL(env, napi_get_value_int32(env, property, &timeout)); in DealType()
57 … NAPI_CALL(env, napi_throw_error(env, "", "options timeout is lessthen zero")); in DealType()
62 NAPI_CALL(env, napi_typeof(env, property, &propertyType)); in DealType()
[all …]
/base/location/interfaces/innerkits/locator_standard/src/
Dnapi_util.cpp32 napi_value UndefinedNapiValue(const napi_env& env) in UndefinedNapiValue() argument
35 NAPI_CALL(env, napi_get_undefined(env, &result)); in UndefinedNapiValue()
39 void SatelliteStatusToJs(const napi_env& env, in SatelliteStatusToJs() argument
47 SetValueDouble(env, "satellitesNumber", statusInfo->GetSatellitesNumber(), result); in SatelliteStatusToJs()
49 NAPI_CALL_RETURN_VOID(env, in SatelliteStatusToJs()
50 … napi_create_array_with_length(env, statusInfo->GetSatellitesNumber(), &satelliteIdsArray)); in SatelliteStatusToJs()
51 NAPI_CALL_RETURN_VOID(env, in SatelliteStatusToJs()
52 napi_create_array_with_length(env, statusInfo->GetSatellitesNumber(), &cn0Array)); in SatelliteStatusToJs()
53 NAPI_CALL_RETURN_VOID(env, in SatelliteStatusToJs()
54 napi_create_array_with_length(env, statusInfo->GetSatellitesNumber(), &altitudesArray)); in SatelliteStatusToJs()
[all …]
/base/sensors/miscdevice/interfaces/plugin/vibrator/src/
Dvibrator_js.cpp35 static napi_value VibrateTime(napi_env env, napi_value args[], size_t argc) in VibrateTime() argument
37 NAPI_ASSERT(env, (argc == 1 || argc == 2), "Wrong argument number"); in VibrateTime()
39 NAPI_ASSERT(env, GetInt32Value(env, args[0], duration), "Get int number fail"); in VibrateTime()
40 sptr<AsyncCallbackInfo> asyncCallbackInfo = new (std::nothrow) AsyncCallbackInfo(env); in VibrateTime()
51 …NAPI_ASSERT(env, IsMatchType(env, args[1], napi_function), "Wrong argument type. function expected… in VibrateTime()
52 NAPI_CALL(env, napi_create_reference(env, args[1], 1, &asyncCallbackInfo->callback[0])); in VibrateTime()
59 NAPI_CALL(env, napi_create_promise(env, &deferred, &promise)); in VibrateTime()
65 static napi_value VibrateEffectId(napi_env env, napi_value args[], size_t argc) in VibrateEffectId() argument
67 NAPI_ASSERT(env, (argc == 1 || argc == 2), "Wrong argument number"); in VibrateEffectId()
69 …NAPI_ASSERT(env, GetStringValue(env, args[0], effectId), "Wrong argument type. String or function … in VibrateEffectId()
[all …]
Dvibrator_napi_utils.cpp31 napi_delete_async_work(env, asyncWork); in ~AsyncCallbackInfo()
36 napi_delete_reference(env, callback[i]); in ~AsyncCallbackInfo()
41 bool IsMatchType(const napi_env &env, const napi_value &value, const napi_valuetype &type) in IsMatchType() argument
44 NAPI_CALL_BASE(env, napi_typeof(env, value, &paramType), false); in IsMatchType()
52 bool GetNapiInt32(const napi_env &env, const int32_t value, napi_value &result) in GetNapiInt32() argument
55 NAPI_CALL_BASE(env, napi_create_int32(env, value, &result), false); in GetNapiInt32()
59 bool GetInt32Value(const napi_env &env, const napi_value &value, int32_t &result) in GetInt32Value() argument
63 NAPI_CALL_BASE(env, napi_typeof(env, value, &valuetype), false); in GetInt32Value()
64 NAPI_ASSERT_BASE(env, valuetype == napi_number, in GetInt32Value()
66 NAPI_CALL_BASE(env, napi_get_value_int32(env, value, &result), false); in GetInt32Value()
[all …]
/base/miscservices/time/interfaces/kits/js/napi/system_timer/src/
Dsystem_timer.cpp47 napi_env env = nullptr; member
55 napi_delete_reference(env, callback); in ~AsyncCallbackInfoCreate()
58 napi_env env = nullptr; member
72 napi_delete_reference(env, callback); in ~AsyncCallbackInfoStart()
75 napi_env env = nullptr; member
90 napi_delete_reference(env, callback); in ~AsyncCallbackInfoStop()
93 napi_env env = nullptr; member
107 napi_delete_reference(env, callback); in ~AsyncCallbackInfoDestroy()
110 napi_env env = nullptr; member
122 napi_value NapiGetNull(napi_env env) in NapiGetNull() argument
[all …]
/base/user_iam/user_idm/interfaces/kits/napi/src/
Dauthface_userIDM_helper.cpp25 napi_value UserIdentityManagerConstructor(napi_env env, napi_callback_info info) in UserIdentityManagerConstructor() argument
37 NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, nullptr)); in UserIdentityManagerConstructor()
38 NAPI_CALL(env, napi_wrap( in UserIdentityManagerConstructor()
39 env, thisVar, userIdentityManager, in UserIdentityManagerConstructor()
40 [](napi_env env, void *data, void *hint) { in UserIdentityManagerConstructor() argument
50 napi_value OpenSession(napi_env env, napi_callback_info info) in OpenSession() argument
56 NAPI_CALL(env, napi_get_cb_info(env, info, &argcAsync, argv, &thisVar, nullptr)); in OpenSession()
58 NAPI_CALL(env, napi_unwrap(env, thisVar, (void **)&userIdentityManager)); in OpenSession()
64 return userIdentityManager->NAPI_OpenSession(env, info); in OpenSession()
67 napi_value AddCredential(napi_env env, napi_callback_info info) in AddCredential() argument
[all …]
/base/accessibility/interfaces/kits/napi/src/
Dnapi_accessibility_utils.cpp33 std::string GetStringFromNAPI(napi_env env, napi_value value) in GetStringFromNAPI() argument
38 if (napi_get_value_string_utf8(env, value, nullptr, 0, &size) != napi_ok) { in GetStringFromNAPI()
44 if (napi_get_value_string_utf8(env, value, result.data(), (size + 1), &size) != napi_ok) { in GetStringFromNAPI()
51 bool ParseString(napi_env env, std::string& param, napi_value args) in ParseString() argument
55 status = napi_typeof(env, args, &valuetype); in ParseString()
60 NAPI_ASSERT(env, valuetype == napi_string, "Wrong argument type. String expected."); in ParseString()
61 param = GetStringFromNAPI(env, args); in ParseString()
66 bool ParseUint32(napi_env env, uint32_t& param, napi_value args) in ParseUint32() argument
70 status = napi_typeof(env, args, &valuetype); in ParseUint32()
76 NAPI_ASSERT(env, valuetype == napi_number, "Wrong argument type. uint32 expected."); in ParseUint32()
[all …]
/base/global/i18n_standard/interfaces/js/kits/include/
Di18n_addon.h35 void GetOptionMap(napi_env env, napi_value argv, std::map<std::string, std::string> &map);
36 void GetOptionValue(napi_env env, napi_value options, const std::string &optionName,
41 static napi_value Init(napi_env env, napi_value exports);
42 static void Destructor(napi_env env, void *nativeObject, void *finalize_hint);
45 static napi_value GetSystemLanguages(napi_env env, napi_callback_info info);
46 static napi_value GetSystemCountries(napi_env env, napi_callback_info info);
47 static napi_value IsSuggested(napi_env env, napi_callback_info info);
48 static napi_value GetDisplayLanguage(napi_env env, napi_callback_info info);
49 static napi_value GetDisplayCountry(napi_env env, napi_callback_info info);
50 static napi_value GetSystemLanguage(napi_env env, napi_callback_info info);
[all …]
/base/miscservices/request/download/interfaces/kits/js/napi/download_single/src/
Dnapi_utils.cpp27 napi_valuetype GetValueType(napi_env env, napi_value value) in GetValueType() argument
34 NAPI_CALL_BASE(env, napi_typeof(env, value, &valueType), napi_undefined); in GetValueType()
39 bool HasNamedProperty(napi_env env, napi_value object, const std::string &propertyName) in HasNamedProperty() argument
42 …NAPI_CALL_BASE(env, napi_has_named_property(env, object, propertyName.c_str(), &hasProperty), fals… in HasNamedProperty()
46 napi_value GetNamedProperty(napi_env env, napi_value object, const std::string &propertyName) in GetNamedProperty() argument
50 NAPI_CALL(env, napi_has_named_property(env, object, propertyName.c_str(), &hasProperty)); in GetNamedProperty()
54 NAPI_CALL(env, napi_get_named_property(env, object, propertyName.c_str(), &value)); in GetNamedProperty()
58 void SetNamedProperty(napi_env env, napi_value object, const std::string &name, napi_value value) in SetNamedProperty() argument
60 (void)napi_set_named_property(env, object, name.c_str(), value); in SetNamedProperty()
63 std::vector<std::string> GetPropertyNames(napi_env env, napi_value object) in GetPropertyNames() argument
[all …]
/base/account/os_account/interfaces/kits/napi/appaccount/src/
Dnapi_app_account.cpp31 napi_value NapiAppAccount::Init(napi_env env, napi_value exports) in Init() argument
38env, napi_define_properties(env, exports, sizeof(descriptor) / sizeof(napi_property_descriptor), d… in Init()
70 NAPI_CALL(env, in Init()
71 napi_define_class(env, in Init()
79 NAPI_CALL(env, napi_create_reference(env, cons, 1, &appAccountRef_)); in Init()
80 NAPI_CALL(env, napi_set_named_property(env, exports, APP_ACCOUNT_CLASS_NAME.c_str(), cons)); in Init()
85 napi_value NapiAppAccount::JsConstructor(napi_env env, napi_callback_info cbinfo) in JsConstructor() argument
89 NAPI_CALL(env, napi_get_cb_info(env, cbinfo, nullptr, nullptr, &thisVar, nullptr)); in JsConstructor()
94 return NapiGetNull(env); in JsConstructor()
96 …napi_wrap(env, thisVar, objectInfo, [](napi_env env, void *data, void *hint) {}, nullptr, nullptr); in JsConstructor() argument
[all …]
/base/account/os_account/interfaces/kits/napi/osaccount/src/
Dnapi_os_account.cpp30 napi_value OsAccountInit(napi_env env, napi_value exports) in OsAccountInit() argument
37env, napi_define_properties(env, exports, sizeof(descriptor) / sizeof(napi_property_descriptor), d… in OsAccountInit()
40 napi_create_object(env, &osAccountType); in OsAccountInit()
42 SetEnumProperty(env, osAccountType, OS_ACCOUNT_TYPE_ADMIN, "ADMIN"); in OsAccountInit()
43 SetEnumProperty(env, osAccountType, OS_ACCOUNT_TYPE_NORMAL, "NORMAL"); in OsAccountInit()
44 SetEnumProperty(env, osAccountType, OS_ACCOUNT_TYPE_GUEST, "GUEST"); in OsAccountInit()
49 …NAPI_CALL(env, napi_define_properties(env, exports, sizeof(exportEnum) / sizeof(*exportEnum), expo… in OsAccountInit()
83 NAPI_CALL(env, in OsAccountInit()
84 napi_define_class(env, in OsAccountInit()
92 NAPI_CALL(env, napi_create_reference(env, cons, 1, &osAccountRef_)); in OsAccountInit()
[all …]

12345678910>>...18